From 483000e164ec68717d335767b223ae31b4b720cf Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 24 May 2018 22:19:33 +0200 Subject: [PATCH] bpo-33629: Prevent coredump in test_importlib (GH-7090) bpo-32374, bpo-33629: Use support.SuppressCrashReport() in test_bad_traverse() of MultiPhaseExtensionModuleTests to prevent leaking a core dump file. --- Lib/test/test_importlib/extension/test_loader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_importlib/extension/test_loader.py b/Lib/test/test_importlib/extension/test_loader.py index 53ac3c71d4..57ba7083d3 100644 --- a/Lib/test/test_importlib/extension/test_loader.py +++ b/Lib/test/test_importlib/extension/test_loader.py @@ -275,10 +275,13 @@ class MultiPhaseExtensionModuleTests(abc.LoaderTests): (Multiphase initialization modules only) ''' script = """if True: + from test import support import importlib.util as util spec = util.find_spec('_testmultiphase') spec.name = '_testmultiphase_with_bad_traverse' - m = spec.loader.create_module(spec)""" + + with support.SuppressCrashReport(): + m = spec.loader.create_module(spec)""" assert_python_failure("-c", script) -- 2.40.0