Show More
@@ -450,8 +450,15 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
450 | try: |
|
450 | try: | |
451 | self.interact() |
|
451 | self.interact() | |
452 | break |
|
452 | break | |
453 | except KeyboardInterrupt: |
|
453 | except KeyboardInterrupt as e: | |
454 |
print("\n |
|
454 | print("\n%s escaped interact()\n" % type(e).__name__) | |
|
455 | finally: | |||
|
456 | # An interrupt during the eventloop will mess up the | |||
|
457 | # internal state of the prompt_toolkit library. | |||
|
458 | # Stopping the eventloop fixes this, see | |||
|
459 | # https://github.com/ipython/ipython/pull/9867 | |||
|
460 | if hasattr(self, '_eventloop'): | |||
|
461 | self._eventloop.stop() | |||
455 |
|
462 | |||
456 | _inputhook = None |
|
463 | _inputhook = None | |
457 | def inputhook(self, context): |
|
464 | def inputhook(self, context): |
General Comments 0
You need to be logged in to leave comments.
Login now