In class bsdTableDB, add class variables db and env (set to None) to

prevent close() called from __del__ from bombing out when __init__()
fails early.
This commit is contained in:
Guido van Rossum 2002-12-02 16:17:46 +00:00
parent 0d366b1418
commit 7a98e8083c

View File

@ -113,6 +113,11 @@ def contains_metastrings(s) :
class bsdTableDB :
# Save close() from bombing out if __init__() failed
db = None
env = None
def __init__(self, filename, dbhome, create=0, truncate=0, mode=0600, recover=0, dbflags=0) :
"""bsdTableDB.open(filename, dbhome, create=0, truncate=0, mode=0600)
Open database name in the dbhome BerkeleyDB directory.