Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r62302:de53c17f0572
Date: 2013-03-11 21:13 -0400
http://bitbucket.org/pypy/pypy/changeset/de53c17f0572/

Log:    sqlite: only call readahead if there is another row

diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -1227,11 +1227,11 @@
             self._exhausted = True
             self._item = None
         elif ret != _lib.SQLITE_ROW:
-            exc = self.__con._get_exception(ret)
             _lib.sqlite3_reset(self._statement)
-            raise exc
+            raise self.__con._get_exception(ret)
+        else:
+            self._readahead(cursor)
 
-        self._readahead(cursor)
         return item
 
     def _get_description(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to