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

View File

@ -227,8 +227,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')