Browse Source

tag_to_version.py: fix Python3 error (#7056)

subprocess.communicate returns bytes instead of a str which is not the
same for Python3. Therefore, we need to decode the bytes.
sbg
Julian Oes 8 years ago committed by Daniel Agar
parent
commit
0d2e847c57
  1. 2
      Tools/tag_to_version.py

2
Tools/tag_to_version.py

@ -12,6 +12,8 @@ p= subprocess.Popen( @@ -12,6 +12,8 @@ p= subprocess.Popen(
'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]

Loading…
Cancel
Save