From ae99db3e2416c056178996697b87067e30046473 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Thu, 26 Jul 2018 11:24:21 +0100 Subject: [PATCH] utils/version: Fix check to only decode bytes When using Python3 the returned value of the commit is a byte string and therefore needs to be decoded. --- devlib/utils/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/utils/version.py b/devlib/utils/version.py index 15bf481..5e7b688 100644 --- a/devlib/utils/version.py +++ b/devlib/utils/version.py @@ -24,7 +24,7 @@ def get_commit(): p.wait() if p.returncode: return None - if sys.version_info[0] == 3 and isinstance(std, str): + if sys.version_info[0] == 3 and isinstance(std, bytes): return std[:8].decode(sys.stdout.encoding, 'replace') else: return std[:8]