Skip to content

Commit 4039401

Browse files
committed
Revert "show error message"
This reverts commit 334472f.
1 parent d09a226 commit 4039401

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

monai/utils/misc.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -891,12 +891,11 @@ def run_cmd(cmd_list: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
891891
try:
892892
return subprocess.run(cmd_list, **kwargs)
893893
except subprocess.CalledProcessError as e:
894-
errors = str(e.stderr.decode(errors="replace"))
895-
output = str(e.stdout.decode(errors="replace"))
896894
if not debug:
897-
raise RuntimeError(f"subprocess call error {e.returncode}: {errors}.") from e
898-
else:
899-
raise RuntimeError(f"subprocess call error {e.returncode}: {errors}, {output}.") from e
895+
raise
896+
output = str(e.stdout.decode(errors="replace"))
897+
errors = str(e.stderr.decode(errors="replace"))
898+
raise RuntimeError(f"subprocess call error {e.returncode}: {errors}, {output}.") from e
900899

901900

902901
def is_sqrt(num: Sequence[int] | int) -> bool:

0 commit comments

Comments
 (0)