]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
this innocuous change allows sqlite to work with pypy. sadly, pypy is twice as slow
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 18 Dec 2010 00:27:01 +0000 (19:27 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 18 Dec 2010 00:27:01 +0000 (19:27 -0500)
even if i run the same test script four or five times to prime the jit.

lib/sqlalchemy/dialects/sqlite/base.py

index a74ea0c3c93eb170ffcffd8ca79667393a42fa50..707bc1630ee50f38b0d59e659e006e8b5f8b5467 100644 (file)
@@ -439,10 +439,10 @@ class SQLiteDialect(default.DefaultDialect):
         qtable = quote(table_name)
         cursor = _pragma_cursor(connection.execute("%stable_info(%s)" % (pragma, qtable)))
         row = cursor.fetchone()
-
+        
         # consume remaining rows, to work around
         # http://www.sqlite.org/cvstrac/tktview?tn=1884
-        while cursor.fetchone() is not None:
+        while not cursor.closed and cursor.fetchone() is not None:
             pass
 
         return (row is not None)