diff options
author | Barry Warsaw <barry@python.org> | 2003-01-28 17:20:44 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2003-01-28 17:20:44 (GMT) |
commit | f71de3e9a017d698be8ee4db3e2ec5fbc68bfc8c (patch) | |
tree | b31170225a2c763246014d72e4d5db8b31fc5354 /Lib/bsddb/dbutils.py | |
parent | a6ae9a2128a85301ded9381c181539720ce82ca0 (diff) | |
download | cpython-f71de3e9a017d698be8ee4db3e2ec5fbc68bfc8c.zip cpython-f71de3e9a017d698be8ee4db3e2ec5fbc68bfc8c.tar.gz cpython-f71de3e9a017d698be8ee4db3e2ec5fbc68bfc8c.tar.bz2 |
Everything worked in both the distutils distro and in Python 2.3cvs,
so merge from the bsddb-bsddb3-schizo-branch back to the trunk.
Diffstat (limited to 'Lib/bsddb/dbutils.py')
-rw-r--r-- | Lib/bsddb/dbutils.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/bsddb/dbutils.py b/Lib/bsddb/dbutils.py index 7328ca7..3568b44 100644 --- a/Lib/bsddb/dbutils.py +++ b/Lib/bsddb/dbutils.py @@ -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) |