From 8b1b1b6de3f69cb88c52a4845edff84ef45e87b3 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Tue, 4 Apr 2017 23:39:51 +0300 Subject: [PATCH] Fix TypeError is asyncio/proactor_events --- Lib/asyncio/proactor_events.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index ff12877fae2f23..a81645d9c5d859 100644 --- a/Lib/asyncio/proactor_events.py +++ b/Lib/asyncio/proactor_events.py @@ -232,8 +232,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')