From 12307ecbcfec6cabcc0433618c2f34a88c5fc95c Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Sun, 21 Dec 2008 00:47:04 +0000 Subject: Pulled callable into testlib because path fixup is not available at the point we need it. --- test/testlib/compat.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/testlib/compat.py') diff --git a/test/testlib/compat.py b/test/testlib/compat.py index 374f144f6..73eb2d651 100644 --- a/test/testlib/compat.py +++ b/test/testlib/compat.py @@ -1,6 +1,7 @@ import types +import __builtin__ -__all__ = '_function_named', +__all__ = '_function_named', 'callable' def _function_named(fn, newname): @@ -11,3 +12,8 @@ def _function_named(fn, newname): fn.func_defaults, fn.func_closure) return fn +try: + callable = __builtin__.callable +except NameError: + def callable(fn): return hasattr(fn, '__call__') + -- cgit v1.2.1