summaryrefslogtreecommitdiffstats
path: root/Lib/dumbdbm.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2003-07-14 12:15:15 (GMT)
committerSkip Montanaro <skip@pobox.com>2003-07-14 12:15:15 (GMT)
commit6d06815b562e1540ee334d30953354210dfebd24 (patch)
tree55e162f81b0d49f6709b4ad2ec5aa6517334136d /Lib/dumbdbm.py
parenta2d3d93ee352bdddc9b37c053126c8995fcb575c (diff)
downloadcpython-6d06815b562e1540ee334d30953354210dfebd24.zip
cpython-6d06815b562e1540ee334d30953354210dfebd24.tar.gz
cpython-6d06815b562e1540ee334d30953354210dfebd24.tar.bz2
Give dumbdbm a sync() method which Shelve can call. Should solve some
database corruption problems with Spambayes.
Diffstat (limited to 'Lib/dumbdbm.py')
-rw-r--r--Lib/dumbdbm.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/dumbdbm.py b/Lib/dumbdbm.py
index 7b4ddb0..b85844d 100644
--- a/Lib/dumbdbm.py
+++ b/Lib/dumbdbm.py
@@ -110,6 +110,8 @@ class _Database(UserDict.DictMixin):
f.write("%r, %r\n" % (key, pos_and_siz_pair))
f.close()
+ sync = _commit
+
def __getitem__(self, key):
pos, siz = self._index[key] # may raise KeyError
f = _open(self._datfile, 'rb')