diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-02-27 18:34:50 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-02-28 09:02:57 -0700 |
commit | dd13084557f46343b9fac0c02725a826d0ca397b (patch) | |
tree | 09f1eaab0ae988fb4e91059224712009d1d29c23 /numpy/core/numeric.py | |
parent | 0934653e151969f6912c911b5113306bd5f450f1 (diff) | |
download | numpy-dd13084557f46343b9fac0c02725a826d0ca397b.tar.gz |
2to3: Fix callable.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 4c5651c3a..f2381a7a6 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -29,6 +29,7 @@ import umath from umath import * import numerictypes from numerictypes import * +import collections if sys.version_info[0] < 3: @@ -2445,8 +2446,8 @@ def seterrcall(func): {'over': 'log', 'divide': 'log', 'invalid': 'log', 'under': 'log'} """ - if func is not None and not callable(func): - if not hasattr(func, 'write') or not callable(func.write): + if func is not None and not isinstance(func, collections.Callable): + if not hasattr(func, 'write') or not isinstance(func.write, collections.Callable): raise ValueError("Only callable can be used as callback") pyvals = umath.geterrobj() old = geterrcall() |