From 1bc77c3702a483b536b7250cb8b9f339d814aa34 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 26 Sep 2023 08:56:34 -0500 Subject: [PATCH] Fix typings --- jupyter_server/services/events/handlers.py | 2 +- jupyter_server/services/kernels/connection/channels.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jupyter_server/services/events/handlers.py b/jupyter_server/services/events/handlers.py index 275c9fd8b6..9f58692ea3 100644 --- a/jupyter_server/services/events/handlers.py +++ b/jupyter_server/services/events/handlers.py @@ -44,7 +44,7 @@ async def get(self, *args, **kwargs): """Get an event socket.""" self.pre_get() res = super().get(*args, **kwargs) - if res: + if res is not None: await res async def event_listener(self, logger: EventLogger, schema_id: str, data: dict) -> None: diff --git a/jupyter_server/services/kernels/connection/channels.py b/jupyter_server/services/kernels/connection/channels.py index c90964ed82..2b47d69e31 100644 --- a/jupyter_server/services/kernels/connection/channels.py +++ b/jupyter_server/services/kernels/connection/channels.py @@ -85,6 +85,8 @@ class ZMQChannelsWebsocketConnection(BaseKernelWebsocketConnection): ), ) + websocket_handler = Instance(KernelWebsocketHandler) + @property def write_message(self): """Alias to the websocket handler's write_message method."""