From: Yury Selivanov Date: Sat, 10 Jun 2017 04:15:41 +0000 (-0400) Subject: [3.5] Fix TypeError is asyncio/proactor_events (GH-993) (#2060) X-Git-Tag: v3.5.4rc1~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f73023b908b1d13ca31d162ba613e0186218be5;p=python [3.5] Fix TypeError is asyncio/proactor_events (GH-993) (#2060) (cherry picked from commit 34792d25ab7329241ea24595286d65d54c266274) --- diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index fef3205877..13a885cd55 100644 --- a/Lib/asyncio/proactor_events.py +++ b/Lib/asyncio/proactor_events.py @@ -231,8 +231,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')