From: Mike Bayer Date: Mon, 27 Dec 2010 19:17:10 +0000 (-0500) Subject: py3k fixes X-Git-Tag: rel_0_7b1~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe2d3e0aa25d58e1b1b352e98792ac62f4cd315c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git py3k fixes --- diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 9efb5e5f40..4d36838cd6 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -144,7 +144,8 @@ class DefaultDialect(base.Dialect): 'description_encoding', encoding) - self._description_decoder = processors.to_unicode_processor_factory( + if self.description_encoding: + self._description_decoder = processors.to_unicode_processor_factory( self.description_encoding ) self._encoder = codecs.getencoder(self.encoding) diff --git a/test/aaa_profiling/test_compiler.py b/test/aaa_profiling/test_compiler.py index 5afcf69bc2..d77624cb51 100644 --- a/test/aaa_profiling/test_compiler.py +++ b/test/aaa_profiling/test_compiler.py @@ -33,7 +33,7 @@ class CompileTest(TestBase, AssertsExecutionResults): cls.dialect = default.DefaultDialect() @profiling.function_call_count(versions={'2.7':58, '2.6':58, - '3.0':77, '3.1':77}) + '3':64}) def test_insert(self): t1.insert().compile(dialect=self.dialect) @@ -41,12 +41,12 @@ class CompileTest(TestBase, AssertsExecutionResults): def test_update(self): t1.update().compile(dialect=self.dialect) - @profiling.function_call_count(versions={'2.6':110, '2.7':110, '2.4': 81, '3':132}) + @profiling.function_call_count(versions={'2.6':110, '2.7':110, '2.4': 81, '3':115}) def test_update_whereclause(self): t1.update().where(t1.c.c2==12).compile(dialect=self.dialect) @profiling.function_call_count(versions={'2.7':148, '2.6':148, - '3.0':208, '3.1':208}) + '3':161}) def test_select(self): s = select([t1], t1.c.c2==t2.c.c1) s.compile(dialect=self.dialect) diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py index 519a29c29f..e226454b69 100644 --- a/test/aaa_profiling/test_orm.py +++ b/test/aaa_profiling/test_orm.py @@ -54,7 +54,7 @@ class MergeTest(_base.MappedTest): # bigger operation so using a small variance @profiling.function_call_count(80, variance=0.05, - versions={'2.4': 64, '2.5':94, '3': 89}) + versions={'2.4': 64, '2.5':94, '3': 83}) def go(): return sess2.merge(p1, load=False) p2 = go()