mercurial/extensions.py
changeset 43106 d783f945a701
parent 43089 c59eb1560c44
child 43238 101ae8bbfa02
--- a/mercurial/extensions.py	Sun Oct 06 19:25:18 2019 -0400
+++ b/mercurial/extensions.py	Mon Oct 07 00:04:04 2019 -0400
@@ -74,7 +74,7 @@
     try:
         mod = _extensions[name]
     except KeyError:
-        for k, v in _extensions.iteritems():
+        for k, v in pycompat.iteritems(_extensions):
             if k.endswith(b'.' + name) or k.endswith(b'/' + name):
                 mod = v
                 break
@@ -167,7 +167,7 @@
 
 def _validatecmdtable(ui, cmdtable):
     """Check if extension commands have required attributes"""
-    for c, e in cmdtable.iteritems():
+    for c, e in pycompat.iteritems(cmdtable):
         f = e[0]
         missing = [a for a in _cmdfuncattrs if not util.safehasattr(f, a)]
         if not missing:
@@ -551,7 +551,7 @@
     '''
     assert callable(wrapper)
     aliases, entry = cmdutil.findcmd(command, table)
-    for alias, e in table.iteritems():
+    for alias, e in pycompat.iteritems(table):
         if e is entry:
             key = alias
             break
@@ -725,7 +725,7 @@
         if name in exts or name in _order or name == b'__init__':
             continue
         exts[name] = path
-    for name, path in _disabledextensions.iteritems():
+    for name, path in pycompat.iteritems(_disabledextensions):
         # If no path was provided for a disabled extension (e.g. "color=!"),
         # don't replace the path we already found by the scan above.
         if path:
@@ -787,7 +787,7 @@
 
         return dict(
             (name, gettext(desc))
-            for name, desc in __index__.docs.iteritems()
+            for name, desc in pycompat.iteritems(__index__.docs)
             if name not in _order
         )
     except (ImportError, AttributeError):
@@ -798,7 +798,7 @@
         return {}
 
     exts = {}
-    for name, path in paths.iteritems():
+    for name, path in pycompat.iteritems(paths):
         doc = _disabledhelp(path)
         if doc:
             exts[name] = doc.splitlines()[0]
@@ -897,7 +897,7 @@
         ext = _finddisabledcmd(ui, cmd, cmd, path, strict=strict)
     if not ext:
         # otherwise, interrogate each extension until there's a match
-        for name, path in paths.iteritems():
+        for name, path in pycompat.iteritems(paths):
             ext = _finddisabledcmd(ui, cmd, name, path, strict=strict)
             if ext:
                 break
@@ -921,7 +921,9 @@
 
 def notloaded():
     '''return short names of extensions that failed to load'''
-    return [name for name, mod in _extensions.iteritems() if mod is None]
+    return [
+        name for name, mod in pycompat.iteritems(_extensions) if mod is None
+    ]
 
 
 def moduleversion(module):