diff options
| author | Michael Trier <mtrier@gmail.com> | 2008-12-21 00:47:04 +0000 |
|---|---|---|
| committer | Michael Trier <mtrier@gmail.com> | 2008-12-21 00:47:04 +0000 |
| commit | 12307ecbcfec6cabcc0433618c2f34a88c5fc95c (patch) | |
| tree | e61db0ba0954098bf09ebefcd302c320d8e60c13 /test/testlib/compat.py | |
| parent | 0dc8bce4fedb7359dde6ec9cdf0e98e5ed4dd0d8 (diff) | |
| download | sqlalchemy-12307ecbcfec6cabcc0433618c2f34a88c5fc95c.tar.gz | |
Pulled callable into testlib because path fixup is not available at the point we need it.
Diffstat (limited to 'test/testlib/compat.py')
| -rw-r--r-- | test/testlib/compat.py | 8 |
1 files changed, 7 insertions, 1 deletions
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__') + |
