8000 [3.6] Fix TypeError is asyncio/proactor_events (GH-993) (#2061) · python/cpython@361362f · GitHub
[go: up one dir, main page]

Skip to content

Commit 361362f

Browse files
authored
[3.6] Fix TypeError is asyncio/proactor_events (GH-993) (#2061)
(cherry picked from commit 34792d2)
1 parent 753422f commit 361362f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/asyncio/proactor_events.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,9 @@ class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport,
232232

233233
def write(self, data):
234234
if not isinstance(data, (bytes, bytearray, memoryview)):
235-
raise TypeError('data argument must be byte-ish (%r)',
236-
type(data))
235+
msg = ("data argument must be a bytes-like object, not '%s'" %
236+
type(data).__name__)
237+
raise TypeError(msg)
237238
if self._eof_written:
238239
raise RuntimeError('write_eof() already called')
239240

0 commit comments

Comments
 (0)
0