]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Catch Subprocess exceptions
authorStephen Finucane <stephen@that.guru>
Thu, 2 Mar 2017 12:31:22 +0000 (12:31 +0000)
committerStephen Finucane <stephen@that.guru>
Thu, 2 Mar 2017 12:31:22 +0000 (12:31 +0000)
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 <stephen@that.guru>
Fixes: d3e9aee ("Don't catch non-Python 2.7 exceptions")
patchwork/version.py

index 7e3fa2e8a50a49043e9e0d28a8dc44b15b3f5220..e38f50cd066070b4c38ab77b9ab1bd14686196d6 100644 (file)
@@ -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')