[Python-checkins] cpython: Use bytes in myreceive.
martin.v.loewis
python-checkins at python.org
Sun May 29 17:15:56 CEST 2011
http://hg.python.org/cpython/rev/c65e1a422bc3
changeset: 70476:c65e1a422bc3
user: Martin v. Löwis <martin at v.loewis.de>
date: Sun May 29 17:15:44 2011 +0200
summary:
Use bytes in myreceive.
files:
Doc/howto/sockets.rst | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Doc/howto/sockets.rst b/Doc/howto/sockets.rst
--- a/Doc/howto/sockets.rst
+++ b/Doc/howto/sockets.rst
@@ -208,10 +208,10 @@
totalsent = totalsent + sent
def myreceive(self):
- msg = ''
+ msg = b''
while len(msg) < MSGLEN:
chunk = self.sock.recv(MSGLEN-len(msg))
- if chunk == '':
+ if chunk == b'':
raise RuntimeError("socket connection broken")
msg = msg + chunk
return msg
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list