mirror of https://github.com/python/cpython.git
* Turn the deadlock situation described in SF bug #775414 into a
DBDeadLockError exception. * add the test case for my previous dbtables commit.
This commit is contained in:
parent
ff7d991a07
commit
dda291c079
|
@ -344,6 +344,7 @@ def _openDBEnv(cachesize):
|
||||||
else:
|
else:
|
||||||
raise error, "cachesize must be >= 20480"
|
raise error, "cachesize must be >= 20480"
|
||||||
e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL)
|
e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL)
|
||||||
|
e.set_lk_detect(db.DB_LOCK_DEFAULT)
|
||||||
return e
|
return e
|
||||||
|
|
||||||
def _checkflag(flag, file):
|
def _checkflag(flag, file):
|
||||||
|
|
|
@ -339,6 +339,16 @@ def remove_value(value):
|
||||||
conditions={'Name': dbtables.LikeCond('%')},
|
conditions={'Name': dbtables.LikeCond('%')},
|
||||||
mappings={'Access': increment_access})
|
mappings={'Access': increment_access})
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.tdb.Modify(tabname,
|
||||||
|
conditions={'Name': dbtables.LikeCond('%')},
|
||||||
|
mappings={'Access': 'What is your quest?'})
|
||||||
|
except TypeError:
|
||||||
|
# success, the string value in mappings isn't callable
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
raise RuntimeError, "why was TypeError not raised for bad callable?"
|
||||||
|
|
||||||
# Delete key in select conditions
|
# Delete key in select conditions
|
||||||
values = self.tdb.Select(
|
values = self.tdb.Select(
|
||||||
tabname, None,
|
tabname, None,
|
||||||
|
|
Loading…
Reference in New Issue