mirror of https://github.com/python/cpython
Fix up the cleanup of the temporary DB so it works for BSD DB's
compatibility layer as well as "classic" ndbm.
This commit is contained in:
parent
a12adfe485
commit
57a4e90922
|
@ -28,7 +28,15 @@ d.close()
|
|||
|
||||
try:
|
||||
import os
|
||||
if dbm.library == "ndbm":
|
||||
# classic dbm
|
||||
os.unlink(filename + '.dir')
|
||||
os.unlink(filename + '.pag')
|
||||
elif dbm.library == "BSD db":
|
||||
# BSD DB's compatibility layer
|
||||
os.unlink(filename + '.db')
|
||||
else:
|
||||
# GNU gdbm compatibility layer
|
||||
os.unlink(filename)
|
||||
except:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue