##// END OF EJS Templates
Better support for KeyboardInterrupt during prompt
Jeroen Demeyer -
Show More
@@ -427,8 +427,14 b' class TerminalInteractiveShell(InteractiveShell):'
427 427 try:
428 428 self.interact()
429 429 break
430 except KeyboardInterrupt:
431 print("\nKeyboardInterrupt escaped interact()\n")
430 except KeyboardInterrupt as e:
431 print("\n%s escaped interact()\n" % type(e).__name__)
432 # An interrupt during the eventloop will mess up the
433 # internal state of the prompt_toolkit library.
434 # Stopping the eventloop fixes this, see
435 # https://github.com/ipython/ipython/pull/9867
436 if hasattr(self, '_eventloop'):
437 self._eventloop.stop()
432 438
433 439 _inputhook = None
434 440 def inputhook(self, context):
General Comments 0
You need to be logged in to leave comments. Login now