mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +00:00
bpo-36763: Add _PyCoreConfig_SetArgv() (GH-13030)
* Add 2 new config methods: * _PyCoreConfig_SetArgv() * _PyCoreConfig_SetWideArgv() * Add also an internal _PyCoreConfig_SetPyArgv() method. * Remove 'args' parameter from _PyCoreConfig_Read().
This commit is contained in:
parent
463b82a3ef
commit
5f38b8407b
5 changed files with 58 additions and 17 deletions
|
@ -801,13 +801,22 @@ pyinit_coreconfig(_PyRuntimeState *runtime,
|
|||
const _PyArgv *args,
|
||||
PyInterpreterState **interp_p)
|
||||
{
|
||||
_PyInitError err;
|
||||
|
||||
if (src_config) {
|
||||
if (_PyCoreConfig_Copy(config, src_config) < 0) {
|
||||
return _Py_INIT_NO_MEMORY();
|
||||
}
|
||||
}
|
||||
|
||||
_PyInitError err = _PyCoreConfig_Read(config, args);
|
||||
if (args) {
|
||||
err = _PyCoreConfig_SetPyArgv(config, args);
|
||||
if (_Py_INIT_FAILED(err)) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
err = _PyCoreConfig_Read(config);
|
||||
if (_Py_INIT_FAILED(err)) {
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue