Skip to content

Commit

Permalink
[PR #9294/552dea53 backport][3.10] Backport type fix from #9226 (#9299)
Browse files Browse the repository at this point in the history
**This is a backport of PR #9294 as merged into 3.11
(552dea5).**

Co-authored-by: Sam Bull <git@sambull.org>
  • Loading branch information
patchback[bot] and Dreamsorcerer authored Sep 26, 2024
1 parent e6bcfbe commit d6d2bcc
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit d6d2bcc

Please sign in to comment.