]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- no encoding with arrays
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Apr 2011 19:59:28 +0000 (15:59 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Apr 2011 19:59:28 +0000 (15:59 -0400)
- rework the "builtin types" thing with the ReplayableSession to be py3k compatible

lib/sqlalchemy/dialects/postgresql/psycopg2.py
test/lib/engines.py

index d840a0d1eefcda2c3488f299eea085020b40d3e4..708a7219571ffb95f957f6144f621f74e99be5b6 100644 (file)
@@ -150,11 +150,13 @@ class _PGEnum(ENUM):
 class _PGArray(ARRAY):
     def __init__(self, *arg, **kw):
         super(_PGArray, self).__init__(*arg, **kw)
+        # Py2K
         # FIXME: this check won't work for setups that
         # have convert_unicode only on their create_engine().
         if isinstance(self.item_type, sqltypes.String) and \
                     self.item_type.convert_unicode:
             self.item_type.convert_unicode = "force"
+        # end Py2K
 
 # When we're handed literal SQL, ensure it's a SELECT-query. Since
 # 8.3, combining cursors and "FOR UPDATE" has been fine.
index 8e251b3514abe80ddbe4d20d8fbf7f00017a1030..4794a5fabdaa2e9a4bce9b4401c03a0e429a1599 100644 (file)
@@ -203,19 +203,25 @@ class ReplayableSession(object):
 
     Callable = object()
     NoAttribute = object()
+
+    # Py3K
+    #Natives = set([getattr(types, t)
+    #               for t in dir(types) if not t.startswith('_')]). \
+    #               union([type(t) if not isinstance(t, type) 
+    #                        else t for t in __builtins__.values()]).\
+    #               difference([getattr(types, t)
+    #                        for t in ('FunctionType', 'BuiltinFunctionType',
+    #                                  'MethodType', 'BuiltinMethodType',
+    #                                  'LambdaType', )])
+    # Py2K
     Natives = set([getattr(types, t)
                    for t in dir(types) if not t.startswith('_')]). \
                    difference([getattr(types, t)
-                            # Py3K
-                            #for t in ('FunctionType', 'BuiltinFunctionType',
-                            #          'MethodType', 'BuiltinMethodType',
-                            #          'LambdaType', )])
-
-                            # Py2K
-                               for t in ('FunctionType', 'BuiltinFunctionType',
-                                         'MethodType', 'BuiltinMethodType',
-                                         'LambdaType', 'UnboundMethodType',)])
-                            # end Py2K
+                           for t in ('FunctionType', 'BuiltinFunctionType',
+                                     'MethodType', 'BuiltinMethodType',
+                                     'LambdaType', 'UnboundMethodType',)])
+    # end Py2K
+
     def __init__(self):
         self.buffer = deque()