mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
utils/version: do not decode bytes
Check that the resulting output inside get_commit() is a str before attempting to decode it when running on Python 3.
This commit is contained in:
parent
56f3b1c317
commit
8ac89fe9ed
@ -24,7 +24,7 @@ def get_commit():
|
|||||||
p.wait()
|
p.wait()
|
||||||
if p.returncode:
|
if p.returncode:
|
||||||
return None
|
return None
|
||||||
if sys.version_info[0] == 3:
|
if sys.version_info[0] == 3 and isinstance(std, str):
|
||||||
return std[:8].decode(sys.stdout.encoding, 'replace')
|
return std[:8].decode(sys.stdout.encoding, 'replace')
|
||||||
else:
|
else:
|
||||||
return std[:8]
|
return std[:8]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user