From 41e9dbd2ef2f1b5e8dc2c68c12719afda5452e88 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 30 Jan 2009 15:12:41 +0000 Subject: [PATCH] use sqlalchemy.util functions here. the previous implementation is not compatible with py3k. I can run all tests or any combination of tests by using sqlalchemy.util so it's not clear to me why sqlalchemy.util reportedly cannot be imported at this phase. --- test/testlib/compat.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/test/testlib/compat.py b/test/testlib/compat.py index c366817645..6e1f760548 100644 --- a/test/testlib/compat.py +++ b/test/testlib/compat.py @@ -1,19 +1,5 @@ -import types -import __builtin__ __all__ = '_function_named', 'callable' - -def _function_named(fn, newname): - try: - fn.__name__ = newname - except: - fn = types.FunctionType(fn.func_code, fn.func_globals, newname, - fn.func_defaults, fn.func_closure) - return fn - -try: - from __builtin__ import callable -except ImportError: - callable = lambda x: hasattr(x, '__call__') +from sqlalchemy.util import callable, function_named as _function_named -- 2.47.3