Skip to content

Commit 9813bc8

Browse files
committed
Replace glob(root_dir=...) which only is supported in python 3.10
Instead, using absolute paths and then make them relative.
1 parent 7e417d3 commit 9813bc8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

easybuild/framework/easyblock.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,8 +1440,9 @@ def make_module_extra(self, altroot=None, altversion=None):
14401440

14411441
# Add automatic PYTHONPATH or EBPYTHONPREFIXES if they aren't already present and python paths exist
14421442
if not os.path.isfile(os.path.join(self.installdir, 'bin/python')): # only needed when not a python install
1443-
python_paths = [path for path in glob.glob('lib/python*/site-packages', root_dir=self.installdir)
1444-
if re.match(r'lib/python\d+\.\d+/site-packages', path)]
1443+
candidate_paths = (os.path.relpath(path, self.installdir)
1444+
for path in glob.glob(f'{self.installdir}/lib/python*/site-packages'))
1445+
python_paths = [path for path in candidate_paths if re.match(r'lib/python\d+\.\d+/site-packages', path)]
14451446

14461447
runtime_deps = [dep['name'] for dep in self.cfg.dependencies(runtime_only=True)]
14471448
use_ebpythonprefixes = 'Python' in runtime_deps and \

0 commit comments

Comments
 (0)