[pypy-commit] pypy default: we can't reset the statement to none here, fix it
fijal
noreply at buildbot.pypy.org
Fri Apr 5 14:28:14 CEST 2013
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch:
Changeset: r63058:221d5aeae574
Date: 2013-04-05 14:27 +0200
http://bitbucket.org/pypy/pypy/changeset/221d5aeae574/
Log: we can't reset the statement to none here, fix it
diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -1080,7 +1080,6 @@
next_row = self.__next_row
except AttributeError:
self.__statement._reset()
- self.__statement = None
raise StopIteration
del self.__next_row
diff --git a/pypy/module/test_lib_pypy/test_sqlite3.py b/pypy/module/test_lib_pypy/test_sqlite3.py
--- a/pypy/module/test_lib_pypy/test_sqlite3.py
+++ b/pypy/module/test_lib_pypy/test_sqlite3.py
@@ -210,3 +210,9 @@
gc.collect()
got = (val[0], val[1], val[2], val[3])
assert got == ('b', 'l', 'o', 'b')
+
+def test_description_after_fetchall():
+ con = _sqlite3.connect(":memory:")
+ cur = con.cursor()
+ cur.execute("select 42").fetchall()
+ assert cur.description is not None
More information about the pypy-commit
mailing list