diff options
author | Yury Selivanov <yury@magic.io> | 2017-06-10 04:15:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-10 04:15:41 (GMT) |
commit | 1f73023b908b1d13ca31d162ba613e0186218be5 (patch) | |
tree | e6a6f29ca526587756a8c62ea9bea7af0f9ebd11 | |
parent | 91581d4225e91e581f44d60d0b87c80778c36d1d (diff) | |
download | cpython-1f73023b908b1d13ca31d162ba613e0186218be5.zip cpython-1f73023b908b1d13ca31d162ba613e0186218be5.tar.gz cpython-1f73023b908b1d13ca31d162ba613e0186218be5.tar.bz2 |
[3.5] Fix TypeError is asyncio/proactor_events (GH-993) (#2060)
(cherry picked from commit 34792d25ab7329241ea24595286d65d54c266274)
-rw-r--r-- | Lib/asyncio/proactor_events.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index fef3205..13a885c 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') |