From 7c8db2d06355333cdc351478ed98db33f72d306b Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Fri, 8 Feb 2019 17:56:22 +0000 Subject: [PATCH] Call tornado WebSocketHandler.get() as a coroutine This change will probably be needed for Tornado 6. Ben Darnell figured it out. https://groups.google.com/d/msg/python-tornado/mSeG7Kc6z4o/baeTDOvJGgAJ --- notebook/base/zmqhandlers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notebook/base/zmqhandlers.py b/notebook/base/zmqhandlers.py index 94f8d13af..19b5bbb29 100644 --- a/notebook/base/zmqhandlers.py +++ b/notebook/base/zmqhandlers.py @@ -281,7 +281,8 @@ class AuthenticatedZMQStreamHandler(ZMQStreamHandler, IPythonHandler): # assign and yield in two step to avoid tornado 3 issues res = self.pre_get() yield gen.maybe_future(res) - super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs) + res = super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs) + yield gen.maybe_future(res) def initialize(self): self.log.debug("Initializing websocket connection %s", self.request.path)