|
13 | 13 |
|
14 | 14 | from multidict import CIMultiDict, CIMultiDictProxy |
15 | 15 |
|
| 16 | +from .abc import AbstractStreamWriter |
16 | 17 | from .compression_utils import ( |
17 | 18 | DEFAULT_MAX_DECOMPRESS_SIZE, |
18 | 19 | ZLibCompressor, |
@@ -584,7 +585,7 @@ async def as_bytes(self, encoding: str = "utf-8", errors: str = "strict") -> byt |
584 | 585 | """ |
585 | 586 | raise TypeError("Unable to read body part as bytes. Use write() to consume.") |
586 | 587 |
|
587 | | - async def write(self, writer: Any) -> None: |
| 588 | + async def write(self, writer: AbstractStreamWriter) -> None: |
588 | 589 | field = self._value |
589 | 590 | chunk = await field.read_chunk(size=2**16) |
590 | 591 | while chunk: |
@@ -1031,7 +1032,7 @@ async def as_bytes(self, encoding: str = "utf-8", errors: str = "strict") -> byt |
1031 | 1032 |
|
1032 | 1033 | return b"".join(parts) |
1033 | 1034 |
|
1034 | | - async def write(self, writer: Any, close_boundary: bool = True) -> None: |
| 1035 | + async def write(self, writer: AbstractStreamWriter, close_boundary: bool = True) -> None: |
1035 | 1036 | """Write body.""" |
1036 | 1037 | for part, encoding, te_encoding in self._parts: |
1037 | 1038 | if self._is_form_data: |
@@ -1085,7 +1086,7 @@ async def close(self) -> None: |
1085 | 1086 |
|
1086 | 1087 |
|
1087 | 1088 | class MultipartPayloadWriter: |
1088 | | - def __init__(self, writer: Any) -> None: |
| 1089 | + def __init__(self, writer: AbstractStreamWriter) -> None: |
1089 | 1090 | self._writer = writer |
1090 | 1091 | self._encoding: str | None = None |
1091 | 1092 | self._compress: ZLibCompressor | None = None |
|
0 commit comments