]> granicus.if.org Git - python/commitdiff
Bug #1210377: close bsddb cursor correctly after NotFoundError.
authorGeorg Brandl <georg@python.org>
Mon, 20 Feb 2006 20:29:52 +0000 (20:29 +0000)
committerGeorg Brandl <georg@python.org>
Mon, 20 Feb 2006 20:29:52 +0000 (20:29 +0000)
Lib/bsddb/__init__.py

index 4903584a66ebe524ec2e9aa888f68ec370d6d9f5..b7bd4821419b20022b9107ab4c3293b355f4e07b 100644 (file)
@@ -191,7 +191,10 @@ class _DBWithCursor(_iter_mixin):
             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():