Added encoding to version check for Py3 compat

pull/9521/head
Cruz Monrreal II 2019-01-24 00:14:51 -06:00
parent cc3114113d
commit 149d280e7a
3 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ class ARM(mbedToolchain):
stdout, _, retcode = run_cmd([self.cc[0], "--vsn"], redirect=True)
msg = None
min_ver, max_ver = self.ARMCC_RANGE
match = self.ARMCC_VERSION_RE.search(stdout)
match = self.ARMCC_VERSION_RE.search(stdout.encode("utf-8"))
found_version = LooseVersion(match.group(1).decode("utf-8")) if match else None
min_ver, max_ver = self.ARMCC_RANGE
if found_version and (found_version < min_ver or found_version >= max_ver):

View File

@ -133,7 +133,7 @@ class GCC(mbedToolchain):
def version_check(self):
stdout, _, retcode = run_cmd([self.cc[0], "--version"], redirect=True)
msg = None
match = self.GCC_VERSION_RE.search(stdout)
match = self.GCC_VERSION_RE.search(stdout.encode("utf-8"))
found_version = LooseVersion(match.group(0).decode('utf-8')) if match else None
min_ver, max_ver = self.GCC_RANGE
if found_version and (found_version < min_ver or found_version >= max_ver):

View File

@ -99,7 +99,7 @@ class IAR(mbedToolchain):
def version_check(self):
stdout, _, retcode = run_cmd([self.cc[0], "--version"], redirect=True)
msg = None
match = self.IAR_VERSION_RE.search(stdout)
match = self.IAR_VERSION_RE.search(stdout.encode("utf-8"))
found_version = match.group(1).decode("utf-8") if match else None
if found_version and LooseVersion(found_version) != self.IAR_VERSION:
msg = "Compiler version mismatch: Have {}; expected {}".format(