Commit 0f7f9c35 authored by Martin v. Löwis's avatar Martin v. Löwis

Delete bsddb from sys.modules if _bsddb cannot be imported.

parent 0b982403
...@@ -43,7 +43,14 @@ People interested in the more advanced capabilites of Berkeley DB 3.x ...@@ -43,7 +43,14 @@ People interested in the more advanced capabilites of Berkeley DB 3.x
should use the bsddb3.db module directly. 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 # bsddb3 calls it _db
_db = _bsddb _db = _bsddb
__version__ = _db.__version__ __version__ = _db.__version__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment