bpo-36301: Cleanup preconfig code (GH-12535)

Prepare code to move some _PyPreConfig parameters into _PyPreCmdline.
Changes:

* _PyCoreConfig_ReadFromArgv(): remove preconfig parameter,
  use _PyRuntime.preconfig.
* Add _PyPreCmdline_GetPreConfig() (called by _PyPreConfig_Read()).
* Rename _PyPreCmdline_Init() to _PyPreCmdline_SetArgv()
* Factorize _Py_PreInitializeFromPreConfig() code: add
  pyinit_preinit().
* _PyPreConfig_Read() now sets coerce_c_locale to 2 if it must be
  coerced.
* Remove _PyCoreConfig_ReadPreConfig().
* _PyCoreConfig_Write() now copies updated preconfig into _PyRuntime.
This commit is contained in:
Victor Stinner 2019-03-25 17:54:58 +01:00 committed by GitHub
parent 68d228f174
commit f72346c475
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 153 additions and 188 deletions

View file

@ -394,7 +394,7 @@ pathconfig_global_init(void)
_PyInitError err;
_PyCoreConfig config = _PyCoreConfig_INIT;
err = _PyCoreConfig_Read(&config, NULL);
err = _PyCoreConfig_Read(&config);
if (_Py_INIT_FAILED(err)) {
goto error;
}