From 93e3fa5d1ba9370e60becd8e7acdd7fecde7d7e0 Mon Sep 17 00:00:00 2001 From: Nikita Gashkov Date: Sun, 8 Dec 2024 21:29:12 +0100 Subject: [PATCH] fix typing errors --- starlette/middleware/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/starlette/middleware/base.py b/starlette/middleware/base.py index 718387395..7df6161b9 100644 --- a/starlette/middleware/base.py +++ b/starlette/middleware/base.py @@ -3,7 +3,7 @@ import typing import anyio -from anyio.abc import ObjectReceiveStream, ObjectSendStream +from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream from starlette._utils import collapse_excgroups from starlette.requests import ClientDisconnect, Request @@ -105,8 +105,8 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: wrapped_receive = request.wrapped_receive response_sent = anyio.Event() - send_stream: ObjectSendStream[typing.MutableMapping[str, typing.Any]] - recv_stream: ObjectReceiveStream[typing.MutableMapping[str, typing.Any]] + send_stream: MemoryObjectSendStream[Message] + recv_stream: MemoryObjectReceiveStream[Message] send_stream, recv_stream = anyio.create_memory_object_stream() async def call_next(request: Request) -> Response: