eric6/DebugClients/Python/AsyncFile.py

changeset 8230
8b5c6896655b
parent 8217
385f60c94548
child 8243
cc717c2ae956
equal deleted inserted replaced
8229:6fa22aa4fc4a 8230:8b5c6896655b
225 # delivered as two separate events. Therefore we make sure we only 225 # delivered as two separate events. Therefore we make sure we only
226 # read a line at a time. 226 # read a line at a time.
227 line = self.sock.recv(size, socket.MSG_PEEK) 227 line = self.sock.recv(size, socket.MSG_PEEK)
228 228
229 eol = line.find(b'\n') 229 eol = line.find(b'\n')
230 230 size = eol + 1 if eol >= 0 else len(line)
231 if eol >= 0:
232 size = eol + 1
233 else:
234 size = len(line)
235 231
236 # Now we know how big the line is, read it for real. 232 # Now we know how big the line is, read it for real.
237 return self.sock.recv(size).decode('utf8', 'backslashreplace') 233 return self.sock.recv(size).decode('utf8', 'backslashreplace')
238 234
239 def readlines(self, sizehint=-1): 235 def readlines(self, sizehint=-1):

eric ide

mercurial