diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-05-29 15:15:44 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-05-29 15:15:44 (GMT) |
commit | a7eaa41f7f54609847b3e0f22dff8400f874e796 (patch) | |
tree | b80aa7e386986b37e27e2d301511110d66a87595 /Doc | |
parent | 987475c9568c12d411e74e301ccfd12f7be4f06a (diff) | |
download | cpython-a7eaa41f7f54609847b3e0f22dff8400f874e796.zip cpython-a7eaa41f7f54609847b3e0f22dff8400f874e796.tar.gz cpython-a7eaa41f7f54609847b3e0f22dff8400f874e796.tar.bz2 |
Use bytes in myreceive.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/howto/sockets.rst | 4 |
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 |