-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Graceful exit on KeyboardInterrupt #10725
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
Conversation
46eb998
to
0d64bd8
Compare
0d64bd8
to
466332c
Compare
466332c
to
8599295
Compare
This seems like a nice usability win, but the traceback can be useful for debugging in case there's an endless loop (which is quite rare, but it might still happen). Is there a way to display the traceback when it's actually useful? Maybe display the traceback when using |
I've added options parsing to the |
7b25f8c
to
6917deb
Compare
6917deb
to
3d6ed8e
Compare
3d6ed8e
to
90efdd7
Compare
90efdd7
to
ed4aab7
Compare
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Catch KeyboardInterrupt to allow graceful exit instead of printing the traceback. Adds options parsing to the KeyboardInterrupt handler. At the moment the traceback will only be printed on --show-traceback but can easily extend it to -v as well. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Description
Catch
KeyboardInterrupt
to allow graceful exit instead of printing the traceback.Test Plan
Run
mypy
and trigger aKeyboardInterrupt
. No traceback should be shown.