util: Use regular str() type in get_git_version() on Python2
Avoid using unicode() types on Python2 as it can lead to subtle errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
7a6fd1a1aa
commit
fc5353364a
|
@ -146,7 +146,7 @@ def get_git_version(from_file=True):
|
||||||
ver, err = process.communicate()
|
ver, err = process.communicate()
|
||||||
retcode = process.wait()
|
retcode = process.wait()
|
||||||
if retcode == 0:
|
if retcode == 0:
|
||||||
return ver.strip().decode()
|
return str(ver.strip().decode())
|
||||||
else:
|
else:
|
||||||
logging.debug("Error getting git version: %s", err)
|
logging.debug("Error getting git version: %s", err)
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in New Issue