From: Martin v. Löwis Date: Sat, 21 Jun 2003 13:54:55 +0000 (+0000) Subject: Patch #755087: Deal with emptied dumbdbm files correctly. X-Git-Tag: v2.3c1~345 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b8bfdf67c1faac91b414638d26d612474cdf112;p=python Patch #755087: Deal with emptied dumbdbm files correctly. --- diff --git a/Lib/whichdb.py b/Lib/whichdb.py index 92996367ee..6c4f61a019 100644 --- a/Lib/whichdb.py +++ b/Lib/whichdb.py @@ -51,10 +51,10 @@ def whichdb(filename): # Check for dumbdbm next -- this has a .dir and and a .dat file try: # First check for presence of files - sizes = os.stat(filename + os.extsep + "dat").st_size, \ - os.stat(filename + os.extsep + "dir").st_size + os.stat(filename + os.extsep + "dat") + size = os.stat(filename + os.extsep + "dir").st_size # dumbdbm files with no keys are empty - if sizes == (0, 0): + if size == 0: return "dumbdbm" f = open(filename + os.extsep + "dir", "rb") try: