Use bytes in myreceive.

This commit is contained in:
Martin v. Löwis 2011-05-29 17:15:44 +02:00
parent 987475c956
commit a7eaa41f7f

View file

@ -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