Skip to content

[PR #9294/552dea53 backport][3.10] Backport type fix from #9226 #9299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aiohttp/web_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,14 @@ async def pong(self, message: bytes = b"") -> None:
raise RuntimeError("Call .prepare() first")
await self._writer.pong(message)

async def send_str(self, data: str, compress: Optional[bool] = None) -> None:
async def send_str(self, data: str, compress: Optional[int] = None) -> None:
if self._writer is None:
raise RuntimeError("Call .prepare() first")
if not isinstance(data, str):
raise TypeError("data argument must be str (%r)" % type(data))
await self._writer.send(data, binary=False, compress=compress)

async def send_bytes(self, data: bytes, compress: Optional[bool] = None) -> None:
async def send_bytes(self, data: bytes, compress: Optional[int] = None) -> None:
if self._writer is None:
raise RuntimeError("Call .prepare() first")
if not isinstance(data, (bytes, bytearray, memoryview)):
Expand All @@ -396,7 +396,7 @@ async def send_bytes(self, data: bytes, compress: Optional[bool] = None) -> None
async def send_json(
self,
data: Any,
compress: Optional[bool] = None,
compress: Optional[int] = None,
*,
dumps: JSONEncoder = json.dumps,
) -> None:
Expand Down
Loading