From: Mike Bayer Date: Fri, 30 Jan 2009 15:12:41 +0000 (+0000) Subject: use sqlalchemy.util functions here. the previous implementation is X-Git-Tag: rel_0_6_6~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41e9dbd2ef2f1b5e8dc2c68c12719afda5452e88;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git 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. --- 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