Skip to content

Commit 364e5f1

Browse files
authored
Merge pull request #9410 from elpekenin/fix/9407
[FIX] [Tooling] Broken regex'es in `build_board_specific_stubs`
2 parents 121d9ee + dc6c4ee commit 364e5f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/board_stubs/build_board_specific_stubs/board_stub_builder.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ def get_board_pins(pin_filename):
1717
if line.strip()[0:2] == "//":
1818
continue
1919

20-
search = re.search(r"MP_ROM_QSTR\(MP_QSTR_(.*?)\), MP_ROM_PTR", line)
20+
# \s* means any amount of whitespaces (no whitespaces allowed too)
21+
# related issue: https://github.com/adafruit/circuitpython/issues/9407
22+
23+
search = re.search(r"MP_ROM_QSTR\(MP_QSTR_(.*?)\),\s*MP_ROM_PTR", line)
2124
if search is None:
22-
search = re.search(r"MP_OBJ_NEW_QSTR\(MP_QSTR_(.*?)\), MP_ROM_PTR", line)
25+
search = re.search(r"MP_OBJ_NEW_QSTR\(MP_QSTR_(.*?)\),\s*MP_ROM_PTR", line)
2326
if search is None:
2427
continue
2528

0 commit comments

Comments
 (0)