Skip to content

Commit 5f95f27

Browse files
committed
Accept bytearray where we can do so at no cost.
This is a follow-up to c2bc41b.
1 parent 00be6a2 commit 5f95f27

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/websockets/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def close_exc(self) -> ConnectionClosed:
254254

255255
# Public methods for receiving data.
256256

257-
def receive_data(self, data: bytes) -> None:
257+
def receive_data(self, data: bytes | bytearray) -> None:
258258
"""
259259
Receive data from the network.
260260

src/websockets/streams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def at_eof(self) -> Generator[None, None, bool]:
112112
# tell if until either feed_data() or feed_eof() is called.
113113
yield
114114

115-
def feed_data(self, data: bytes) -> None:
115+
def feed_data(self, data: bytes | bytearray) -> None:
116116
"""
117117
Write data to the stream.
118118

0 commit comments

Comments
 (0)