From: Yury Selivanov Date: Sat, 10 Jun 2017 04:15:28 +0000 (-0400) Subject: [3.6] Fix TypeError is asyncio/proactor_events (GH-993) (#2061) X-Git-Tag: v3.6.2rc1~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=361362f3a0d6ebb458a8d826a698463085c5a8f7;p=python [3.6] Fix TypeError is asyncio/proactor_events (GH-993) (#2061) (cherry picked from commit 34792d25ab7329241ea24595286d65d54c266274) --- diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index ff12877fae..a81645d9c5 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')