summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-05-29 15:15:44 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2011-05-29 15:15:44 (GMT)
commita7eaa41f7f54609847b3e0f22dff8400f874e796 (patch)
treeb80aa7e386986b37e27e2d301511110d66a87595 /Doc
parent987475c9568c12d411e74e301ccfd12f7be4f06a (diff)
downloadcpython-a7eaa41f7f54609847b3e0f22dff8400f874e796.zip
cpython-a7eaa41f7f54609847b3e0f22dff8400f874e796.tar.gz
cpython-a7eaa41f7f54609847b3e0f22dff8400f874e796.tar.bz2
Use bytes in myreceive.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/howto/sockets.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/howto/sockets.rst b/Doc/howto/sockets.rst
index 80e98f7..2416807 100644
--- a/Doc/howto/sockets.rst
+++ b/Doc/howto/sockets.rst
@@ -208,10 +208,10 @@ length message::
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