Skip to content

Commit ca3fafe

Browse files
committed
Fix normalization when checking path in curr_module_paths
1 parent 02e9c6d commit ca3fafe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

easybuild/tools/modules.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def add_module_path(self, path, set_mod_paths=True):
400400
:param set_mod_paths: (re)set self.mod_paths
401401
"""
402402
path = normalize_path(path)
403-
if path not in curr_module_paths(normalize=True):
403+
if path not in curr_module_paths(clean=False, normalize=True):
404404
# add module path via 'module use' and make sure self.mod_paths is synced
405405
self.use(path)
406406
if set_mod_paths:
@@ -1539,8 +1539,8 @@ def prepend_module_path(self, path, set_mod_paths=True, priority=None):
15391539
if priority is None and self._has_module_paths_with_priority():
15401540
priority = self.HIGH_PRIORITY
15411541
self.use(path, priority=priority)
1542-
modulepath = curr_module_paths(clean=False)
1543-
path_idx = modulepath.index(path)
1542+
modulepath = curr_module_paths(normalize=True, clean=False)
1543+
path_idx = modulepath.index(normalize_path(path))
15441544
if path_idx != 0:
15451545
print_warning("Path '%s' could not be prepended to $MODULEPATH. "
15461546
"The following paths are still in front of it: %s\n"

0 commit comments

Comments
 (0)