Commit cafb7107 authored by Georg Brandl's avatar Georg Brandl

Fix a conversion mistake that caused test_queue to fail intermittently.

parent ee29c3f2
...@@ -138,13 +138,13 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin): ...@@ -138,13 +138,13 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
def worker(self, q): def worker(self, q):
while True: while True:
self.x = q.get() x = q.get()
if self.x is None: if x is None:
q.task_done() q.task_done()
return return
self.cumlock.acquire() self.cumlock.acquire()
try: try:
self.cum += self.x self.cum += x
finally: finally:
self.cumlock.release() self.cumlock.release()
q.task_done() q.task_done()
......
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