Browse files

avoid spurious printing of KeyboardInterrupts during poll in ipkernel

  • Loading branch information...
1 parent 1b523f9 commit a144eb387f1fc9e937ad8ddbc08da6e8dcf1102c @minrk committed Jun 9, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 IPython/zmq/ipkernel.py
View
11 IPython/zmq/ipkernel.py
@@ -158,7 +158,16 @@ def start(self):
poller = zmq.Poller()
poller.register(self.shell_socket, zmq.POLLIN)
while True:
- if poller.poll(1000*self._poll_interval):
+ try:
+ # scale by extra factor of 10, because there is no
+ # reason for this to be anything less than ~ 0.1s
+ # since it is a real poller and will respond
+ # to events immediately
+ poller.poll(10*1000*self._poll_interval)
+ except:
+ # This avoids inappropriate printing of interrupts
+ raise
+ else:
self.do_one_iteration()
def record_ports(self, ports):

0 comments on commit a144eb3

Please sign in to comment.