mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
bpo-36710: Add runtime variable to Py_InitializeEx() (GH-12939)
Py_InitializeEx() now uses a runtime variable passed to subfunctions, rather than working directly on the global variable _PyRuntime. Add 'runtime' parameter to _PyCoreConfig_Write(), _PySys_Create(), _PySys_InitMain(), _PyGILState_Init(), emit_stderr_warning_for_legacy_locale() and other subfunctions.
This commit is contained in:
parent
8e91c246e4
commit
43125224d6
6 changed files with 104 additions and 71 deletions
|
@ -1605,13 +1605,13 @@ config_init_stdio(const _PyCoreConfig *config)
|
|||
- set Py_xxx global configuration variables
|
||||
- initialize C standard streams (stdin, stdout, stderr) */
|
||||
void
|
||||
_PyCoreConfig_Write(const _PyCoreConfig *config)
|
||||
_PyCoreConfig_Write(const _PyCoreConfig *config, _PyRuntimeState *runtime)
|
||||
{
|
||||
_PyCoreConfig_SetGlobalConfig(config);
|
||||
config_init_stdio(config);
|
||||
|
||||
/* Write the new pre-configuration into _PyRuntime */
|
||||
_PyPreConfig *preconfig = &_PyRuntime.preconfig;
|
||||
_PyPreConfig *preconfig = &runtime->preconfig;
|
||||
preconfig->isolated = config->isolated;
|
||||
preconfig->use_environment = config->use_environment;
|
||||
preconfig->dev_mode = config->dev_mode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue