Skip to content

Commit

Permalink
bpo-33629: Prevent coredump in test_importlib (GH-7090)
Browse files Browse the repository at this point in the history
bpo-32374, bpo-33629: Use support.SuppressCrashReport() in
test_bad_traverse() of MultiPhaseExtensionModuleTests to prevent
leaking a core dump file.
(cherry picked from commit 483000e)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
  • Loading branch information
miss-islington and vstinner committed May 24, 2018
1 parent 2fe940c commit d9eb22c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/test/test_importlib/extension/test_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,13 @@ def test_bad_traverse(self):
(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)


Expand Down

0 comments on commit d9eb22c

Please sign in to comment.