Skip to content

Commit

Permalink
tag_to_version.py: fix Python3 error
Browse files Browse the repository at this point in the history
subprocess.communicate returns bytes instead of a str which is not the
same for Python3. Therefore, we need to decode the bytes.
  • Loading branch information
julianoes committed Apr 15, 2017
1 parent 9038be2 commit bfa6e09
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Tools/tag_to_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
'git describe --always --tags'.split(),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
# Python3 needs this decode step.
stdout = stdout.decode('ascii')
res = stdout.split('-')[0].split('.')
major = res[0].replace('v','')
minor = res[1]
Expand Down

0 comments on commit bfa6e09

Please sign in to comment.