]> granicus.if.org Git - python/commitdiff
Issue #26456: Force all child threads to terminate in TestForkInThread
authorMartin Panter <vadmium+py@gmail.com>
Tue, 8 Mar 2016 07:07:28 +0000 (07:07 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Tue, 8 Mar 2016 07:07:28 +0000 (07:07 +0000)
Lib/test/test_thread.py

index b056039b8cfb6cdb02a2893c167a6633b3efddf5..b46613876137b3b70b7a5218bce4a41c030b0aca 100644 (file)
@@ -233,7 +233,12 @@ class TestForkInThread(unittest.TestCase):
             if pid == 0: # child
                 os.close(self.read_fd)
                 os.write(self.write_fd, "OK")
-                sys.exit(0)
+                # Exiting the thread normally in the child process can leave
+                # any additional threads (such as the one started by
+                # importing _tkinter) still running, and this can prevent
+                # the half-zombie child process from being cleaned up. See
+                # Issue #26456.
+                os._exit(0)
             else: # parent
                 os.close(self.write_fd)