diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 5a7617cd9f9cbf..8c91ad2ad8aa1c 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -3720,6 +3720,7 @@ def check_daemon_threads_shutdown_deadlock(self, stream_name): import sys import time import threading + from test.support import SuppressCrashReport file = sys.{stream_name} @@ -3728,6 +3729,10 @@ def run(): file.write('.') file.flush() + crash = SuppressCrashReport() + crash.__enter__() + # don't call __exit__(): the crash occurs at Python shutdown + thread = threading.Thread(target=run) thread.daemon = True thread.start()