[Python-checkins] CVS: python/dist/src/Lib dumbdbm.py,1.15,1.16
Anthony Baxter
anthonybaxter@users.sourceforge.net
Thu, 20 Dec 2001 21:13:39 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv8709
Modified Files:
dumbdbm.py
Log Message:
forward-patch from release21-maint branch:
Make dumbdbm merely "dumb", rather than "terminally broken". Without this
patch, it's almost impossible to use dumbdbm _without_ causing horrible
datalossage. With this patch, dumbdbm passes my own horrible torture test,
as well as the roundup test suite.
dumbdbm really could do with a smidgin of a rewrite or two, but that's not
suitable for the release21-maint branch.
Index: dumbdbm.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dumbdbm.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** dumbdbm.py 2001/12/07 21:54:46 1.15
--- dumbdbm.py 2001/12/21 05:13:37 1.16
***************
*** 144,149 ****
--- 144,155 ----
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()
+