##// END OF EJS Templates
sshpeer: use `iter(callable, sentinel)` instead of while True...
Augie Fackler -
r29727:0dbd788a default
parent child Browse files
Show More
@@ -292,10 +292,7 b' class sshpeer(wireproto.wirepeer):'
292 292 r = self._call(cmd, **args)
293 293 if r:
294 294 return '', r
295 while True:
296 d = fp.read(4096)
297 if not d:
298 break
295 for d in iter(lambda: fp.read(4096), ''):
299 296 self._send(d)
300 297 self._send("", flush=True)
301 298 r = self._recv()
@@ -308,10 +305,7 b' class sshpeer(wireproto.wirepeer):'
308 305 if r:
309 306 # XXX needs to be made better
310 307 raise error.Abort(_('unexpected remote reply: %s') % r)
311 while True:
312 d = fp.read(4096)
313 if not d:
314 break
308 for d in iter(lambda: fp.read(4096), ''):
315 309 self._send(d)
316 310 self._send("", flush=True)
317 311 return self.pipei
@@ -353,10 +347,7 b' class sshpeer(wireproto.wirepeer):'
353 347 d = self._call("addchangegroup")
354 348 if d:
355 349 self._abort(error.RepoError(_("push refused: %s") % d))
356 while True:
357 d = cg.read(4096)
358 if not d:
359 break
350 for d in iter(lambda: cg.read(4096), ''):
360 351 self.pipeo.write(d)
361 352 self.readerr()
362 353
General Comments 0
You need to be logged in to leave comments. Login now