summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorL. E. Segovia <amy@centricular.com>2024-02-08 01:14:54 +0000
committerL. E. Segovia <amy@centricular.com>2024-02-10 11:37:04 -0300
commit0dd535daeafc28cf05ad4b121651c9470efefd23 (patch)
tree7e947cbe712cc2d11bcf17bf641ece5c4a5302c3
parentdf6ff36a1c7266c861e0273dd387bbbd49fc7a1f (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/1358>
-rw-r--r--cerbero/utils/shell.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py
index 5ad20ce6..2cbf109a 100644
--- a/cerbero/utils/shell.py
+++ b/cerbero/utils/shell.py
@@ -212,8 +212,8 @@ 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, shell=shell
+ subprocess.run(
+ cmd, cwd=cmd_dir, env=env, stdout=logfile, stderr=subprocess.STDOUT, stdin=stdin, shell=shell, check=True
)
except SUBPROCESS_EXCEPTIONS as e:
returncode = getattr(e, 'returncode', -1)