mirror of
https://github.com/python/cpython.git
synced 2025-11-12 07:02:33 +00:00
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:
parent
0d366b1418
commit
7a98e8083c
1 changed files with 5 additions and 0 deletions
|
|
@ -113,6 +113,11 @@ def contains_metastrings(s) :
|
||||||
|
|
||||||
|
|
||||||
class bsdTableDB :
|
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) :
|
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)
|
"""bsdTableDB.open(filename, dbhome, create=0, truncate=0, mode=0600)
|
||||||
Open database name in the dbhome BerkeleyDB directory.
|
Open database name in the dbhome BerkeleyDB directory.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue