From 0c87d9bd7da0ea2971eff8a3503f68cd1219bb38 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 7 Jun 2019 14:43:52 +0100 Subject: [PATCH] [Packaging] Fix get_version with no git command An unhandled FileNotFoundError was encounted if git command was not available. --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index b1e36adc2..ff8f684d5 100755 --- a/version.py +++ b/version.py @@ -45,7 +45,7 @@ def call_git_describe(prefix='', suffix=''): cmd = 'git describe --tags --match %s[0-9]*' % prefix try: output = subprocess.check_output(cmd.split(), stderr=subprocess.PIPE) - except subprocess.CalledProcessError: + except (OSError, subprocess.CalledProcessError): return None else: version = output.decode('utf-8').strip().replace(prefix, '')