Skip to content

Commit d26470a

Browse files
committed
Correctly include process output with the thrown exception.
1 parent beec5bd commit d26470a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

codecov/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def check_output(cmd, **popen_args):
171171
process = Popen(cmd, stdout=PIPE, **popen_args)
172172
output, _ = process.communicate()
173173
if process.returncode:
174-
raise CalledProcessError(process.returncode, cmd)
174+
raise CalledProcessError(process.returncode, cmd, output)
175175
else:
176176
assert process.returncode == 0
177177
return output.decode('utf-8')
@@ -181,8 +181,8 @@ def try_to_run(cmd):
181181
try:
182182
return check_output(cmd, shell=True)
183183
except subprocess.CalledProcessError as e:
184-
write(' Error running `%s`: output=%s, returncode=%s, e=%s' % (cmd,
185-
str(getattr(e, 'output', '')), e.returncode, str(e)))
184+
write(' Error running `%s`: output=%s, returncode=%s' % (cmd, str(getattr(e, 'output', str(e))),
185+
e.returncode))
186186

187187

188188
def remove_non_ascii(data):

0 commit comments

Comments
 (0)