Skip to content

Commit 483000e

Browse files
authored
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.
1 parent 301e3cc commit 483000e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎Lib/test/test_importlib/extension/test_loader.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,13 @@ def test_bad_traverse(self):
275275
(Multiphase initialization modules only)
276276
'''
277277
script = """if True:
278+
from test import support
278279
import importlib.util as util
279280
spec = util.find_spec('_testmultiphase')
280281
spec.name = '_testmultiphase_with_bad_traverse'
281-
m = spec.loader.create_module(spec)"""
282+
283+
with support.SuppressCrashReport():
284+
m = spec.loader.create_module(spec)"""
282285
assert_python_failure("-c", script)
283286

284287

0 commit comments

Comments
 (0)