[Packaging] Fix get_version with no git command

An unhandled FileNotFoundError was encounted if git command was not available.
This commit is contained in:
Calum Lind 2019-06-07 14:43:52 +01:00
parent aa35247e95
commit 0c87d9bd7d
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ def call_git_describe(prefix='', suffix=''):
cmd = 'git describe --tags --match %s[0-9]*' % prefix cmd = 'git describe --tags --match %s[0-9]*' % prefix
try: try:
output = subprocess.check_output(cmd.split(), stderr=subprocess.PIPE) output = subprocess.check_output(cmd.split(), stderr=subprocess.PIPE)
except subprocess.CalledProcessError: except (OSError, subprocess.CalledProcessError):
return None return None
else: else:
version = output.decode('utf-8').strip().replace(prefix, '') version = output.decode('utf-8').strip().replace(prefix, '')