From 32ae04a43ccd7a3413deb1711796280f8fa69ba0 Mon Sep 17 00:00:00 2001 From: bertrand Date: Sat, 30 Jan 2016 21:00:55 -0500 Subject: 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 --- numpy/lib/arraypad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/arraypad.py') 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]: -- cgit v1.2.1