Skip to content

Commit

Permalink
Update typing
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Oct 3, 2024
1 parent 2ee1220 commit da98085
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions voila/tornado/execution_request_handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
import json
from typing import Awaitable
from typing import Awaitable, Optional
from jupyter_server.base.handlers import JupyterHandler
from tornado.websocket import WebSocketHandler
from tornado.web import HTTPError
Expand Down Expand Up @@ -36,7 +36,9 @@ async def open(self, kernel_id: str) -> None:
self._kernel_id = kernel_id
self.write_message({"action": "initialized", "payload": {}})

async def on_message(self, message_str: str | bytes) -> Awaitable[None] | None:
async def on_message(
self, message_str: str | bytes
) -> Optional[Awaitable[None] | None]:
message = json.loads(message_str)
action = message.get("action", None)
payload = message.get("payload", {})
Expand Down

0 comments on commit da98085

Please sign in to comment.