Author: Armin Rigo <ar...@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):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to