Fix a conversion mistake that caused test_queue to fail intermittently.
This commit is contained in:
parent
ee29c3f2a8
commit
cafb710711
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue