[Python-checkins] cpython (3.5): Fix error message in asyncio.selector_events.

victor.stinner python-checkins at python.org
Mon Feb 1 06:48:05 EST 2016


https://hg.python.org/cpython/rev/97c80e317ab8
changeset:   100139:97c80e317ab8
branch:      3.5
parent:      100137:fe6be84981e2
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Feb 01 12:46:38 2016 +0100
summary:
  Fix error message in asyncio.selector_events.

Patch written by Carlo Beccarini <hackdiablo.cb at gmail.com>.

files:
  Lib/asyncio/selector_events.py |  12 ++++++------
  1 files changed, 6 insertions(+), 6 deletions(-)


diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -682,8 +682,8 @@
 
     def write(self, data):
         if not isinstance(data, (bytes, bytearray, memoryview)):
-            raise TypeError('data argument must be byte-ish (%r)',
-                            type(data))
+            raise TypeError('data argument must be a bytes-like object, '
+                            'not %r' % type(data).__name__)
         if self._eof:
             raise RuntimeError('Cannot call write() after write_eof()')
         if not data:
@@ -954,8 +954,8 @@
 
     def write(self, data):
         if not isinstance(data, (bytes, bytearray, memoryview)):
-            raise TypeError('data argument must be byte-ish (%r)',
-                            type(data))
+            raise TypeError('data argument must be a bytes-like object, '
+                            'not %r' % type(data).__name__)
         if not data:
             return
 
@@ -1010,8 +1010,8 @@
 
     def sendto(self, data, addr=None):
         if not isinstance(data, (bytes, bytearray, memoryview)):
-            raise TypeError('data argument must be byte-ish (%r)',
-                            type(data))
+            raise TypeError('data argument must be a bytes-like object, '
+                            'not %r' % type(data).__name__)
         if not data:
             return
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list