From 70c1a1b5dbefb0a9e51eb0230e0d4f9394602d3f Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 8 Feb 2019 12:57:03 +0100 Subject: [PATCH 1/4] setup.py: handle case of a tagged dirty workdir --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.20.1