Skip to content

Commit bc4fe77

Browse files
committed
Fix iteration and list-hoisting in make_module_req
In dry-run mode a list is assumed, but hoisting happens afterwards
1 parent 4cf11d8 commit bc4fe77

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

easybuild/framework/easyblock.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,13 +1297,12 @@ def make_module_req(self):
12971297
# for these environment variables, the corresponding subdirectory must include at least one file
12981298
keys_requiring_files = ('CPATH', 'LD_LIBRARY_PATH', 'LIBRARY_PATH', 'PATH', 'CMAKE_LIBRARY_PATH')
12991299

1300-
for key in sorted(requirements):
1301-
if self.dry_run:
1302-
self.dry_run_msg(" $%s: %s" % (key, ', '.join(requirements[key])))
1303-
reqs = requirements[key]
1300+
for key, reqs in sorted(requirements.items()):
13041301
if isinstance(reqs, string_type):
13051302
self.log.warning("Hoisting string value %s into a list before iterating over it", reqs)
13061303
reqs = [reqs]
1304+
if self.dry_run:
1305+
self.dry_run_msg(" $%s: %s" % (key, ', '.join(reqs)))
13071306

13081307
for path in reqs:
13091308
# only use glob if the string is non-empty

0 commit comments

Comments
 (0)