mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
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
This commit is contained in:
parent
f966e5397e
commit
00b137c72f
6 changed files with 215 additions and 67 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue