mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-129033: Remove _PyInterpreterState_SetConfig() function (#129048)
Remove _PyInterpreterState_GetConfigCopy() and _PyInterpreterState_SetConfig() private functions. PEP 741 "Python Configuration C API" added a better public C API: PyConfig_Get() and PyConfig_Set().
This commit is contained in:
parent
573c181502
commit
8ceb6cb117
11 changed files with 22 additions and 500 deletions
|
@ -444,40 +444,6 @@ interpreter_update_config(PyThreadState *tstate, int only_update_path_config)
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
_PyInterpreterState_SetConfig(const PyConfig *src_config)
|
||||
{
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
int res = -1;
|
||||
|
||||
PyConfig config;
|
||||
PyConfig_InitPythonConfig(&config);
|
||||
PyStatus status = _PyConfig_Copy(&config, src_config);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
_PyErr_SetFromPyStatus(status);
|
||||
goto done;
|
||||
}
|
||||
|
||||
status = _PyConfig_Read(&config, 1);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
_PyErr_SetFromPyStatus(status);
|
||||
goto done;
|
||||
}
|
||||
|
||||
status = _PyConfig_Copy(&tstate->interp->config, &config);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
_PyErr_SetFromPyStatus(status);
|
||||
goto done;
|
||||
}
|
||||
|
||||
res = interpreter_update_config(tstate, 0);
|
||||
|
||||
done:
|
||||
PyConfig_Clear(&config);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/* Global initializations. Can be undone by Py_Finalize(). Don't
|
||||
call this twice without an intervening Py_Finalize() call.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue