bpo-33629: Prevent coredump in test_importlib (GH-7090) · python/cpython@483000e (original) (raw)

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -275,10 +275,13 @@ def test_bad_traverse(self):
275 275 (Multiphase initialization modules only)
276 276 '''
277 277 script = """if True:
278 + from test import support
278 279 import importlib.util as util
279 280 spec = util.find_spec('_testmultiphase')
280 281 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)"""
282 285 assert_python_failure("-c", script)
283 286
284 287