From dc5f360cd3e94f43f90b7cee3c8b5ba3de2e26cf Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Sat, 4 Oct 2008 02:57:19 +0000 Subject: [PATCH] Didnt think about <2.5. When will I learn. --- test/sql/testtypes.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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, -- 2.47.3