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:
Kevin O'Connor 2021-10-31 13:40:53 -04:00
parent 7a6fd1a1aa
commit fc5353364a
1 changed files with 1 additions and 1 deletions

View File

@ -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: