Skip to content

Commit d08b43f

Browse files
committed
We refer to port multiple times, make it convenient
1 parent 641a398 commit d08b43f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/ci_set_matrix.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ def get_settings(board):
131131

132132
# See if it is port specific
133133
port_matches = port_pattern.search(p)
134+
port = port_matches.group(1) if port_matches else None
134135
module_matches = module_pattern.search(p)
135-
if port_matches and not module_matches:
136-
port = port_matches.group(1)
136+
if port and not module_matches:
137137
if port != "unix":
138138
boards_to_build.update(port_to_boards[port])
139139
continue
@@ -149,8 +149,7 @@ def get_settings(board):
149149
# As a (nearly) last resort, for some certain files, we compute the settings from the
150150
# makefile for each board and determine whether to build them that way.
151151
if p.startswith("frozen") or p.startswith("supervisor") or module_matches:
152-
if port_matches:
153-
port = port_matches.group(1)
152+
if port:
154153
board_ids = port_to_boards[port]
155154
else:
156155
board_ids = all_board_ids

0 commit comments

Comments
 (0)