manifest.walk: use return instead of StopIteration in generator
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 07 Apr 2015 22:36:17 -0700
changeset 24682 aef3d1469773
parent 24681 33ab99a6ad9b
child 24683 4eaea0ed8dc1
manifest.walk: use return instead of StopIteration in generator Using "return" within a generator is supposedly more Pythonic than raising StopIteration.
mercurial/manifest.py
--- a/mercurial/manifest.py	Wed Apr 08 23:30:02 2015 +0900
+++ b/mercurial/manifest.py	Tue Apr 07 22:36:17 2015 -0700
@@ -228,7 +228,7 @@
         if fset and not match.anypats() and util.all(fn in self for fn in fset):
             for fn in sorted(fset):
                 yield fn
-            raise StopIteration
+            return
 
         for fn in self:
             if fn in fset: