diff options
author | bertrand <bertrand.l3f@gmail.com> | 2016-01-30 21:00:55 -0500 |
---|---|---|
committer | bertrand <bertrand.l3f@gmail.com> | 2016-01-30 21:00:55 -0500 |
commit | 32ae04a43ccd7a3413deb1711796280f8fa69ba0 (patch) | |
tree | 066b56a473a67c563a31884c7dff7c4952d7bc4b /numpy/lib/arraypad.py | |
parent | 9cfdb218b16cba97800fc2ad0f37e1af780ab664 (diff) | |
download | numpy-32ae04a43ccd7a3413deb1711796280f8fa69ba0.tar.gz |
BUG: mode kwargs passed as unicode to np.pad raises an exception
isinstance(mode, str) is False in python2.7 when mode is of unicode
type, and mode is then mistakenly assumed to be a callable. See #7112
Diffstat (limited to 'numpy/lib/arraypad.py')
-rw-r--r-- | numpy/lib/arraypad.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py index dad1f4764..c30ef6bf5 100644 --- a/numpy/lib/arraypad.py +++ b/numpy/lib/arraypad.py @@ -1337,7 +1337,7 @@ def pad(array, pad_width, mode, **kwargs): 'reflect_type': 'even', } - if isinstance(mode, str): + if isinstance(mode, np.compat.basestring): # Make sure have allowed kwargs appropriate for mode for key in kwargs: if key not in allowedkwargs[mode]: |