Skip to content

Commit 642b76b

Browse files
author
Alan O'Cais
committed
Minimise the scope of uniq_paths
1 parent 82ec7f8 commit 642b76b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

easybuild/framework/easyblock.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,20 +1401,21 @@ def make_module_req(self):
14011401
for path in paths:
14021402
if path not in uniq_paths:
14031403
uniq_paths.append(path)
1404+
paths = uniq_paths
14041405
if key in keys_requiring_files:
14051406
# only retain paths that contain at least one file
14061407
retained_paths = [
1407-
path for path in uniq_paths
1408+
path for path in paths
14081409
if os.path.isdir(os.path.join(self.installdir, path))
14091410
and dir_contains_files(os.path.join(self.installdir, path))
14101411
]
1411-
if retained_paths != uniq_paths:
1412+
if retained_paths != paths:
14121413
self.log.info("Only retaining paths for %s that contain at least one file: %s -> %s",
14131414
key, paths, retained_paths)
1414-
uniq_paths = retained_paths
1415+
paths = retained_paths
14151416

1416-
if uniq_paths:
1417-
lines.append(self.module_generator.prepend_paths(key, uniq_paths))
1417+
if paths:
1418+
lines.append(self.module_generator.prepend_paths(key, paths))
14181419
if self.dry_run:
14191420
self.dry_run_msg('')
14201421

0 commit comments

Comments
 (0)