[pypy-commit] pypy default: Issue #2097: corner case in _sqlite3

arigo noreply at buildbot.pypy.org
Wed Jul 29 15:16:18 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r78710:3b425a82424c
Date: 2015-07-29 15:16 +0200
http://bitbucket.org/pypy/pypy/changeset/3b425a82424c/

Log:	Issue #2097: corner case in _sqlite3

diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -345,7 +345,10 @@
 
     def _finalize_raw_statement(self, _statement):
         if self.__rawstatements is not None:
-            self.__rawstatements.remove(_statement)
+            try:
+                self.__rawstatements.remove(_statement)
+            except KeyError:
+                return    # rare case: already finalized, see issue #2097
             _lib.sqlite3_finalize(_statement)
 
     def __do_all_statements(self, action, reset_cursors):


More information about the pypy-commit mailing list