File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1414from notebook .utils import url_path_join
1515from notebook .base .handlers import IPythonHandler , utcnow
1616
17+ try :
18+ # Tornado 6.0 deprecated its `maybe_future` function so `notebook` made their own.
19+ # See: https://github.com/jupyter/notebook/pull/4453
20+ from notebook .utils import maybe_future
21+ except ImportError :
22+ # We can't find it in `notebook` then we should be able to find it in Tornado
23+ from tornado .gen import maybe_future
1724
1825
1926class PingableWSClientConnection (websocket .WebSocketClientConnection ):
@@ -85,9 +92,8 @@ def undisallow(*args2, **kwargs2):
8592 async def get (self , * args , ** kwargs ):
8693 if self .request .headers .get ("Upgrade" , "" ).lower () != 'websocket' :
8794 return await self .http_get (* args , ** kwargs )
88- # super get is not async
89- super ().get (* args , ** kwargs )
90-
95+ else :
96+ await maybe_future (super ().get (* args , ** kwargs ))
9197
9298
9399def setup_handlers (web_app ):
You can’t perform that action at this time.
0 commit comments