summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorL. E. Segovia <amy@centricular.com>2024-02-08 01:14:54 +0000
committerTim-Philipp Müller <tim@centricular.com>2024-02-12 19:16:31 +0000
commit7d4778038a0f2bfa9639ee2bb773677c219e8e65 (patch)
treee28cd7689986408aef4728115c12c995030a0f3a
parentf92657a89e1453be2ff8f919ae3a3fffba3bb1f2 (diff)
shell/new_call: Fix output streams contents being hidden from the user on error
subprocess.check_call, for some reason, does not log appropriately the contents of stdout on error, nor it crashes out when a shell is required. This is the cause of a hidden failure when issuing `ld` to prelink all objects on macOS, because I specified a glob that would be expanded by the shell, and this step never occurs because it's already passed verbatim to `sh`. Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1364>
-rw-r--r--cerbero/utils/shell.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py
index ff0729d5..8e415970 100644
--- a/cerbero/utils/shell.py
+++ b/cerbero/utils/shell.py
@@ -198,9 +198,9 @@ def new_call(cmd, cmd_dir=None, fail=True, logfile=None, env=None, verbose=False
else:
stdin = None
try:
- subprocess.check_call(cmd, cwd=cmd_dir, env=env,
- stdout=logfile, stderr=subprocess.STDOUT,
- stdin=stdin)
+ subprocess.run(
+ cmd, cwd=cmd_dir, env=env, stdout=logfile, stderr=subprocess.STDOUT, stdin=stdin, check=True
+ )
except SUBPROCESS_EXCEPTIONS as e:
returncode = getattr(e, 'returncode', -1)
if not fail: