Skip to content

Commit 3a82615

Browse files
authored
Merge pull request #4843 from Flamefire/fix-unbound-var
Fix unbound variable in error case in `build_and_install_software`
2 parents 9e164e3 + 701a158 commit 3a82615

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

easybuild/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ def build_and_install_software(ecs, init_session_state, exit_on_failure=True):
172172
adjust_permissions(parent_dir, stat.S_IWUSR, add=False, recursive=False)
173173

174174
if not ec_res['success'] and exit_on_failure:
175-
if not isinstance(ec_res['err'], EasyBuildError):
176-
raise ec_res['err']
177-
else:
178-
raise EasyBuildError(test_msg, exit_code=err_code)
175+
error = ec_res['err']
176+
if isinstance(error, EasyBuildError):
177+
error = EasyBuildError(test_msg, exit_code=error.exit_code)
178+
raise error
179179

180180
res.append((ec, ec_res))
181181

0 commit comments

Comments
 (0)