Skip to content

Commit

Permalink
Fix mypy issues
Browse files Browse the repository at this point in the history
With the latest versions of mypy and Blinker.
  • Loading branch information
pgjones committed May 19, 2024
1 parent 35f6d6f commit 4e68dd7
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/quart_trio/app.py
Original file line number Diff line number Diff line change
@@ -165,7 +165,7 @@ async def full_dispatch_request(
omits this argument.
"""
try:
await request_started.send_async(self, _sync_wrapper=self.ensure_async)
await request_started.send_async(self, _sync_wrapper=self.ensure_async) # type: ignore

result: ResponseReturnValue | HTTPException | None
result = await self.preprocess_request(request_context)
@@ -219,7 +219,9 @@ async def full_dispatch_websocket(
the Flask convention.
"""
try:
await websocket_started.send_async(self, _sync_wrapper=self.ensure_async)
await websocket_started.send_async(
self, _sync_wrapper=self.ensure_async # type: ignore
)

result: ResponseReturnValue | HTTPException | None
result = await self.preprocess_websocket(websocket_context)
@@ -291,7 +293,7 @@ async def shutdown(self) -> None:
raise RuntimeError("While serving generator didn't terminate")
except Exception as error:
await got_serving_exception.send_async(
self, _sync_wrapper=self.ensure_async, exception=error
self, _sync_wrapper=self.ensure_async, exception=error # type: ignore
)
self.log_exception(sys.exc_info())
raise
6 changes: 4 additions & 2 deletions src/quart_trio/asgi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from functools import partial
import sys
from functools import partial
from typing import cast, Optional, TYPE_CHECKING, Union
from urllib.parse import urlparse

@@ -77,7 +77,9 @@ async def handle_messages( # type: ignore
event = await receive()
if event["type"] == "websocket.receive":
message = event.get("bytes") or event["text"]
await websocket_received.send_async(message, _sync_wrapper=self.app.ensure_async)
await websocket_received.send_async(
message, _sync_wrapper=self.app.ensure_async # type: ignore
)
await self.send_channel.send(message)
elif event["type"] == "websocket.disconnect":
break

0 comments on commit 4e68dd7

Please # to comment.