summaryrefslogtreecommitdiffstats
path: root/Lib/whichdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/whichdb.py')
-rw-r--r--Lib/whichdb.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/whichdb.py b/Lib/whichdb.py
index 4dd4e3a..5806118 100644
--- a/Lib/whichdb.py
+++ b/Lib/whichdb.py
@@ -25,6 +25,18 @@ def whichdb(filename):
except IOError:
pass
+ # Check for dumbdbm next -- this has a .dir and and a .dat file
+ f = open(filename + ".dat", "rb")
+ f.close()
+ f = open(filename + ".dir", "rb")
+ try:
+ if f.read(1) in ["'", '"']:
+ return "dumbdbm"
+ finally:
+ f.close()
+ except IOError:
+ pass
+
# See if the file exists, return None if not
try:
f = open(filename, "rb")