Patchwork [07,of,10,py3] dirstate: use future-proof next(iter) instead of iter.next

login
register
mail settings
Submitter Augie Fackler
Date March 19, 2017, 6:26 p.m.
Message ID <d5e20f704fd722dbf8b0.1489947980@imladris.local>
Download mbox | patch
Permalink /patch/19455/
State Accepted
Headers show

Comments

Augie Fackler - March 19, 2017, 6:26 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489900097 14400
#      Sun Mar 19 01:08:17 2017 -0400
# Node ID d5e20f704fd722dbf8b0a011b3c9ab7437b4ac82
# Parent  b9f5a75f7ca098d588feea0737fdb0ac1162cb41
dirstate: use future-proof next(iter) instead of iter.next

The latter has been removed in Python 3.

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1115,9 +1115,9 @@  class dirstate(object):
             else:
                 # We may not have walked the full directory tree above,
                 # so stat and check everything we missed.
-                nf = iter(visit).next
+                iv = iter(visit)
                 for st in util.statfiles([join(i) for i in visit]):
-                    results[nf()] = st
+                    results[next(iv)] = st
         return results
 
     def status(self, match, subrepos, ignored, clean, unknown):