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:
Victor Stinner 2018-09-03 17:06:39 +02:00 committed by GitHub
parent 8ea09110d4
commit 2094c2bea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 174 additions and 3 deletions

View file

@ -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,