[Python-checkins] python/dist/src/Lib whichdb.py,1.15,1.16
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Sat, 21 Jun 2003 06:54:57 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv10663
Modified Files:
whichdb.py
Log Message:
Patch #755087: Deal with emptied dumbdbm files correctly.
Index: whichdb.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/whichdb.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** whichdb.py 14 Jun 2003 08:16:33 -0000 1.15
--- whichdb.py 21 Jun 2003 13:54:55 -0000 1.16
***************
*** 52,59 ****
try:
# First check for presence of files
! sizes = os.stat(filename + os.extsep + "dat").st_size, \
! os.stat(filename + os.extsep + "dir").st_size
# dumbdbm files with no keys are empty
! if sizes == (0, 0):
return "dumbdbm"
f = open(filename + os.extsep + "dir", "rb")
--- 52,59 ----
try:
# First check for presence of files
! os.stat(filename + os.extsep + "dat")
! size = os.stat(filename + os.extsep + "dir").st_size
# dumbdbm files with no keys are empty
! if size == 0:
return "dumbdbm"
f = open(filename + os.extsep + "dir", "rb")