Skip to content

Commit aab1736

Browse files
Update multipart.py
1 parent 9b4d86f commit aab1736

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

aiohttp/multipart.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from multidict import CIMultiDict, CIMultiDictProxy
1515

16+
from .abc import AbstractStreamWriter
1617
from .compression_utils import (
1718
DEFAULT_MAX_DECOMPRESS_SIZE,
1819
ZLibCompressor,
@@ -584,7 +585,7 @@ async def as_bytes(self, encoding: str = "utf-8", errors: str = "strict") -> byt
584585
"""
585586
raise TypeError("Unable to read body part as bytes. Use write() to consume.")
586587

587-
async def write(self, writer: Any) -> None:
588+
async def write(self, writer: AbstractStreamWriter) -> None:
588589
field = self._value
589590
chunk = await field.read_chunk(size=2**16)
590591
while chunk:
@@ -1031,7 +1032,7 @@ async def as_bytes(self, encoding: str = "utf-8", errors: str = "strict") -> byt
10311032

10321033
return b"".join(parts)
10331034

1034-
async def write(self, writer: Any, close_boundary: bool = True) -> None:
1035+
async def write(self, writer: AbstractStreamWriter, close_boundary: bool = True) -> None:
10351036
"""Write body."""
10361037
for part, encoding, te_encoding in self._parts:
10371038
if self._is_form_data:
@@ -1085,7 +1086,7 @@ async def close(self) -> None:
10851086

10861087

10871088
class MultipartPayloadWriter:
1088-
def __init__(self, writer: Any) -> None:
1089+
def __init__(self, writer: AbstractStreamWriter) -> None:
10891090
self._writer = writer
10901091
self._encoding: str | None = None
10911092
self._compress: ZLibCompressor | None = None

0 commit comments

Comments
 (0)