# HG changeset patch # User Martin von Zweigbergk # Date 1428471377 25200 # Node ID aef3d14697732709084408ff126d9ea7a4a9cc8f # Parent 33ab99a6ad9b2492af4f3c7a45736d2aac50f980 manifest.walk: use return instead of StopIteration in generator Using "return" within a generator is supposedly more Pythonic than raising StopIteration. diff -r 33ab99a6ad9b -r aef3d1469773 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: