summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-06-21 13:54:55 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-06-21 13:54:55 (GMT)
commit5b8bfdf67c1faac91b414638d26d612474cdf112 (patch)
treeb700c8ff4ada67fdd2f7f36c46a8acbee03efdaf
parent171be76bddce0988ac74e47f73f7631f0be90350 (diff)
downloadcpython-5b8bfdf67c1faac91b414638d26d612474cdf112.zip
cpython-5b8bfdf67c1faac91b414638d26d612474cdf112.tar.gz
cpython-5b8bfdf67c1faac91b414638d26d612474cdf112.tar.bz2
Patch #755087: Deal with emptied dumbdbm files correctly.
-rw-r--r--Lib/whichdb.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/whichdb.py b/Lib/whichdb.py
index 9299636..6c4f61a 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: