diff --git a/IPython/frontend/html/notebook/notebookapp.py b/IPython/frontend/html/notebook/notebookapp.py index 2387fc8..9c34df4 100644 --- a/IPython/frontend/html/notebook/notebookapp.py +++ b/IPython/frontend/html/notebook/notebookapp.py @@ -35,13 +35,7 @@ import zmq # Install the pyzmq ioloop. This has to be done before anything else from # tornado is imported. from zmq.eventloop import ioloop -# FIXME: ioloop.install is new in pyzmq-2.1.7, so remove this conditional -# when pyzmq dependency is updated beyond that. -if hasattr(ioloop, 'install'): - ioloop.install() -else: - import tornado.ioloop - tornado.ioloop.IOLoop = ioloop.IOLoop +ioloop.install() from tornado import httpserver from tornado import web diff --git a/IPython/zmq/__init__.py b/IPython/zmq/__init__.py index 3085b51..7f558fd 100644 --- a/IPython/zmq/__init__.py +++ b/IPython/zmq/__init__.py @@ -20,6 +20,17 @@ def patch_pyzmq(): """ import zmq + + # ioloop.install, introduced in pyzmq 2.1.7 + from zmq.eventloop import ioloop + + def install(): + import tornado.ioloop + tornado.ioloop.IOLoop = ioloop.IOLoop + + if not hasattr(ioloop, 'install'): + ioloop.install = install + # fix missing DEALER/ROUTER aliases in pyzmq < 2.1.9 if not hasattr(zmq, 'DEALER'): zmq.DEALER = zmq.XREQ