buildcommands: Use regular str() types for input 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:45:37 -04:00
parent ccee189f99
commit dd98884bb4
1 changed files with 1 additions and 1 deletions

View File

@ -453,7 +453,7 @@ def check_output(prog):
if retcode: if retcode:
return "" return ""
try: try:
return output.decode() return str(output.decode('utf8'))
except UnicodeError: except UnicodeError:
logging.debug("Exception on decode: %s" % (traceback.format_exc(),)) logging.debug("Exception on decode: %s" % (traceback.format_exc(),))
return "" return ""