]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
changed default "none" parameters to check positional style
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Mar 2006 17:45:19 +0000 (17:45 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Mar 2006 17:45:19 +0000 (17:45 +0000)
lib/sqlalchemy/engine.py

index 8828e2a0bd7c6e7a3efebd4a3735d02321363cfe..e57cc7bc323ca3f9b53771e6a4575ba03579ab32 100644 (file)
@@ -500,9 +500,6 @@ class SQLEngine(schema.SchemaEngine):
 
         commit      -  if True, will automatically commit the statement after completion. """
         
-        if parameters is None:
-            parameters = {}
-
         if connection is None:
             connection = self.connection()
 
@@ -565,9 +562,6 @@ class SQLEngine(schema.SchemaEngine):
 
         commit      -  if True, will automatically commit the statement after completion. """
         
-        if parameters is None:
-            parameters = {}
-
         if connection is None:
             connection = self.connection()
 
@@ -594,6 +588,11 @@ class SQLEngine(schema.SchemaEngine):
 
     def _execute(self, c, statement, parameters):
         try:
+            if parameters is None:
+                if self.positional:
+                    parameters = ()
+                else:
+                    parameters = {}
             c.execute(statement, parameters)
         except Exception, e:
             raise exceptions.SQLError(statement, parameters, e)