diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-02-01 11:46:38 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-02-01 11:46:38 (GMT) |
commit | 3e7230904e475982d0aea2c0181ea9e04e0ac6b3 (patch) | |
tree | 1145d6d1f1f61cc3a73e1071feb6cbe3fc37835f /Lib/asyncio | |
parent | 0df5313458ed253e4a299b50c3b86156649c5a0f (diff) | |
download | cpython-3e7230904e475982d0aea2c0181ea9e04e0ac6b3.zip cpython-3e7230904e475982d0aea2c0181ea9e04e0ac6b3.tar.gz cpython-3e7230904e475982d0aea2c0181ea9e04e0ac6b3.tar.bz2 |
Fix error message in asyncio.selector_events.
Patch written by Carlo Beccarini <hackdiablo.cb@gmail.com>.
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | 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 index 5b26631..812fac1 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -682,8 +682,8 @@ class _SelectorSocketTransport(_SelectorTransport): 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 @@ class _SelectorSslTransport(_SelectorTransport): 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 @@ class _SelectorDatagramTransport(_SelectorTransport): 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 |