diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 46c7833b5c38ed..69487a1b50dc3b 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -3732,6 +3732,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} @@ -3740,6 +3741,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()