summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2019-02-08 11:57:03 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2019-02-08 11:57:03 (GMT)
commit70c1a1b5dbefb0a9e51eb0230e0d4f9394602d3f (patch)
tree3d4681df45290542cde4b68e2af397f751974d69
parent7ac96b4f1e407c8a3324269d46ccc064b98ccbe4 (diff)
downloadeopayment-70c1a1b5dbefb0a9e51eb0230e0d4f9394602d3f.zip
eopayment-70c1a1b5dbefb0a9e51eb0230e0d4f9394602d3f.tar.gz
eopayment-70c1a1b5dbefb0a9e51eb0230e0d4f9394602d3f.tar.bz2
setup.py: handle case of a tagged dirty workdir
-rwxr-xr-xsetup.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 8b68680..410b982 100755
--- a/setup.py
+++ b/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