From: Michael Trier Date: Sat, 4 Oct 2008 02:57:19 +0000 (+0000) Subject: Didnt think about <2.5. When will I learn. X-Git-Tag: rel_0_5rc2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc5f360cd3e94f43f90b7cee3c8b5ba3de2e26cf;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Didnt think about <2.5. When will I learn. --- diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index c8b9d7f394..a3d813d0fb 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -797,6 +797,19 @@ class BooleanTest(TestBase, AssertsExecutionResults): print res2 assert(res2==[(2, False)]) +try: + from functools import partial +except: + def partial(func, *args, **keywords): + def newfunc(*fargs, **fkeywords): + newkeywords = keywords.copy() + newkeywords.update(fkeywords) + return func(*(args + fargs), **newkeywords) + newfunc.func = func + newfunc.args = args + newfunc.keywords = keywords + return newfunc + class CallableTest(TestBase, AssertsExecutionResults): def setUpAll(self): global meta @@ -806,7 +819,6 @@ class CallableTest(TestBase, AssertsExecutionResults): meta.drop_all() def test_callable_as_arg(self): - from functools import partial ucode = partial(Unicode, assert_unicode=None) thing_table = Table('thing', meta, @@ -814,7 +826,6 @@ class CallableTest(TestBase, AssertsExecutionResults): ) def test_callable_as_kwarg(self): - from functools import partial ucode = partial(Unicode, assert_unicode=None) thang_table = Table('thang', meta,