diff options
author | Guido van Rossum <guido@python.org> | 2007-07-18 20:57:44 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-18 20:57:44 (GMT) |
commit | df4a743ac0d87c3a1b63e43e9aa977dc5b337fb5 (patch) | |
tree | 92663d3d9b1c6fd386388a892ccf6a964a126252 /Lib/asyncore.py | |
parent | b5a755e46c66c7e7d709431399f1781ea9e582df (diff) | |
download | cpython-df4a743ac0d87c3a1b63e43e9aa977dc5b337fb5.zip cpython-df4a743ac0d87c3a1b63e43e9aa977dc5b337fb5.tar.gz cpython-df4a743ac0d87c3a1b63e43e9aa977dc5b337fb5.tar.bz2 |
Fix test_asyncore after merge. It needs to use bytes.
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r-- | Lib/asyncore.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py index fc110c9..32f5790 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -344,14 +344,14 @@ class dispatcher: # a closed connection is indicated by signaling # a read condition, and having recv() return 0. self.handle_close() - return '' + return b'' else: return data except socket.error as why: # winsock sometimes throws ENOTCONN if why[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN]: self.handle_close() - return '' + return b'' else: raise @@ -447,7 +447,7 @@ class dispatcher_with_send(dispatcher): def __init__(self, sock=None, map=None): dispatcher.__init__(self, sock, map) - self.out_buffer = '' + self.out_buffer = b'' def initiate_send(self): num_sent = 0 @@ -461,6 +461,7 @@ class dispatcher_with_send(dispatcher): return (not self.connected) or len(self.out_buffer) def send(self, data): + assert isinstance(data, bytes) if self.debug: self.log_info('sending %s' % repr(data)) self.out_buffer = self.out_buffer + data |