From: Mike Bayer Date: Sat, 18 Dec 2010 00:27:01 +0000 (-0500) Subject: this innocuous change allows sqlite to work with pypy. sadly, pypy is twice as slow X-Git-Tag: rel_0_7b1~150^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b774516a89d9acd615c7c40eb0c16d8befc6014;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git this innocuous change allows sqlite to work with pypy. sadly, pypy is twice as slow even if i run the same test script four or five times to prime the jit. --- diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index a74ea0c3c9..707bc1630e 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -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)