Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check stderr for subprocess call errors #67

Merged
merged 15 commits into from
Feb 15, 2021
5 changes: 4 additions & 1 deletion autover/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def run_cmd(args, cwd=None):
cwd=cwd)
output, error = (str(s.decode()).strip() for s in proc.communicate())

if proc.returncode != 0:
# Detects errors as _either_ a non-zero return code _or_ messages
# printed to stderr, because the return code is erroneously fixed at
# zero in some cases (see https://github.com/holoviz/param/pull/389).
if proc.returncode != 0 or len(error) > 0:
raise Exception(proc.returncode, error)
return output

Expand Down
5 changes: 4 additions & 1 deletion examples/PkgBundle/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def run_cmd(args, cwd=None):
cwd=cwd)
output, error = (str(s.decode()).strip() for s in proc.communicate())

if proc.returncode != 0:
# Detects errors as _either_ a non-zero return code _or_ messages
# printed to stderr, because the return code is erroneously fixed at
# zero in some cases (see https://github.com/holoviz/param/pull/389).
if proc.returncode != 0 or len(error) > 0:
raise Exception(proc.returncode, error)
return output

Expand Down
5 changes: 4 additions & 1 deletion examples/pkg_bundle/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def run_cmd(args, cwd=None):
cwd=cwd)
output, error = (str(s.decode()).strip() for s in proc.communicate())

if proc.returncode != 0:
# Detects errors as _either_ a non-zero return code _or_ messages
# printed to stderr, because the return code is erroneously fixed at
# zero in some cases (see https://github.com/holoviz/param/pull/389).
if proc.returncode != 0 or len(error) > 0:
raise Exception(proc.returncode, error)
return output

Expand Down