Skip to content

Commit dc488f5

Browse files
committed
Switch to using relpath to make code robust
1 parent 7b7a59f commit dc488f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

easybuild/framework/easyblock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ 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(f'{self.installdir}/bin/python'): # only needed when not a base python installation
1443-
python_paths = [path[len(self.installdir)+1:]
1443+
python_paths = [os.path.relpath(path, self.installdir)
14441444
for path in glob.glob(f'{self.installdir}/lib/python*/site-packages')
14451445
if re.match(self.installdir + r'/lib/python\d+\.\d+/site-packages', path)]
14461446

0 commit comments

Comments
 (0)