mirror of https://github.com/python/cpython
Delete bsddb from sys.modules if _bsddb cannot be imported.
This commit is contained in:
parent
d332c085ea
commit
65730a4de8
|
@ -43,7 +43,14 @@ People interested in the more advanced capabilites of Berkeley DB 3.x
|
|||
should use the bsddb3.db module directly.
|
||||
"""
|
||||
|
||||
import _bsddb
|
||||
try:
|
||||
import _bsddb
|
||||
except ImportError:
|
||||
# Remove ourselves from sys.modules
|
||||
import sys
|
||||
del sys.modules[__name__]
|
||||
raise
|
||||
|
||||
# bsddb3 calls it _db
|
||||
_db = _bsddb
|
||||
__version__ = _db.__version__
|
||||
|
|
Loading…
Reference in New Issue