diff options
author | njsmith <njs@pobox.com> | 2013-02-28 12:10:05 -0800 |
---|---|---|
committer | njsmith <njs@pobox.com> | 2013-02-28 12:10:05 -0800 |
commit | 4b361f62be7f750dc385d0b7dc7529ad9af5e4ea (patch) | |
tree | cbe8daa0a9806b2fa84e35d55af391f97a9ced98 /numpy/core/numeric.py | |
parent | e1c7c4df0c7afb0baff683c7e3a1f4b205d6e572 (diff) | |
parent | dd13084557f46343b9fac0c02725a826d0ca397b (diff) | |
download | numpy-4b361f62be7f750dc385d0b7dc7529ad9af5e4ea.tar.gz |
Merge pull request #3047 from charris/2to3-callable
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() |