commit | 4b7deed9a51e34a501f4d9caf1118e16ec2e5e14 | [log] [tgz] |
---|---|---|
author | Brett Cannon <bcannon@gmail.com> | Sun Feb 03 02:43:01 2008 +0000 |
committer | Brett Cannon <bcannon@gmail.com> | Sun Feb 03 02:43:01 2008 +0000 |
tree | ba0eaf3129bf70a3463417cbdde2afd3c5cf4bc1 | |
parent | 89dfbe35af6379a041f52bc97ce1ad5638257098 [diff] |
Use context manager for a lock.
diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py index 00348a8..fdee1fa 100644 --- a/Lib/test/test_queue.py +++ b/Lib/test/test_queue.py
@@ -142,11 +142,8 @@ 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):