diff options
author | Skip Montanaro <skip@pobox.com> | 2003-07-14 12:15:15 (GMT) |
---|---|---|
committer | Skip Montanaro <skip@pobox.com> | 2003-07-14 12:15:15 (GMT) |
commit | 6d06815b562e1540ee334d30953354210dfebd24 (patch) | |
tree | 55e162f81b0d49f6709b4ad2ec5aa6517334136d /Lib/dumbdbm.py | |
parent | a2d3d93ee352bdddc9b37c053126c8995fcb575c (diff) | |
download | cpython-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.py | 2 |
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') |