Amaury Forgeot d'Arc  committed ab4f8c4

Prevent test_queue from leaking: one worker thread was not stopped.

The version in trunk/ is correct; the problem with 3.0 is that
None cannot be used as a marker in a PriorityQueue, because it cannot be compared with ints.

  • Participants
  • Parent commits 5a17d15

Comments (0)

Files changed (1)

File Lib/test/

     def worker(self, q):
         while True:
             x = q.get()
-            if x is None:
+            if x < 0:
             with self.cumlock:
         self.assertEquals(self.cum, sum(range(100)),
                           "q.join() did not block until all tasks were done")
-        q.put(None)         # instruct the threads to close
+        for i in (0,1):
+            q.put(-1)         # instruct the threads to close
         q.join()                # verify that you can join twice
     def test_queue_task_done(self):