summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/dumbdbm.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/dumbdbm.py b/Lib/dumbdbm.py
index 0fd2dad..920a464 100644
--- a/Lib/dumbdbm.py
+++ b/Lib/dumbdbm.py
@@ -143,9 +143,15 @@ class _Database:
return len(self._index)
def close(self):
+ self._commit()
self._index = None
self._datfile = self._dirfile = self._bakfile = None
+ def __del__(self):
+ if self._index is not None:
+ self._commit()
+
+
def open(file, flag=None, mode=0666):
# flag, mode arguments are currently ignored