Skip to content

Commit 7eb59aa

Browse files
Print run errors only if so instructed
1 parent 062b702 commit 7eb59aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shared/python/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,9 @@ def run(command: str, ok_message: str = '', error_message: str = '', print_outpu
579579
# Handles both CalledProcessError and any custom/other exceptions (for test mocks)
580580
output_text = getattr(e, 'output', b'').decode("utf-8") if hasattr(e, 'output') and isinstance(e.output, (bytes, bytearray)) else str(e)
581581
success = False
582-
traceback.print_exc()
582+
583+
if print_errors:
584+
traceback.print_exc()
583585

584586
if print_output:
585587
print(f"Command output:\n{output_text}")

0 commit comments

Comments
 (0)