From: Martin v. Löwis Date: Sun, 29 May 2011 15:15:44 +0000 (+0200) Subject: Use bytes in myreceive. X-Git-Tag: v3.3.0a1~2183^2~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7eaa41f7f54609847b3e0f22dff8400f874e796;p=python Use bytes in myreceive. --- diff --git a/Doc/howto/sockets.rst b/Doc/howto/sockets.rst index 80e98f7b7e..241680798b 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