cpython: ff36b8cadfd6 (original) (raw)

--- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -417,6 +417,13 @@ class ThreadTests(BaseTestCase): class ThreadJoinOnShutdown(BaseTestCase):

+ def _run_and_join(self, script): script = """if 1: import sys, os, time, threading @@ -448,11 +455,10 @@ class ThreadJoinOnShutdown(BaseTestCase) self._run_and_join(script)

@@ -466,19 +472,11 @@ class ThreadJoinOnShutdown(BaseTestCase) """ self._run_and_join(script)

@@ -507,15 +505,11 @@ class ThreadJoinOnShutdown(BaseTestCase) self.assertEqual(data, expected_output) @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")

- # The script takes the following steps: # - The main thread in the parent process starts a new thread and then # tries to join it. @@ -584,6 +578,7 @@ class ThreadJoinOnShutdown(BaseTestCase) self.assertScriptHasOutput(script, "end of main\n") @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")

@@ -596,10 +591,6 @@ class ThreadJoinOnShutdown(BaseTestCase) # lock will be acquired, we can't know if the internal mutex will be # acquired at the time of the fork.