mirror of
https://github.com/python/cpython.git
synced 2025-11-07 09:02:02 +00:00
[3.14] gh-138703: clarify data buffer requirement of asyncio.StreamWriter.write (GH-139564) (#139570)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
6f2635787b
commit
8566ee2507
2 changed files with 5 additions and 4 deletions
|
|
@ -1050,8 +1050,8 @@ def _read_ready__on_eof(self):
|
|||
|
||||
def write(self, data):
|
||||
if not isinstance(data, (bytes, bytearray, memoryview)):
|
||||
raise TypeError(f'data argument must be a bytes-like object, '
|
||||
f'not {type(data).__name__!r}')
|
||||
raise TypeError(f'data argument must be a bytes, bytearray, or memoryview '
|
||||
f'object, not {type(data).__name__!r}')
|
||||
if self._eof:
|
||||
raise RuntimeError('Cannot call write() after write_eof()')
|
||||
if self._empty_waiter is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue