mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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.
This commit is contained in:
parent
91759d9801
commit
1075d1684a
9 changed files with 179 additions and 134 deletions
|
|
@ -400,8 +400,7 @@ typedef struct {
|
|||
|
||||
/* --- Function used for testing ---------------------------------- */
|
||||
|
||||
PyAPI_FUNC(PyObject *) _Py_GetGlobalVariablesAsDict(void);
|
||||
PyAPI_FUNC(PyObject *) _PyCoreConfig_AsDict(const _PyCoreConfig *config);
|
||||
PyAPI_FUNC(PyObject*) _Py_GetConfigsAsDict(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,9 +33,6 @@ PyAPI_FUNC(void) _PyMainInterpreterConfig_Clear(_PyMainInterpreterConfig *);
|
|||
PyAPI_FUNC(int) _PyMainInterpreterConfig_Copy(
|
||||
_PyMainInterpreterConfig *config,
|
||||
const _PyMainInterpreterConfig *config2);
|
||||
/* Used by _testcapi.get_main_config() */
|
||||
PyAPI_FUNC(PyObject*) _PyMainInterpreterConfig_AsDict(
|
||||
const _PyMainInterpreterConfig *config);
|
||||
|
||||
PyAPI_FUNC(_PyInitError) _Py_InitializeMainInterpreter(
|
||||
PyInterpreterState *interp,
|
||||
|
|
|
|||
|
|
@ -90,8 +90,7 @@ PyAPI_FUNC(void) _Py_get_env_flag(_PyPreConfig *config,
|
|||
PyAPI_FUNC(_PyInitError) _PyPreConfig_Read(_PyPreConfig *config,
|
||||
const _PyArgv *args,
|
||||
const _PyCoreConfig *coreconfig);
|
||||
PyAPI_FUNC(int) _PyPreConfig_AsDict(const _PyPreConfig *config,
|
||||
PyObject *dict);
|
||||
PyAPI_FUNC(PyObject*) _PyPreConfig_AsDict(const _PyPreConfig *config);
|
||||
PyAPI_FUNC(_PyInitError) _PyPreConfig_ReadFromArgv(_PyPreConfig *config,
|
||||
const _PyArgv *args);
|
||||
PyAPI_FUNC(_PyInitError) _PyPreConfig_Write(_PyPreConfig *config);
|
||||
|
|
@ -121,6 +120,11 @@ PyAPI_FUNC(_PyInitError) _PyCoreConfig_ReadFromArgv(_PyCoreConfig *config,
|
|||
const _PyArgv *args);
|
||||
PyAPI_FUNC(_PyInitError) _PyCoreConfig_Write(const _PyCoreConfig *config);
|
||||
|
||||
/* --- _PyMainInterpreterConfig ----------------------------------- */
|
||||
|
||||
PyAPI_FUNC(PyObject*) _PyMainInterpreterConfig_AsDict(
|
||||
const _PyMainInterpreterConfig *config);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue