mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
bsddb 4.1.6:
* Extended DB & DBEnv set_get_returns_none functionality to take a "level" instead of a boolean flag. The boolean 0 and 1 values still have the same effect. A value of 2 extends the "return None instead of raising an exception" behaviour to the DBCursor set methods. This will become the default behaviour in pybsddb 4.2. * Fixed a typo in DBCursor.join_item method that made it crash instead of returning a value. Obviously nobody uses it. Wrote a test case for join and join_item.
This commit is contained in:
parent
bea57c6c35
commit
455d46f0d9
6 changed files with 284 additions and 51 deletions
|
@ -155,6 +155,9 @@ class bsdTableDB :
|
|||
if truncate:
|
||||
myflags |= DB_TRUNCATE
|
||||
self.db = DB(self.env)
|
||||
# this code relies on DBCursor.set* methods to raise exceptions
|
||||
# rather than returning None
|
||||
self.db.set_get_returns_none(1)
|
||||
# allow duplicate entries [warning: be careful w/ metadata]
|
||||
self.db.set_flags(DB_DUP)
|
||||
self.db.open(filename, DB_BTREE, dbflags | myflags, mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue