From f4b116df8fac14dd98c52acf2a1ca0ac8d54db68 Mon Sep 17 00:00:00 2001 From: Udi Meiri Date: Sat, 12 Dec 2020 14:29:56 -0800 Subject: [PATCH] Handle exceptions that don't have a returncode (#308) Fixes #307 --- codecov/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index 2b338d8..9490dd4 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -226,7 +226,11 @@ def try_to_run(cmd, shell=False, cwd=None): except Exception as e: write( " Error running `%s`: returncode=%s, output=%s" - % (cmd, e.returncode, str(getattr(e, "output", str(e)))) + % ( + cmd, + str(getattr(e, "returncode", None)), + str(getattr(e, "output", str(e))), + ) ) return None