Commit a223d2cb authored by Georg Brandl's avatar Georg Brandl

Bug #1210377: close bsddb cursor correctly after NotFoundError.

parent 9a276172
...@@ -191,7 +191,10 @@ class _DBWithCursor(_iter_mixin): ...@@ -191,7 +191,10 @@ class _DBWithCursor(_iter_mixin):
c = self.dbc c = self.dbc
self.dbc = None self.dbc = None
if save: if save:
try:
self.saved_dbc_key = c.current(0,0,0)[0] self.saved_dbc_key = c.current(0,0,0)[0]
except db.DBError:
pass
c.close() c.close()
del c del c
for cref in self._cursor_refs.values(): for cref in self._cursor_refs.values():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment