Skip to content

Commit

Permalink
type: ignore type at assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
brussee committed Jan 10, 2023
1 parent aacd0bd commit 3b17666
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions uvicorn/protocols/http/h11_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def handle_events(self) -> None:
"http_version": event.http_version.decode("ascii"),
"server": self.server,
"client": self.client,
"scheme": self.scheme,
"scheme": self.scheme, # type: ignore[typeddict-item]
"method": event.method.decode("ascii"),
"root_path": self.root_path,
"path": unquote(raw_path.decode("ascii")),
Expand All @@ -243,7 +243,7 @@ def handle_events(self) -> None:
"extensions": {},
}
if self.scheme == "https":
self.scope["extensions"]["tls"] = self.tls
self.scope["extensions"]["tls"] = self.tls # type: ignore

upgrade = self._get_upgrade()
if upgrade == b"websocket" and self._should_upgrade_to_ws():
Expand Down
2 changes: 1 addition & 1 deletion uvicorn/protocols/http/httptools_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def on_message_begin(self) -> None:
"extensions": {},
}
if self.scheme == "https":
self.scope["extensions"]["tls"] = self.tls
self.scope["extensions"]["tls"] = self.tls # type: ignore

# Parser callbacks
def on_url(self, url: bytes) -> None:
Expand Down
3 changes: 2 additions & 1 deletion uvicorn/protocols/websockets/websockets_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ async def process_request(
"extensions": {},
}
if self.scheme == "wss":
self.scope["extensions"]["tls"] = self.tls
self.scope["extensions"]["tls"] = self.tls # type: ignore

task = self.loop.create_task(self.run_asgi())
task.add_done_callback(self.on_task_complete)
self.tasks.add(task)
Expand Down
3 changes: 2 additions & 1 deletion uvicorn/protocols/websockets/wsproto_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ def handle_connect(self, event: events.Request) -> None:
"extensions": {},
}
if self.scheme == "wss":
self.scope["extensions"]["tls"] = self.tls
self.scope["extensions"]["tls"] = self.tls # type: ignore

self.queue.put_nowait({"type": "websocket.connect"})
task = self.loop.create_task(self.run_asgi())
task.add_done_callback(self.on_task_complete)
Expand Down

0 comments on commit 3b17666

Please sign in to comment.