mirror of
https://github.com/python/cpython.git
synced 2024-11-25 19:03:49 +08:00
Fix TypeError is asyncio/proactor_events (#993)
This commit is contained in:
parent
42e3acda86
commit
34792d25ab
@ -227,8 +227,9 @@ class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport,
|
||||
|
||||
def write(self, data):
|
||||
if not isinstance(data, (bytes, bytearray, memoryview)):
|
||||
raise TypeError('data argument must be byte-ish (%r)',
|
||||
type(data))
|
||||
msg = ("data argument must be a bytes-like object, not '%s'" %
|
||||
type(data).__name__)
|
||||
raise TypeError(msg)
|
||||
if self._eof_written:
|
||||
raise RuntimeError('write_eof() already called')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user