]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Kill a small potential leak in test_threading.
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Nov 2009 00:24:12 +0000 (00:24 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Nov 2009 00:24:12 +0000 (00:24 +0000)
The leak may not manifest itself if the OS re-uses the same thread ids
(I suppose Neal's machine doesn't :-))

Lib/test/test_threading.py

index c38eda7aebd02d6cde4d219f479d8978cb0c58f6..4e0a572c853aa4180a370cf572f65dca3a3dfae2 100644 (file)
@@ -111,6 +111,8 @@ class ThreadTests(BaseTestCase):
         thread.start_new_thread(f, ())
         done.wait()
         self.assertFalse(ident[0] is None)
+        # Kill the "immortal" _DummyThread
+        del threading._active[ident[0]]
 
     # run with a small(ish) thread stack size (256kB)
     def test_various_ops_small_stack(self):