mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Everything worked in both the distutils distro and in Python 2.3cvs,
so merge from the bsddb-bsddb3-schizo-branch back to the trunk.
This commit is contained in:
parent
a6ae9a2128
commit
f71de3e9a0
18 changed files with 213 additions and 119 deletions
|
|
@ -26,7 +26,12 @@
|
|||
#
|
||||
from time import sleep as _sleep
|
||||
|
||||
from bsddb import _db
|
||||
try:
|
||||
# For Python 2.3
|
||||
from bsddb import db
|
||||
except ImportError:
|
||||
# For earlier Pythons w/distutils pybsddb
|
||||
from bsddb3 import db
|
||||
|
||||
# always sleep at least N seconds between retrys
|
||||
_deadlock_MinSleepTime = 1.0/64
|
||||
|
|
@ -60,7 +65,7 @@ def DeadlockWrap(function, *_args, **_kwargs):
|
|||
while 1:
|
||||
try:
|
||||
return function(*_args, **_kwargs)
|
||||
except _db.DBLockDeadlockError:
|
||||
except db.DBLockDeadlockError:
|
||||
if _deadlock_VerboseFile:
|
||||
_deadlock_VerboseFile.write(
|
||||
'dbutils.DeadlockWrap: sleeping %1.3f\n' % sleeptime)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue