Skip to content

Commit

Permalink
Fixed black errors
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Jul 13, 2023
1 parent 67e5a41 commit df70155
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion starlette/middleware/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
async def call_next(request: Request) -> Response:
app_exc: typing.Optional[Exception] = None
send_stream, recv_stream = anyio.create_memory_object_stream[
typing.MutableMapping[str, typing.Any]]()
typing.MutableMapping[str, typing.Any]
]()

async def receive_or_disconnect() -> Message:
if response_sent.is_set():
Expand Down
5 changes: 2 additions & 3 deletions starlette/middleware/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ def __init__(self, app: typing.Callable, scope: Scope) -> None:
self.status = None
self.response_headers = None
self.stream_send, self.stream_receive = anyio.create_memory_object_stream[
typing.MutableMapping[str, typing.Any]](
math.inf
)
typing.MutableMapping[str, typing.Any]
](math.inf)
self.response_started = False
self.exc_info: typing.Any = None

Expand Down
6 changes: 4 additions & 2 deletions starlette/testclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,11 +739,13 @@ def reset_portal() -> None:

self.stream_send = StapledObjectStream(
*anyio.create_memory_object_stream[
typing.Optional[typing.MutableMapping[str, typing.Any]]](math.inf)
typing.Optional[typing.MutableMapping[str, typing.Any]]
](math.inf)
)
self.stream_receive = StapledObjectStream(
*anyio.create_memory_object_stream[
typing.MutableMapping[str, typing.Any]](math.inf)
typing.MutableMapping[str, typing.Any]
](math.inf)
)
self.task = portal.start_task_soon(self.lifespan)
portal.call(self.wait_startup)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ async def app(scope: Scope, receive: Receive, send: Send) -> None:


def test_websocket_concurrency_pattern(test_client_factory):
stream_send, stream_receive = anyio.create_memory_object_stream[MutableMapping[str, Any]]()
stream_send, stream_receive = anyio.create_memory_object_stream[
MutableMapping[str, Any]
]()

async def reader(websocket):
async with stream_send:
Expand Down

0 comments on commit df70155

Please sign in to comment.