]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
use sqlalchemy.util functions here. the previous implementation is
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 30 Jan 2009 15:12:41 +0000 (15:12 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 30 Jan 2009 15:12:41 +0000 (15:12 +0000)
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

index c36681764542adf6519a132304c326b03678abe6..6e1f7605483c9b804b86028beebb68db0c4474dc 100644 (file)
@@ -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