From aab46a78cefe9fbd46104496ffad17667784a3f5 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sat, 6 Apr 2013 19:09:17 -0600 Subject: 2to3: apply `dict` fixer. In Python3 `dict.items()`, `dict.keys()`, and `dict.values()` are iterators. This causes problems when a list is needed so the 2to3 fixer explicitly constructs a list when is finds on of those functions. However, that is usually not necessary, so a lot of the work here has been cleaning up those places where the fix is not needed. The big exception to that is the `numpy/f2py/crackfortran.py` file. The code there makes extensive use of loops that modify the contents of the dictionary being looped through, which raises an error. That together with the obscurity of the code in that file made it safest to let the `dict` fixer do its worst. Closes #3050. --- numpy/lib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 4ed534455..75ba5bca6 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -755,7 +755,7 @@ def lookfor(what, module=None, import_modules=True, regenerate=False, whats = str(what).lower().split() if not whats: return - for name, (docstring, kind, index) in cache.iteritems(): + for name, (docstring, kind, index) in cache.items(): if kind in ('module', 'object'): # don't show modules or objects continue -- cgit v1.2.1