mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Use bytes in myreceive.
This commit is contained in:
parent
987475c956
commit
a7eaa41f7f
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue