Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc6e94a

Browse files
committed
Wrap the cursor functions with dbutils.DeadlockWrap to deal with the
expected DBLockDeadLockErrors.
1 parent 5772513 commit bc6e94a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/bsddb/test/test_thread.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,12 @@ def readerThread(self, d, readerNum):
267267
for loop in range(5):
268268
c = d.cursor()
269269
count = 0
270-
rec = c.first()
270+
rec = dbutils.DeadlockWrap(c.first)
271271
while rec:
272272
count += 1
273273
key, data = rec
274274
self.assertEqual(self.makeData(key), data)
275-
rec = c.next()
275+
rec = dbutils.DeadlockWrap(c.next)
276276
if verbose:
277277
print "%s: found %d records" % (name, count)
278278
c.close()

0 commit comments

Comments
 (0)