mercurial/revset.py
changeset 25145 3553163bb736
parent 25144 81a395447b34
child 25146 f542a2c89b60
--- a/mercurial/revset.py	Sun May 17 17:58:39 2015 -0700
+++ b/mercurial/revset.py	Sun May 17 18:00:38 2015 -0700
@@ -1172,12 +1172,11 @@
     result = []
     it = iter(os)
     for x in xrange(lim):
-        try:
-            y = it.next()
-            if y in ss:
-                result.append(y)
-        except (StopIteration):
+        y = next(it, None)
+        if y is None:
             break
+        elif y in ss:
+            result.append(y)
     return baseset(result)
 
 def maxrev(repo, subset, x):