From 361362f3a0d6ebb458a8d826a698463085c5a8f7 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Sat, 10 Jun 2017 00:15:28 -0400 Subject: [PATCH] [3.6] Fix TypeError is asyncio/proactor_events (GH-993) (#2061) (cherry picked from commit 34792d25ab7329241ea24595286d65d54c266274) --- 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 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') -- 2.40.0