mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-02 03:12:34 +01: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:
@@ -46,7 +46,7 @@ def get_commit():
|
||||
p.wait()
|
||||
if p.returncode:
|
||||
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)
|
||||
else:
|
||||
return std[:8]
|
||||
|
Reference in New Issue
Block a user