setup.py: handle case of a tagged dirty workdir
This commit is contained in:
parent
7ac96b4f1e
commit
70c1a1b5db
6
setup.py
6
setup.py
|
@ -75,7 +75,11 @@ def get_version():
|
|||
if p.returncode == 0:
|
||||
result = result.decode('ascii').strip()[1:] # strip spaces/newlines and initial v
|
||||
if '-' in result: # not a tagged version
|
||||
real_number, commit_count, commit_hash = result.split('-', 2)
|
||||
try:
|
||||
real_number, commit_count, commit_hash = result.split('-', 2)
|
||||
except ValueError:
|
||||
real_number, commit_hash = result.split('-', 2)
|
||||
commit_count = 0
|
||||
version = '%s.post%s+%s' % (real_number, commit_count, commit_hash)
|
||||
else:
|
||||
version = result
|
||||
|
|
Loading…
Reference in New Issue