Skip to content

Commit d1c1309

Browse files
committed
cli/__init__.py: catch a syntax error when re-compiling the target file
1 parent d0b34ad commit d1c1309

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pybricksdev/cli/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ async def reconnect_hub():
359359
case _:
360360
return
361361

362+
except SyntaxError as e:
363+
print("\nA syntax error occurred when parsing your program:")
364+
print(e, "\n")
365+
362366
except HubPowerButtonPressedError:
363367
# This means the user pressed the button on the hub to re-start the
364368
# current program, so the menu was canceled and we are now printing

0 commit comments

Comments
 (0)