From dd98884bb43afdb64a21fc9e98f94f74572ab088 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 31 Oct 2021 13:45:37 -0400 Subject: [PATCH] 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 --- scripts/buildcommands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildcommands.py b/scripts/buildcommands.py index 37e47f85..2acf3e84 100644 --- a/scripts/buildcommands.py +++ b/scripts/buildcommands.py @@ -453,7 +453,7 @@ def check_output(prog): if retcode: return "" try: - return output.decode() + return str(output.decode('utf8')) except UnicodeError: logging.debug("Exception on decode: %s" % (traceback.format_exc(),)) return ""