Commit 08c5aca9 authored by Marcel Plch's avatar Marcel Plch Committed by Petr Viktorin

bpo-32374: Ignore Python-level exceptions in test_bad_traverse (GH-7145)

parent 97b523db
......@@ -275,13 +275,19 @@ 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'
with support.SuppressCrashReport():
m = spec.loader.create_module(spec)"""
try:
from test import support
import importlib.util as util
spec = util.find_spec('_testmultiphase')
spec.name = '_testmultiphase_with_bad_traverse'
with support.SuppressCrashReport():
m = spec.loader.create_module(spec)
except:
# Prevent Python-level exceptions from
# ending the process with non-zero status
# (We are testing for a crash in C-code)
pass"""
assert_python_failure("-c", script)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment