]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
py3k fixes
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Dec 2010 19:17:10 +0000 (14:17 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Dec 2010 19:17:10 +0000 (14:17 -0500)
lib/sqlalchemy/engine/default.py
test/aaa_profiling/test_compiler.py
test/aaa_profiling/test_orm.py

index 9efb5e5f40eba27db866abf790baa1ffab7d00cf..4d36838cd6c4c4ad172435d7534fcdf07f572da9 100644 (file)
@@ -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)
index 5afcf69bc24df61313062c12df63cfbe0b16fd56..d77624cb510654015ebb7284966c2c24bc3c569f 100644 (file)
@@ -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)
index 519a29c29f61508e9de32b3967f7c4cb1e6918d6..e226454b69aa9b369065d19e198c1a68af2ee5a5 100644 (file)
@@ -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()