From e485b9ed39ee3c2678ce96061aae2f55e5b8a3c0 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 11 Jul 2018 10:37:20 +0100 Subject: [PATCH] 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. --- wa/framework/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wa/framework/version.py b/wa/framework/version.py index b9474f40..2e1b8622 100644 --- a/wa/framework/version.py +++ b/wa/framework/version.py @@ -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]