summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_queue.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-02-02 23:59:21 (GMT)
committerGeorg Brandl <georg@python.org>2008-02-02 23:59:21 (GMT)
commitcafb71071183406601a30d16ac5a287cdd2b9c39 (patch)
treed733cfd0d6f2c010d7465cdb8a3d8f64cc88db31 /Lib/test/test_queue.py
parentee29c3f2a8ca40df013cc115fb54e017c51feef7 (diff)
downloadcpython-cafb71071183406601a30d16ac5a287cdd2b9c39.zip
cpython-cafb71071183406601a30d16ac5a287cdd2b9c39.tar.gz
cpython-cafb71071183406601a30d16ac5a287cdd2b9c39.tar.bz2
Fix a conversion mistake that caused test_queue to fail intermittently.
Diffstat (limited to 'Lib/test/test_queue.py')
-rw-r--r--Lib/test/test_queue.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py
index 7db10c8..00348a8 100644
--- a/Lib/test/test_queue.py
+++ b/Lib/test/test_queue.py
@@ -138,13 +138,13 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
def worker(self, q):
while True:
- self.x = q.get()
- if self.x is None:
+ x = q.get()
+ if x is None:
q.task_done()
return
self.cumlock.acquire()
try:
- self.cum += self.x
+ self.cum += x
finally:
self.cumlock.release()
q.task_done()
@@ -157,7 +157,7 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
q.put(i)
q.join()
self.assertEquals(self.cum, sum(range(100)),
- "q.join() did not block until all tasks were done")
+ "q.join() did not block until all tasks were done")
for i in (0,1):
q.put(None) # instruct the threads to close
q.join() # verify that you can join twice