Skip to content
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

Produce better traceback when kernel is interrupted #491

Merged
merged 1 commit into from Mar 17, 2020

Conversation

Tronic
Copy link
Contributor

@Tronic Tronic commented Mar 14, 2020

The original code no longer worked as intended because modern Python versions require from None to suppress the previous context, and as a result a long traceback of ipykernel internals was being printed when pressing the Stop button.

This PR fixes the suppression and adds a debug message to make it easier to it easier to understand what happened.

@ccordoba12
Copy link
Member

ccordoba12 commented Mar 14, 2020

Could you post screenshots of the before and after behaviors?

@Tronic
Copy link
Contributor Author

Tronic commented Mar 14, 2020

Before:

After:

For comparison, an extension that I'm working on:

@ccordoba12
Copy link
Member

Wow! This is a great improvement, thanks!

@Tronic
Copy link
Contributor Author

Tronic commented Mar 15, 2020

Cool. I see that this affects Spyder as well. IPython in bare terminal doesn't run that code but produces a neat traceback (no internals, just user code) by default.

@ccordoba12
Copy link
Member

Yeah, it'll be a very neat improvement in both the notebook and Spyder.

@blink1073 blink1073 closed this Mar 17, 2020
@blink1073 blink1073 reopened this Mar 17, 2020
@blink1073 blink1073 added this to the 5.2 milestone Mar 17, 2020
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@blink1073 blink1073 merged commit 333bf24 into ipython:master Mar 17, 2020
@Tronic Tronic deleted the keyboardinterrupt-traceback branch March 17, 2020 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants