From 35764dd770db18c5aeddccab6e72eb413e4e4214 Mon Sep 17 00:00:00 2001 From: Udi Meiri Date: Wed, 9 Dec 2020 14:17:54 -0800 Subject: [PATCH] Handle exceptions that don't have a returncode Fixes #307 --- codecov/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index e337717..dc53b9a 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