summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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