changeset 24682:aef3d1469773

manifest.walk: use return instead of StopIteration in generator Using "return" within a generator is supposedly more Pythonic than raising StopIteration.
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 07 Apr 2015 22:36:17 -0700
parents 33ab99a6ad9b
children 4eaea0ed8dc1
files mercurial/manifest.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: