summaryrefslogtreecommitdiffstats
path: root/Lib/test/pythoninfo.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-13 18:59:26 (GMT)
committerGitHub <noreply@github.com>2018-11-13 18:59:26 (GMT)
commit00b137c72f90fbc39a6cd7e48b37c58d19977180 (patch)
tree445883d4e7861725c81f7d067b1d0aea17dd0698 /Lib/test/pythoninfo.py
parentf966e5397ed8f5c42c185223fc9b4d750a678d02 (diff)
downloadcpython-00b137c72f90fbc39a6cd7e48b37c58d19977180.zip
cpython-00b137c72f90fbc39a6cd7e48b37c58d19977180.tar.gz
cpython-00b137c72f90fbc39a6cd7e48b37c58d19977180.tar.bz2
bpo-35233: Fix _PyMainInterpreterConfig_Copy() (GH-10519)
* Fix _PyMainInterpreterConfig_Copy(): copy 'install_signal_handlers' attribute * Add _PyMainInterpreterConfig_AsDict() * Add unit tests on the main interpreter configuration to test_embed.InitConfigTests * test.pythoninfo: log also main_config
Diffstat (limited to 'Lib/test/pythoninfo.py')
-rw-r--r--Lib/test/pythoninfo.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 21763d5..2b5d6e2 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -534,15 +534,25 @@ def collect_gdbm(info_add):
info_add('gdbm.GDBM_VERSION', '.'.join(map(str, _GDBM_VERSION)))
-def collect_get_coreconfig(info_add):
+def collect_get_config(info_add):
+ # Dump _PyCoreConfig and _PyMainInterpreterConfig
try:
from _testcapi import get_coreconfig
except ImportError:
- return
+ pass
+ else:
+ config = get_coreconfig()
+ for key in sorted(config):
+ info_add('core_config[%s]' % key, repr(config[key]))
- config = get_coreconfig()
- for key in sorted(config):
- info_add('coreconfig[%s]' % key, repr(config[key]))
+ try:
+ from _testcapi import get_mainconfig
+ except ImportError:
+ pass
+ else:
+ config = get_mainconfig()
+ for key in sorted(config):
+ info_add('main_config[%s]' % key, repr(config[key]))
def collect_info(info):
@@ -573,7 +583,7 @@ def collect_info(info):
collect_resource,
collect_cc,
collect_gdbm,
- collect_get_coreconfig,
+ collect_get_config,
# Collecting from tests should be last as they have side effects.
collect_test_socket,