summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
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 /Modules/_testcapimodule.c
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 'Modules/_testcapimodule.c')
-rw-r--r--Modules/_testcapimodule.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index bc1f630..205b668 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -4702,6 +4702,15 @@ get_coreconfig(PyObject *self, PyObject *Py_UNUSED(args))
}
+static PyObject *
+get_mainconfig(PyObject *self, PyObject *Py_UNUSED(args))
+{
+ PyInterpreterState *interp = _PyInterpreterState_Get();
+ const _PyMainInterpreterConfig *config = &interp->config;
+ return _PyMainInterpreterConfig_AsDict(config);
+}
+
+
#ifdef Py_REF_DEBUG
static PyObject *
negative_refcount(PyObject *self, PyObject *Py_UNUSED(args))
@@ -4948,6 +4957,7 @@ static PyMethodDef TestMethods[] = {
{"EncodeLocaleEx", encode_locale_ex, METH_VARARGS},
{"DecodeLocaleEx", decode_locale_ex, METH_VARARGS},
{"get_coreconfig", get_coreconfig, METH_NOARGS},
+ {"get_mainconfig", get_mainconfig, METH_NOARGS},
#ifdef Py_REF_DEBUG
{"negative_refcount", negative_refcount, METH_NOARGS},
#endif