[py3k] add list() around dict methods
authorRémi Cardona <remi.cardona@logilab.fr>
Mon, 05 Oct 2015 17:10:36 +0200
changeset 10686 a08d5a657836
parent 10685 44cb0e9df181
child 10687 d394bfcd8c25
[py3k] add list() around dict methods
devtools/devctl.py
rqlrewrite.py
rtags.py
web/propertysheet.py
web/views/tableview.py
--- a/devtools/devctl.py	Tue Sep 15 18:43:19 2015 +0200
+++ b/devtools/devctl.py	Mon Oct 05 17:10:36 2015 +0200
@@ -84,7 +84,7 @@
 
 def cleanup_sys_modules(config):
     # cleanup sys.modules, required when we're updating multiple cubes
-    for name, mod in sys.modules.items():
+    for name, mod in list(sys.modules.items()):
         if mod is None:
             # duh ? logilab.common.os for instance
             del sys.modules[name]
--- a/rqlrewrite.py	Tue Sep 15 18:43:19 2015 +0200
+++ b/rqlrewrite.py	Mon Oct 05 17:10:36 2015 +0200
@@ -702,7 +702,7 @@
                 # no more references, undefine the variable
                 del self.select.defined_vars[vref.name]
                 removed.add(vref.name)
-        for key, newvar in self.rewritten.items(): # I mean items we alter it
+        for key, newvar in list(self.rewritten.items()):
             if newvar in removed:
                 del self.rewritten[key]
 
--- a/rtags.py	Tue Sep 15 18:43:19 2015 +0200
+++ b/rtags.py	Mon Oct 05 17:10:36 2015 +0200
@@ -97,7 +97,7 @@
     def init(self, schema, check=True):
         # XXX check existing keys against schema
         if check:
-            for (stype, rtype, otype, tagged), value in self._tagdefs.items():
+            for (stype, rtype, otype, tagged), value in list(self._tagdefs.items()):
                 for ertype in (stype, rtype, otype):
                     if ertype != '*' and not ertype in schema:
                         self.warning('removing rtag %s: %s, %s undefined in schema',
--- a/web/propertysheet.py	Tue Sep 15 18:43:19 2015 +0200
+++ b/web/propertysheet.py	Mon Oct 05 17:10:36 2015 +0200
@@ -69,7 +69,7 @@
         self._ordered_propfiles.append(fpath)
 
     def need_reload(self):
-        for rid, (adirectory, rdirectory, mtime) in self._cache.items():
+        for rid, (adirectory, rdirectory, mtime) in list(self._cache.items()):
             if os.stat(osp.join(rdirectory, rid)).st_mtime > mtime:
                 del self._cache[rid]
         for fpath, mtime in self._propfile_mtime.items():
--- a/web/views/tableview.py	Tue Sep 15 18:43:19 2015 +0200
+++ b/web/views/tableview.py	Mon Oct 05 17:10:36 2015 +0200
@@ -165,7 +165,7 @@
 
     def __init__(self, req, view, **kwargs):
         super(TableLayout, self).__init__(req, **kwargs)
-        for key, val in self.cw_extra_kwargs.items():
+        for key, val in list(self.cw_extra_kwargs.items()):
             if hasattr(self.__class__, key) and not key[0] == '_':
                 setattr(self, key, val)
                 self.cw_extra_kwargs.pop(key)