mercurial/revset.py
changeset 25143 91c49621b2b8
parent 25131 adfe4d9680bf
child 25144 81a395447b34
--- a/mercurial/revset.py	Sun May 17 17:47:42 2015 -0700
+++ b/mercurial/revset.py	Sun May 17 17:54:58 2015 -0700
@@ -28,21 +28,18 @@
         revs.sort(reverse=True)
         irevs = iter(revs)
         h = []
-        try:
-            inputrev = irevs.next()
+
+        inputrev = next(irevs, None)
+        if inputrev is not None:
             heapq.heappush(h, -inputrev)
-        except StopIteration:
-            return
 
         seen = set()
         while h:
             current = -heapq.heappop(h)
             if current == inputrev:
-                try:
-                    inputrev = irevs.next()
+                inputrev = next(irevs, None)
+                if inputrev is not None:
                     heapq.heappush(h, -inputrev)
-                except StopIteration:
-                    pass
             if current not in seen:
                 seen.add(current)
                 yield current