mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
zulip_tools: Fix run to not eat error output.
We fix this by just using `subprocess.check_call`.
This commit is contained in:
@@ -92,8 +92,11 @@ def run(args, **kwargs):
|
||||
# With shell=True we can only pass string to Popen
|
||||
args = " ".join(args)
|
||||
|
||||
process = subprocess.Popen(args, **kwargs)
|
||||
rc = process.wait()
|
||||
if rc:
|
||||
raise subprocess.CalledProcessError(rc, args) # type: ignore # https://github.com/python/typeshed/pull/329
|
||||
return 0
|
||||
try:
|
||||
subprocess.check_call(args, **kwargs)
|
||||
except subprocess.CalledProcessError:
|
||||
print(WARNING + "A command run by %s failed; see output above." % (sys.argv[0])
|
||||
+ ENDC)
|
||||
print(WARNING + "Command was: %s" % (" ".join(args))
|
||||
+ ENDC)
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user