diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2003-09-21 00:08:14 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2003-09-21 00:08:14 (GMT) |
commit | 41631e8f668c9c2c724731d207edcc39c6fcf38c (patch) | |
tree | 89612b4cc0c0a621cdd71cf4fa9a3df18e815437 /Lib/bsddb/db.py | |
parent | cec1b3f6a7e899179c6463145ceff47a6c5bc805 (diff) | |
download | cpython-41631e8f668c9c2c724731d207edcc39c6fcf38c.zip cpython-41631e8f668c9c2c724731d207edcc39c6fcf38c.tar.gz cpython-41631e8f668c9c2c724731d207edcc39c6fcf38c.tar.bz2 |
Adds basic support for BerkeleyDB 4.2.x. Compiles and passes tests; new
features in BerkeleyDB not exposed. notably: the DB_MPOOLFILE interface
has not yet been wrapped in an object.
Adds support for building and installing bsddb3 in python2.3 that has
an older version of this module installed as bsddb without conflicts.
The pybsddb.sf.net build/packaged version of the module uses a
dynamicly loadable module called _pybsddb rather than _bsddb.
Diffstat (limited to 'Lib/bsddb/db.py')
-rw-r--r-- | Lib/bsddb/db.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Lib/bsddb/db.py b/Lib/bsddb/db.py index c1749df..b2ee14e 100644 --- a/Lib/bsddb/db.py +++ b/Lib/bsddb/db.py @@ -37,8 +37,15 @@ # case we ever want to augment the stuff in _db in any way. For now # it just simply imports everything from _db. -from _bsddb import * -from _bsddb import __version__ +if __name__[:len('bsddb3.')] == 'bsddb3.': + # import _pybsddb binary as it should be the more recent version from + # a standalone pybsddb addon package than the version included with + # python as bsddb._bsddb. + from _pybsddb import * + from _pybsddb import __version__ +else: + from _bsddb import * + from _bsddb import __version__ -if version() < (3, 1, 0): - raise ImportError, "BerkeleyDB 3.x symbols not found. Perhaps python was statically linked with an older version?" +if version() < (3, 2, 0): + raise ImportError, "correct BerkeleyDB symbols not found. Perhaps python was statically linked with an older version?" |