diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 5a7617cd9f9..8c91ad2ad8a 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -3720,6 +3720,7 @@ class CMiscIOTest(MiscIOTest): import sys import time import threading + from test.support import SuppressCrashReport file = sys.{stream_name} @@ -3728,6 +3729,10 @@ class CMiscIOTest(MiscIOTest): 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()