diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-09-03 15:06:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-03 15:06:39 (GMT) |
commit | 2094c2bea4f79c31819994d8f0afa97ccc52cca8 (patch) | |
tree | e1b9c2d270d939108bbdb44e059ec33b7359e4a2 /Lib/test | |
parent | 8ea09110d413829f71d979d8c7073008cb87fb03 (diff) | |
download | cpython-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')
-rw-r--r-- | Lib/test/pythoninfo.py | 12 |
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, |