changeset 29740:1a29db79a98d

sshserver: use `iter(callable, sentinel)` instead of while True This is functionally equivalent, but is a little more concise.
author Augie Fackler <augie@google.com>
date Fri, 05 Aug 2016 14:00:30 -0400
parents 0dbd788a2dfd
children 44ea12756fef
files mercurial/sshserver.py
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/sshserver.py	Fri Aug 05 14:00:22 2016 -0400
+++ b/mercurial/sshserver.py	Fri Aug 05 14:00:30 2016 -0400
@@ -69,11 +69,7 @@
         pass
 
     def groupchunks(self, changegroup):
-        while True:
-            d = changegroup.read(4096)
-            if not d:
-                break
-            yield d
+        return iter(lambda: changegroup.read(4096), '')
 
     def sendresponse(self, v):
         self.fout.write("%d\n" % len(v))