Kaydet (Commit) 4b7deed9 authored tarafından Brett Cannon's avatar Brett Cannon

Use context manager for a lock.

üst 89dfbe35
......@@ -142,11 +142,8 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
if x is None:
q.task_done()
return
self.cumlock.acquire()
try:
with self.cumlock:
self.cum += x
finally:
self.cumlock.release()
q.task_done()
def queue_join_test(self, q):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment