From 64b4d90eeb370e0a1f55d612aa3816a5e9b09744 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 11 Feb 2015 10:45:26 -0800 Subject: [PATCH] add no-op every 5s on Windows signals don't interrupt the inner loop on Windows, so pump the eventloop every 5s --- IPython/html/notebookapp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IPython/html/notebookapp.py b/IPython/html/notebookapp.py index 5e55e1d68..9df60d121 100644 --- a/IPython/html/notebookapp.py +++ b/IPython/html/notebookapp.py @@ -1061,6 +1061,11 @@ class NotebookApp(BaseIPythonApplication): threading.Thread(target=b).start() self.io_loop = ioloop.IOLoop.current() + if sys.platform.startswith('win'): + # add no-op to wake every 5s + # to handle signals that may be ignored by the inner loop + pc = ioloop.PeriodicCallback(lambda : None, 5000) + pc.start() try: self.io_loop.start() except KeyboardInterrupt: