mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254)
This commit is contained in:
parent
cad8020cb8
commit
66f77caca3
5 changed files with 65 additions and 26 deletions
|
@ -334,19 +334,19 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
def test_dump_ext_modules(self):
|
||||
code = """
|
||||
import faulthandler
|
||||
# _testcapi is a test module and not considered as a stdlib module
|
||||
import _testcapi
|
||||
faulthandler.enable()
|
||||
faulthandler._sigsegv()
|
||||
"""
|
||||
stderr, exitcode = self.get_output(code)
|
||||
stderr = '\n'.join(stderr)
|
||||
match = re.search('^Extension modules:(.*)$', stderr, re.MULTILINE)
|
||||
match = re.search(r'^Extension modules:(.*) \(total: [0-9]+\)$',
|
||||
stderr, re.MULTILINE)
|
||||
if not match:
|
||||
self.fail(f"Cannot find 'Extension modules:' in {stderr!r}")
|
||||
modules = set(match.group(1).strip().split(', '))
|
||||
# Only check for a few extensions, the list doesn't have to be
|
||||
# exhaustive.
|
||||
for ext in ('sys', 'builtins', '_io', 'faulthandler'):
|
||||
self.assertIn(ext, modules)
|
||||
self.assertIn('_testcapi', modules)
|
||||
|
||||
def test_is_enabled(self):
|
||||
orig_stderr = sys.stderr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue