Skip to content

Commit d1c889f

Browse files
committed
Fix relative paths when globbing for python paths
1 parent 1acb45a commit d1c889f

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
@@ -1441,8 +1441,9 @@ def make_module_extra(self, altroot=None, altversion=None):
14411441
# Add automatic PYTHONPATH or EBPYTHONPREFIXES if they aren't already present
14421442
if 'PYTHONPATH' not in self.module_generator.added_paths_per_key and \
14431443
'EBPYTHONPREFIXES' not in self.module_generator.added_paths_per_key:
1444-
python_paths = [path for path in glob.glob('lib*/python*/site-packages')
1445-
if re.match(r'lib(64)?/python\d+\.\d+/site-packages', path)]
1444+
python_paths = [path[len(self.installdir)+1:]
1445+
for path in glob.glob(f'{self.installdir}/lib*/python*/site-packages')
1446+
if re.match(self.installdir + r'/lib(64)?/python\d+\.\d+/site-packages', path)]
14461447
use_ebpythonprefixes = get_software_root('Python') and build_option('prefer_ebpythonprefixes') and \
14471448
self.cfg['prefer_ebpythonprefixes']
14481449

0 commit comments

Comments
 (0)