diff options
author | Guido van Rossum <guido@python.org> | 2002-12-02 16:17:46 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-12-02 16:17:46 (GMT) |
commit | 7a98e8083c4eb21c33cdb6508dff74974a02a448 (patch) | |
tree | 48ecbb8e4d314771385ef684e0b346b1f58f2596 /Lib/bsddb/dbtables.py | |
parent | 0d366b1418dfc980ead4b13526703aa2ee5e10e7 (diff) | |
download | cpython-7a98e8083c4eb21c33cdb6508dff74974a02a448.zip cpython-7a98e8083c4eb21c33cdb6508dff74974a02a448.tar.gz cpython-7a98e8083c4eb21c33cdb6508dff74974a02a448.tar.bz2 |
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.
Diffstat (limited to 'Lib/bsddb/dbtables.py')
-rw-r--r-- | Lib/bsddb/dbtables.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/bsddb/dbtables.py b/Lib/bsddb/dbtables.py index 4841c28..1409eb1 100644 --- a/Lib/bsddb/dbtables.py +++ b/Lib/bsddb/dbtables.py @@ -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. |