mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
bpo-34567: pythoninfo gets coreconfig (GH-9043)
* Add _testcapi.get_coreconfig() to get the _PyCoreConfig of the interpreter * test.pythoninfo now gets the core configuration using _testcapi.get_coreconfig()
This commit is contained in:
parent
8ea09110d4
commit
2094c2bea4
4 changed files with 174 additions and 3 deletions
|
@ -534,6 +534,17 @@ def collect_gdbm(info_add):
|
|||
info_add('gdbm.GDBM_VERSION', '.'.join(map(str, _GDBM_VERSION)))
|
||||
|
||||
|
||||
def collect_get_coreconfig(info_add):
|
||||
try:
|
||||
from _testcapi import get_coreconfig
|
||||
except ImportError:
|
||||
return
|
||||
|
||||
config = get_coreconfig()
|
||||
for key in sorted(config):
|
||||
info_add('coreconfig[%s]' % key, repr(config[key]))
|
||||
|
||||
|
||||
def collect_info(info):
|
||||
error = False
|
||||
info_add = info.add
|
||||
|
@ -562,6 +573,7 @@ def collect_info(info):
|
|||
collect_resource,
|
||||
collect_cc,
|
||||
collect_gdbm,
|
||||
collect_get_coreconfig,
|
||||
|
||||
# Collecting from tests should be last as they have side effects.
|
||||
collect_test_socket,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue