From 4e456618a22c5cd1080c14537806765fcfbc6a6f Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 2 Mar 2017 12:31:22 +0000 Subject: [PATCH] Catch Subprocess exceptions Apparently different environments raise different return codes. Handle the invalid return codes thrown by subprocess, presumably related to how Travis checks out things from git. Signed-off-by: Stephen Finucane Fixes: d3e9aee ("Don't catch non-Python 2.7 exceptions") --- patchwork/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patchwork/version.py b/patchwork/version.py index 7e3fa2e8..e38f50cd 100644 --- a/patchwork/version.py +++ b/patchwork/version.py @@ -57,7 +57,7 @@ def get_raw_git_version(): try: git_version = subprocess.check_output(['git', 'describe'], cwd=ROOT_DIR) - except OSError: + except (OSError, subprocess.CalledProcessError): return '' return git_version.strip().decode('utf-8') -- 2.47.3