Skip to content

Commit f4b116d

Browse files
authored
Handle exceptions that don't have a returncode (codecov#308)
Fixes codecov#307
1 parent 58032a4 commit f4b116d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

codecov/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ def try_to_run(cmd, shell=False, cwd=None):
226226
except Exception as e:
227227
write(
228228
" Error running `%s`: returncode=%s, output=%s"
229-
% (cmd, e.returncode, str(getattr(e, "output", str(e))))
229+
% (
230+
cmd,
231+
str(getattr(e, "returncode", None)),
232+
str(getattr(e, "output", str(e))),
233+
)
230234
)
231235
return None
232236

0 commit comments

Comments
 (0)