Skip to content

Commit

Permalink
Remove use of deprecated typing.ByteString (#8408)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed May 10, 2024
1 parent 25becd6 commit 17c3971
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aiohttp/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
IO,
TYPE_CHECKING,
Any,
ByteString,
Dict,
Final,
Iterable,
Expand Down Expand Up @@ -217,7 +216,9 @@ async def write(self, writer: AbstractStreamWriter) -> None:


class BytesPayload(Payload):
def __init__(self, value: ByteString, *args: Any, **kwargs: Any) -> None:
def __init__(
self, value: Union[bytes, bytearray, memoryview], *args: Any, **kwargs: Any
) -> None:
if not isinstance(value, (bytes, bytearray, memoryview)):
raise TypeError(f"value argument must be byte-ish, not {type(value)!r}")

Expand Down

0 comments on commit 17c3971

Please sign in to comment.