mirror of
https://github.com/python/cpython.git
synced 2025-09-30 20:31:52 +00:00
[3.6] Fix TypeError is asyncio/proactor_events (GH-993) (#2061)
(cherry picked from commit 34792d25ab
)
This commit is contained in:
parent
753422f6e3
commit
361362f3a0
1 changed files with 3 additions and 2 deletions
|
@ -232,8 +232,9 @@ class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport,
|
||||||
|
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
if not isinstance(data, (bytes, bytearray, memoryview)):
|
if not isinstance(data, (bytes, bytearray, memoryview)):
|
||||||
raise TypeError('data argument must be byte-ish (%r)',
|
msg = ("data argument must be a bytes-like object, not '%s'" %
|
||||||
type(data))
|
type(data).__name__)
|
||||||
|
raise TypeError(msg)
|
||||||
if self._eof_written:
|
if self._eof_written:
|
||||||
raise RuntimeError('write_eof() already called')
|
raise RuntimeError('write_eof() already called')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue