From 7a98e8083c4eb21c33cdb6508dff74974a02a448 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 2 Dec 2002 16:17:46 +0000 Subject: 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. --- Lib/bsddb/dbtables.py | 5 +++++ 1 file changed, 5 insertions(+) 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. -- cgit v0.12