Skip to content

Commit 6bdb4ae

Browse files
committed
Fix stub circuitpython_setboard OS path separator issue
1 parent 7ba62bb commit 6bdb4ae

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

tools/board_stubs/circuitpython_setboard/__init__.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@
99
def set_board():
1010
chosen_board = sys.argv[1]
1111
print(f"setting board: {chosen_board}")
12-
board_defs_path = (
13-
os.path.sep.join(__file__.split("/")[:-2]) + f"{os.path.sep}board_definitions{os.path.sep}"
14-
)
15-
board_stubs_path = (
16-
os.path.sep.join(__file__.split("/")[:-2])
17-
+ f"{os.path.sep}board-stubs{os.path.sep}__init__.pyi"
18-
)
12+
site_packages_path = os.path.sep.join(__file__.split(os.path.sep)[:-2])
13+
board_defs_path = f"{site_packages_path}{os.path.sep}board_definitions{os.path.sep}"
14+
board_stubs_path = f"{site_packages_path}{os.path.sep}board-stubs{os.path.sep}__init__.pyi"
1915

2016
if chosen_board not in os.listdir(board_defs_path):
2117
print(f"Board: '{chosen_board}' was not found")

0 commit comments

Comments
 (0)