From: Stephen Finucane Date: Thu, 2 Mar 2017 12:31:22 +0000 (+0000) Subject: Catch Subprocess exceptions X-Git-Tag: v2.0.0-rc1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e456618a22c5cd1080c14537806765fcfbc6a6f;p=thirdparty%2Fpatchwork.git 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") --- 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')