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/testing/decorators.py | |
parent | 0934653e151969f6912c911b5113306bd5f450f1 (diff) | |
download | numpy-dd13084557f46343b9fac0c02725a826d0ca397b.tar.gz |
2to3: Fix callable.
Diffstat (limited to 'numpy/testing/decorators.py')
-rw-r--r-- | numpy/testing/decorators.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/testing/decorators.py b/numpy/testing/decorators.py index 053b99211..ed7b1032b 100644 --- a/numpy/testing/decorators.py +++ b/numpy/testing/decorators.py @@ -18,6 +18,7 @@ import sys from numpy.testing.utils import \ WarningManager, WarningMessage +import collections def slow(t): """ @@ -122,7 +123,7 @@ def skipif(skip_condition, msg=None): import nose # Allow for both boolean or callable skip conditions. - if callable(skip_condition): + if isinstance(skip_condition, collections.Callable): skip_val = lambda : skip_condition() else: skip_val = lambda : skip_condition @@ -198,7 +199,7 @@ def knownfailureif(fail_condition, msg=None): msg = 'Test skipped due to known failure' # Allow for both boolean or callable known failure conditions. - if callable(fail_condition): + if isinstance(fail_condition, collections.Callable): fail_val = lambda : fail_condition() else: fail_val = lambda : fail_condition @@ -264,7 +265,7 @@ def deprecated(conditional=True): finally: ctx.__exit__() - if callable(conditional): + if isinstance(conditional, collections.Callable): cond = conditional() else: cond = conditional |