-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] SystemExit and KeyboardInterrupt appear swapped on REPL #347
Comments
When running scripts everything appears to be working as expected. |
AFAIK, not exiting the REPL on plain |
This makes the run_user_program() function more like the MicroPython parse_compile_execute() function. pyexec_friendly_repl() already takes care of CTRL+C handling, so we only need it on our custom runner. Issue: pybricks/support#347
This is fixed now. |
OK - I suppose it doesn't exit in MicroPython because usually there is nothing to exit to. I guess I was extrapolating from how it works in scripts. It seems nice to make it the same. This isn't critical to me though. |
The change would need to be made in upstream MicroPython. |
Then let's keep it simple and not change it :) The CTRL+C was the main bug here, and it looks like you fixed it already. The system exit is just something that seemed odd when I dug deeper, but it's not really an issue. |
Describe the bug
raise SystemExit
does not exit the REPL (but it should).To reproduce
Connect to the hub and start the REPL with the
>>>
button in Pybricks Code.Click on the terminal pane and press CTRL+C. The run animation on the hub stops. If you run a few other commands first or wait a while, then CTRL+C does keep you in the REPL as expected.
For the second issue, start REPL, paste and execute
raise SystemExit
, and observe that it keeps running.Tested on PrimeHub.
Expected behavior
Screenshots
CTRL+C on the first line triggers an exit:
If you don't do it right away, it does not:
The text was updated successfully, but these errors were encountered: