]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- more liberal check here
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Apr 2011 19:16:12 +0000 (15:16 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Apr 2011 19:16:12 +0000 (15:16 -0400)
- dont encode enums in py3k

lib/sqlalchemy/dialects/postgresql/psycopg2.py
test/sql/test_types.py

index f96dab9a4af6191b15e948384d8252a19370dad2..d840a0d1eefcda2c3488f299eea085020b40d3e4 100644 (file)
@@ -142,8 +142,10 @@ class _PGNumeric(sqltypes.Numeric):
 class _PGEnum(ENUM):
     def __init__(self, *arg, **kw):
         super(_PGEnum, self).__init__(*arg, **kw)
+        # Py2K
         if self.convert_unicode:
             self.convert_unicode = "force"
+        # end Py2K
 
 class _PGArray(ARRAY):
     def __init__(self, *arg, **kw):
index 7865a5296d75f3b36876b56b1a39bdfcd9887bee..d44487d536dcf085a4a197720ce30ff2250a8aad 100644 (file)
@@ -635,7 +635,7 @@ class UnicodeTest(fixtures.TestBase, AssertsExecutionResults):
             row = engine.execute(utf8_table.select()).first()
             x = row['plain_varchar_no_coding_error']
             connect_opts = engine.dialect.create_connect_args(testing.db.url)[1]
-            if connect_opts.get('use_unicode', False):
+            if isinstance(x, unicode):
                 x = x.encode('utf-8')
             a = hexlify(x)
             b = hexlify(asciidata)