Merge pull request #6831 from Carreau/fix-yield

Fix for Websocket.pre_get on tornado 3
This commit is contained in:
Min RK 2014-11-01 12:55:51 -07:00
commit d26b4291f5

View File

@ -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,):