From fd8a728e6adb819bb9aa2b163f055195e2922652 2016-05-17 21:20:59 From: Matthias Bussonnier Date: 2016-05-17 21:20:59 Subject: [PATCH] Eventloops are not created if IPY_TEST_SIMPLE_PROMPT set, or not a tty. --- diff --git a/IPython/terminal/ptshell.py b/IPython/terminal/ptshell.py index 7751a05..f0d4dcc 100644 --- a/IPython/terminal/ptshell.py +++ b/IPython/terminal/ptshell.py @@ -382,8 +382,9 @@ class TerminalInteractiveShell(InteractiveShell): break except KeyboardInterrupt: print("\nKeyboardInterrupt escaped interact()\n") - - self._eventloop.close() + + if hasattr(self, '_eventloop'): + self._eventloop.close() _inputhook = None def inputhook(self, context):