8000 Fix TypeError is asyncio/proactor_events (#993) · python/cpython@34792d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 34792d2

Browse files
DimitrisJim1st1
authored andcommitted
Fix TypeError is asyncio/proactor_events (#993)
1 parent 42e3acd commit 34792d2

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
@@ -227,8 +227,9 @@ class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport,
227227

228228
def write(self, data):
229229
if not isinstance(data, (bytes, bytearray, memoryview)):
230-
raise TypeError('data argument must be byte-ish (%r)',
231-
type(data))
230+
msg = ("data argument must be a bytes-like object, not '%s'" %
231+
type(data).__name__)
232+
raise TypeError(msg)
232233
if self._eof_written:
233234
raise RuntimeError('write_eof() already called')
234235

0 commit comments

Comments
 (0)
0