##// END OF EJS Templates
Catch interrupted poll() in terminal console...
Thomas Kluyver -
Show More
@@ -8,6 +8,7 b' from __future__ import print_function'
8
8
9 import base64
9 import base64
10 import bdb
10 import bdb
11 import errno
11 import signal
12 import signal
12 import os
13 import os
13 import sys
14 import sys
@@ -21,6 +22,8 b' try:'
21 except ImportError:
22 except ImportError:
22 from Queue import Empty # Py 2
23 from Queue import Empty # Py 2
23
24
25 from zmq import ZMQError
26
24 from IPython.core import page
27 from IPython.core import page
25 from IPython.core import release
28 from IPython.core import release
26 from IPython.terminal.console.zmqhistory import ZMQHistoryManager
29 from IPython.terminal.console.zmqhistory import ZMQHistoryManager
@@ -169,6 +172,10 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):'
169 except Empty:
172 except Empty:
170 # display intermediate print statements, etc.
173 # display intermediate print statements, etc.
171 self.handle_iopub(msg_id)
174 self.handle_iopub(msg_id)
175 except ZMQError as e:
176 # Carry on if polling was interrupted by a signal
177 if e.errno != errno.EINTR:
178 raise
172
179
173 # after all of that is done, wait for the execute reply
180 # after all of that is done, wait for the execute reply
174 while self.client.is_alive():
181 while self.client.is_alive():
General Comments 0
You need to be logged in to leave comments. Login now