Skip to content

Commit 0e56c18

Browse files
committed
Check for no match in version check
1 parent 59e8631 commit 0e56c18

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tools/toolchains/arm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def version_check(self):
105105
msg = ("Compiler version mismatch: Have {}; "
106106
"expected version >= {} and < {}"
107107
.format(found_version, min_ver, max_ver))
108-
elif len(match.groups()) != 1:
108+
elif not match or len(match.groups()) != 1:
109109
msg = ("Compiler version mismatch: Could not detect version; "
110110
"expected version >= {} and < {}"
111111
.format(min_ver, max_ver))

tools/toolchains/gcc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def version_check(self):
122122
msg = ("Compiler version mismatch: Have {}; "
123123
"expected version >= {} and < {}"
124124
.format(found_version, min_ver, max_ver))
125-
elif len(match.groups()) != 1:
125+
elif not match or len(match.groups()) != 1:
126126
msg = ("Compiler version mismatch: Could not detect version; "
127127
"expected version >= {} and < {}"
128128
.format(min_ver, max_ver))

tools/toolchains/iar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def version_check(self):
103103
if found_version and LooseVersion(found_version) != self.IAR_VERSION:
104104
msg = "Compiler version mismatch: Have {}; expected {}".format(
105105
found_version, self.IAR_VERSION)
106-
elif len(match.groups()) != 1:
106+
elif not match or len(match.groups()) != 1:
107107
msg = ("Compiler version mismatch: Could Not detect compiler "
108108
"version; expected {}".format(self.IAR_VERSION))
109109
if msg:

0 commit comments

Comments
 (0)