Skip to content

Commit

Permalink
Add missing string annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Jun 21, 2022
1 parent 18e9915 commit 70327d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion uvicorn/middleware/proxy_headers.py
Expand Up @@ -50,7 +50,7 @@ async def __call__(
self, scope: "Scope", receive: "ASGIReceiveCallable", send: "ASGISendCallable"
) -> None:
if scope["type"] in ("http", "websocket"):
scope = cast(Union[HTTPScope, WebSocketScope], scope)
scope = cast(Union["HTTPScope", "WebSocketScope"], scope)
client_addr: Optional[Tuple[str, int]] = scope.get("client")
client_host = client_addr[0] if client_addr else None

Expand Down
5 changes: 4 additions & 1 deletion uvicorn/middleware/wsgi.py
Expand Up @@ -79,7 +79,10 @@ def __init__(self, app: WSGIApp, workers: int = 10):
self.executor = concurrent.futures.ThreadPoolExecutor(max_workers=workers)

async def __call__(
self, scope: HTTPScope, receive: ASGIReceiveCallable, send: ASGISendCallable
self,
scope: "HTTPScope",
receive: "ASGIReceiveCallable",
send: "ASGISendCallable",
) -> None:
assert scope["type"] == "http"
instance = WSGIResponder(self.app, self.executor, scope)
Expand Down

0 comments on commit 70327d3

Please sign in to comment.