diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-03-25 22:19:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-25 22:19:57 (GMT) |
commit | 1075d1684ab84dc7c28d93cfb46e95e70d3b6d3b (patch) | |
tree | 7a0543a13a28f88318d16f8900111ea10198a4a3 /Lib/test/pythoninfo.py | |
parent | 91759d98015e1d6d5e1367cff60592ab548e7806 (diff) | |
download | cpython-1075d1684ab84dc7c28d93cfb46e95e70d3b6d3b.zip cpython-1075d1684ab84dc7c28d93cfb46e95e70d3b6d3b.tar.gz cpython-1075d1684ab84dc7c28d93cfb46e95e70d3b6d3b.tar.bz2 |
bpo-36301: Add _Py_GetConfigsAsDict() function (GH-12540)
* Add _Py_GetConfigsAsDict() function to get all configurations as a
dict.
* dump_config() of _testembed.c now dumps preconfig as a separated
key: call _Py_GetConfigsAsDict().
* Make _PyMainInterpreterConfig_AsDict() private.
Diffstat (limited to 'Lib/test/pythoninfo.py')
-rw-r--r-- | Lib/test/pythoninfo.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 07f3cb3..79f7e82 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -598,18 +598,15 @@ def collect_get_config(info_add): # Dump global configuration variables, _PyCoreConfig # and _PyMainInterpreterConfig try: - from _testcapi import get_global_config, get_core_config, get_main_config + from _testcapi import get_configs except ImportError: return - for prefix, get_config_func in ( - ('global_config', get_global_config), - ('core_config', get_core_config), - ('main_config', get_main_config), - ): - config = get_config_func() + all_configs = get_configs() + for config_type in sorted(all_configs): + config = all_configs[config_type] for key in sorted(config): - info_add('%s[%s]' % (prefix, key), repr(config[key])) + info_add('%s[%s]' % (config_type, key), repr(config[key])) def collect_subprocess(info_add): |