Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a7eaa41

Browse files
committed
Use bytes in myreceive.
1 parent 987475c commit a7eaa41

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/howto/sockets.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ length message::
208208
totalsent = totalsent + sent
209209

210210
def myreceive(self):
211-
msg = ''
211+
msg = b''
212212
while len(msg) < MSGLEN:
213213
chunk = self.sock.recv(MSGLEN-len(msg))
214-
if chunk == '':
214+
if chunk == b'':
215215
raise RuntimeError("socket connection broken")
216216
msg = msg + chunk
217217
return msg

0 commit comments

Comments
 (0)