Skip to content

Commit

Permalink
Merge pull request #491 from Tronic/keyboardinterrupt-traceback
Browse files Browse the repository at this point in the history
Produce better traceback when kernel is interrupted
  • Loading branch information
blink1073 authored Mar 17, 2020
2 parents c999fa2 + 5431a02 commit 333bf24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def complete_request(self, stream, ident, parent):
content = parent['content']
code = content['code']
cursor_pos = content['cursor_pos']

matches = yield gen.maybe_future(self.do_complete(code, cursor_pos))
matches = json_clean(matches)
completion_msg = self.session.send(stream, 'complete_reply',
Expand Down Expand Up @@ -890,7 +890,7 @@ def _input_request(self, prompt, ident, parent, password=False):
self.log.warning("Invalid Message:", exc_info=True)
except KeyboardInterrupt:
# re-raise KeyboardInterrupt, to truncate traceback
raise KeyboardInterrupt
raise KeyboardInterrupt("Interrupted by user") from None
else:
break
try:
Expand Down

0 comments on commit 333bf24

Please sign in to comment.