commit | 6d06815b562e1540ee334d30953354210dfebd24 | [log] [tgz] |
---|---|---|
author | Skip Montanaro <skip@pobox.com> | Mon Jul 14 12:15:15 2003 +0000 |
committer | Skip Montanaro <skip@pobox.com> | Mon Jul 14 12:15:15 2003 +0000 |
tree | 55e162f81b0d49f6709b4ad2ec5aa6517334136d | |
parent | a2d3d93ee352bdddc9b37c053126c8995fcb575c [diff] |
Give dumbdbm a sync() method which Shelve can call. Should solve some database corruption problems with Spambayes.
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 @@ 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')