Skip to content

Commit 8620e64

Browse files
committed
simplify logic for printing path to stdout/stderr output files in RunShellCmdError.print
1 parent f46dd91 commit 8620e64

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

easybuild/tools/run.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ def pad_4_spaces(msg):
114114
pad_4_spaces(f"working directory -> {self.work_dir}"),
115115
]
116116

117-
if self.stderr is None and self.out_file is not None:
118-
error_info.append(pad_4_spaces(f"output (stdout + stderr) -> {self.out_file}"))
119-
else:
120-
if self.out_file is not None:
121-
error_info.append(pad_4_spaces(f"output (stdout) -> {self.out_file}"))
122-
if self.err_file is not None:
123-
error_info.append(pad_4_spaces(f"error/warnings (stderr) -> {self.err_file}"))
117+
if self.out_file is not None:
118+
# if there's no separate file for error/warnings, then out_file includes both stdout + stderr
119+
out_info_msg = "output (stdout + stderr)" if self.err_file is None else "output (stdout) "
120+
error_info.append(pad_4_spaces(f"{out_info_msg} -> {self.out_file}"))
121+
122+
if self.err_file is not None:
123+
error_info.append(pad_4_spaces(f"error/warnings (stderr) -> {self.err_file}"))
124124

125125
caller_file_name, caller_line_nr, caller_function_name = self.caller_info
126126
called_from_info = f"'{caller_function_name}' function in {caller_file_name} (line {caller_line_nr})"

0 commit comments

Comments
 (0)