Fix TypeError is asyncio/proactor_events (#993)

This commit is contained in:
Jim Fasarakis-Hilliard 2017-06-10 05:56:34 +03:00 committed by Yury Selivanov
parent 42e3acda86
commit 34792d25ab
1 changed files with 3 additions and 2 deletions

View File

@ -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')