Catch another IOError in get_version()
This commit is contained in:
parent
c13f4ba52d
commit
ac25e02e2d
@ -31,11 +31,10 @@ def get_version(version=None):
|
|||||||
sub = mapping[version[3]] + str(version[4])
|
sub = mapping[version[3]] + str(version[4])
|
||||||
try:
|
try:
|
||||||
git_head_path = '.git/' + open('.git/HEAD', 'r').read()[5:].rstrip()
|
git_head_path = '.git/' + open('.git/HEAD', 'r').read()[5:].rstrip()
|
||||||
except IOError:
|
|
||||||
git_commit_id = 'unknown'
|
|
||||||
else:
|
|
||||||
import os
|
import os
|
||||||
git_commit_id = open(os.path.abspath(git_head_path), 'r').read().rstrip()
|
git_commit_id = open(os.path.abspath(git_head_path), 'r').read().rstrip()
|
||||||
|
except IOError:
|
||||||
|
git_commit_id = 'unknown'
|
||||||
sub = '%s commit %s' % (sub, git_commit_id)
|
sub = '%s commit %s' % (sub, git_commit_id)
|
||||||
else:
|
else:
|
||||||
sub = ''
|
sub = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user