[Packaging] Fix get_version with no git command
An unhandled FileNotFoundError was encounted if git command was not available.
This commit is contained in:
parent
aa35247e95
commit
0c87d9bd7d
|
@ -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, '')
|
||||||
|
|
Loading…
Reference in New Issue