From a7eaa41f7f54609847b3e0f22dff8400f874e796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sun, 29 May 2011 17:15:44 +0200 Subject: Use bytes in myreceive. --- Doc/howto/sockets.rst | 4 ++-- 1 file 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 -- cgit v0.12