fmt, stuff

This commit is contained in:
lda
2026-08-30 22:31:12 +07:00 Verified
parent e2958ea91a
commit 0b87620852
7 changed files with 87 additions and 13 deletions
+6 -8
View File
@@ -3,7 +3,7 @@ from collections.abc import AsyncIterator, Awaitable, Callable
from dataclasses import dataclass
from typing import Any
from jupyter_client import AsyncKernelManager
from jupyter_client.manager import AsyncKernelManager
@dataclass
@@ -34,9 +34,9 @@ class JupyterTransport:
self._active_call: str | None = None
self._call_lock = asyncio.Lock()
self._waiting_for_input: str | None = None
self._message_queue: asyncio.Queue[
tuple[str, dict[str, Any] | BaseException]
] | None = None
self._message_queue: (
asyncio.Queue[tuple[str, dict[str, Any] | BaseException]] | None
) = None
self._reader_tasks: set[asyncio.Task[None]] = set()
async def start(self) -> None:
@@ -68,7 +68,7 @@ class JupyterTransport:
async def _read_channel(
self,
channel: str,
get_message: Callable[[], Awaitable[dict[str, Any]]],
get_message: Callable[..., Awaitable[dict[str, Any]]],
) -> None:
"""Read one ZMQ channel continuously into the transport queue."""
if self._message_queue is None:
@@ -143,9 +143,7 @@ class JupyterTransport:
msg_type=message["msg_type"],
parent_id=parent_id,
content=dict(message.get("content", {})),
buffers=[
bytes(buffer) for buffer in message.get("buffers", [])
],
buffers=[bytes(buffer) for buffer in message.get("buffers", [])],
)
if decoded.msg_type == "execute_reply":
# The shell reply and IOPub messages use different