[PATCH 1 of 2 py3 V2] dirstate: use next(iter) instead of iter.next

Pulkit Goyal 7895pulkit at gmail.com
Thu Mar 16 21:24:49 UTC 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1489634873 -19800
#      Thu Mar 16 08:57:53 2017 +0530
# Node ID c894bad6625973565b21f556896527141f123dd5
# Parent  a5bad127128d8f60060be53d161acfa7a32a17d5
dirstate: use next(iter) instead of iter.next

In Python 3 world, iter.next() is renamed to iter.__next__(). But next(iter)
has the same behaviour. So let's replace iter.next() with next(iter).

diff -r a5bad127128d -r c894bad66259 mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Mar 15 15:48:57 2017 -0700
+++ b/mercurial/dirstate.py	Thu Mar 16 08:57:53 2017 +0530
@@ -1115,9 +1115,8 @@
             else:
                 # We may not have walked the full directory tree above,
                 # so stat and check everything we missed.
-                nf = iter(visit).next
                 for st in util.statfiles([join(i) for i in visit]):
-                    results[nf()] = st
+                    results[next(iter(visit))] = st
         return results
 
     def status(self, match, subrepos, ignored, clean, unknown):


More information about the Mercurial-devel mailing list