summaryrefslogtreecommitdiffstats
path: root/Lib/test/pythoninfo.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-09-03 15:06:39 (GMT)
committerGitHub <noreply@github.com>2018-09-03 15:06:39 (GMT)
commit2094c2bea4f79c31819994d8f0afa97ccc52cca8 (patch)
treee1b9c2d270d939108bbdb44e059ec33b7359e4a2 /Lib/test/pythoninfo.py
parent8ea09110d413829f71d979d8c7073008cb87fb03 (diff)
downloadcpython-2094c2bea4f79c31819994d8f0afa97ccc52cca8.zip
cpython-2094c2bea4f79c31819994d8f0afa97ccc52cca8.tar.gz
cpython-2094c2bea4f79c31819994d8f0afa97ccc52cca8.tar.bz2
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()
Diffstat (limited to 'Lib/test/pythoninfo.py')
-rw-r--r--Lib/test/pythoninfo.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index f058185..21763d5 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -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,