summaryrefslogtreecommitdiff
path: root/numpy/lib/arraypad.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-06 19:09:17 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-04-06 19:09:17 -0600
commitaab46a78cefe9fbd46104496ffad17667784a3f5 (patch)
tree1385a8433047a5cb92f3dcf3b2af12ca02b0025d /numpy/lib/arraypad.py
parent3c70e20a5f1aed4098ba66d21e6a1f60edc6fddd (diff)
downloadnumpy-aab46a78cefe9fbd46104496ffad17667784a3f5.tar.gz
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.
Diffstat (limited to 'numpy/lib/arraypad.py')
-rw-r--r--numpy/lib/arraypad.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py
index de909bc87..8a7c3a067 100644
--- a/numpy/lib/arraypad.py
+++ b/numpy/lib/arraypad.py
@@ -754,7 +754,7 @@ def pad(array, pad_width, mode=None, **kwargs):
kwargs[i] = _normalize_shape(narray, kwargs[i])
elif mode == None:
raise ValueError('Keyword "mode" must be a function or one of %s.' %
- (modefunc.keys(),))
+ (list(modefunc.keys()),))
else:
# User supplied function, I hope
function = mode