Skip to content

Commit b87ae4d

Browse files
authored
Make compatible with Tornado 5
Check whether or not the result of `WebSocketHandler.get` is awaitable or not before awaiting.
1 parent 129337a commit b87ae4d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jupyter_server_proxy/websocket.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ def undisallow(*args2, **kwargs2):
8585
async def get(self, *args, **kwargs):
8686
if self.request.headers.get("Upgrade", "").lower() != 'websocket':
8787
return await self.http_get(*args, **kwargs)
88-
await super().get(*args, **kwargs)
88+
else:
89+
result = super().get(*args, **kwargs)
90+
if inspect.isawaitable(result):
91+
await result
8992

9093

9194

0 commit comments

Comments
 (0)