diff options
| author | Guido van Rossum <guido@python.org> | 2002-12-02 16:17:46 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2002-12-02 16:17:46 +0000 |
| commit | 7a98e8083c4eb21c33cdb6508dff74974a02a448 (patch) | |
| tree | 48ecbb8e4d314771385ef684e0b346b1f58f2596 | |
| parent | 0d366b1418dfc980ead4b13526703aa2ee5e10e7 (diff) | |
| download | cpython-git-7a98e8083c4eb21c33cdb6508dff74974a02a448.tar.gz | |
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.
| -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 4841c283a5..1409eb1040 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. |
