Check for no match in version check

pull/7247/head
Jimmy Brisson 2018-06-25 18:04:11 -05:00
parent 59e8631d3a
commit 0e56c18058
3 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,7 @@ class ARM(mbedToolchain):
msg = ("Compiler version mismatch: Have {}; "
"expected version >= {} and < {}"
.format(found_version, min_ver, max_ver))
elif len(match.groups()) != 1:
elif not match or len(match.groups()) != 1:
msg = ("Compiler version mismatch: Could not detect version; "
"expected version >= {} and < {}"
.format(min_ver, max_ver))

View File

@ -122,7 +122,7 @@ class GCC(mbedToolchain):
msg = ("Compiler version mismatch: Have {}; "
"expected version >= {} and < {}"
.format(found_version, min_ver, max_ver))
elif len(match.groups()) != 1:
elif not match or len(match.groups()) != 1:
msg = ("Compiler version mismatch: Could not detect version; "
"expected version >= {} and < {}"
.format(min_ver, max_ver))

View File

@ -103,7 +103,7 @@ class IAR(mbedToolchain):
if found_version and LooseVersion(found_version) != self.IAR_VERSION:
msg = "Compiler version mismatch: Have {}; expected {}".format(
found_version, self.IAR_VERSION)
elif len(match.groups()) != 1:
elif not match or len(match.groups()) != 1:
msg = ("Compiler version mismatch: Could Not detect compiler "
"version; expected {}".format(self.IAR_VERSION))
if msg: