[Python-checkins] r42525 - python/trunk/Lib/bsddb/__init__.py

georg.brandl python-checkins at python.org
Mon Feb 20 21:29:53 CET 2006


Author: georg.brandl
Date: Mon Feb 20 21:29:52 2006
New Revision: 42525

Modified:
   python/trunk/Lib/bsddb/__init__.py
Log:
Bug #1210377: close bsddb cursor correctly after NotFoundError.


Modified: python/trunk/Lib/bsddb/__init__.py
==============================================================================
--- python/trunk/Lib/bsddb/__init__.py	(original)
+++ python/trunk/Lib/bsddb/__init__.py	Mon Feb 20 21:29:52 2006
@@ -191,7 +191,10 @@
             c = self.dbc
             self.dbc = None
             if save:
-                self.saved_dbc_key = c.current(0,0,0)[0]
+                try:
+                    self.saved_dbc_key = c.current(0,0,0)[0]
+                except db.DBError:
+                    pass                    
             c.close()
             del c
         for cref in self._cursor_refs.values():


More information about the Python-checkins mailing list