From 20c8cd997458b0313b2a13c94de0889a4a7f1c80 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Tue, 8 Mar 2016 07:07:28 +0000 Subject: [PATCH] Issue #26456: Force all child threads to terminate in TestForkInThread --- Lib/test/test_thread.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index b056039b8c..b466138761 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -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) -- 2.50.1