Skip to content

Produce better traceback when kernel is interrupted#491

Merged
blink1073 merged 1 commit into
ipython:masterfrom
Tronic:keyboardinterrupt-traceback
Mar 17, 2020
Merged

Produce better traceback when kernel is interrupted#491
blink1073 merged 1 commit into
ipython:masterfrom
Tronic:keyboardinterrupt-traceback

Conversation

@Tronic

@Tronic Tronic commented Mar 14, 2020

Copy link
Copy Markdown
Contributor

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

ccordoba12 commented Mar 14, 2020

Copy link
Copy Markdown
Member

Could you post screenshots of the before and after behaviors?

@Tronic

Tronic commented Mar 14, 2020

Copy link
Copy Markdown
Contributor Author

Before:

After:

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

@ccordoba12

Copy link
Copy Markdown
Member

Wow! This is a great improvement, thanks!

@Tronic

Tronic commented Mar 15, 2020

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Contributor

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.

3 participants