mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
bpo-36763: Add _PyPreConfig._config_init (GH-13481)
* _PyPreConfig_GetGlobalConfig() and _PyCoreConfig_GetGlobalConfig() now do nothing if the configuration was not initialized with _PyPreConfig_InitCompatConfig() and _PyCoreConfig_InitCompatConfig() * Remove utf8_mode=-2 special case: use utf8_mode=-1 instead. * Fix _PyPreConfig_InitPythonConfig(): * isolated = 0 instead of -1 * use_environment = 1 instead of -1 * Rename _PyConfig_INIT to _PyConfig_INIT_COMPAT * Rename _PyPreConfig_Init() to _PyPreConfig_InitCompatConfig() * Rename _PyCoreConfig_Init() to _PyCoreConfig_InitCompatConfig() * PyInterpreterState_New() now uses _PyCoreConfig_InitPythonConfig() as default configuration, but it's very quickly overriden anyway. * _freeze_importlib.c uses _PyCoreConfig_SetString() to set program_name. * Cleanup preconfig_init_utf8_mode(): cmdline is always non-NULL.
This commit is contained in:
parent
e4d300e07c
commit
022be02dcf
11 changed files with 200 additions and 108 deletions
|
@ -867,7 +867,7 @@ _Py_InitializeCore(_PyRuntimeState *runtime,
|
|||
}
|
||||
|
||||
_PyCoreConfig local_config;
|
||||
_PyCoreConfig_Init(&local_config);
|
||||
_PyCoreConfig_InitCompatConfig(&local_config);
|
||||
err = pyinit_coreconfig(runtime, &local_config, src_config, args, interp_p);
|
||||
_PyCoreConfig_Clear(&local_config);
|
||||
return err;
|
||||
|
@ -1096,7 +1096,7 @@ Py_InitializeEx(int install_sigs)
|
|||
}
|
||||
|
||||
_PyCoreConfig config;
|
||||
_PyCoreConfig_Init(&config);
|
||||
_PyCoreConfig_InitCompatConfig(&config);
|
||||
config.install_signal_handlers = install_sigs;
|
||||
|
||||
err = _Py_InitializeFromConfig(&config);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue