From c7defbc8626c0ddaedc0a188c025cc7a59dbbff0 2014-11-01 18:39:40 From: Matthias Bussonnier Date: 2014-11-01 18:39:40 Subject: [PATCH] Get pre_get to work and make session logs when adapter changes --- diff --git a/IPython/html/base/zmqhandlers.py b/IPython/html/base/zmqhandlers.py index da253cc..e828366 100644 --- a/IPython/html/base/zmqhandlers.py +++ b/IPython/html/base/zmqhandlers.py @@ -220,7 +220,9 @@ class AuthenticatedZMQStreamHandler(ZMQStreamHandler, IPythonHandler): @gen.coroutine def get(self, *args, **kwargs): # pre_get can be a coroutine in subclasses - yield gen.maybe_future(self.pre_get()) + # assign and yield in two step to avoid tornado 3 issues + res = self.pre_get() + yield gen.maybe_future(res) # FIXME: only do super get on tornado ≥ 4 # tornado 3 has no get, will raise 405 if tornado.version_info >= (4,):