mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Added support to recognize Python's internal "dumbdbm" database.
This closes bug 200 on Jitterbug.
This commit is contained in:
parent
37c03ff3a9
commit
7a4409c1b2
1 changed files with 12 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue