forked from Archive/PX4-Autopilot
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.
This commit is contained in:
parent
4487f06629
commit
0d2e847c57
|
@ -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…
Reference in New Issue