mirror of
https://github.com/python/cpython.git
synced 2025-09-02 23:18:25 +00:00
Call _PyWarnings_InitState() in subinterpreters (GH-21078)
Py_InitializeFromConfig() now calls also _PyWarnings_InitState() in subinterpreters.
This commit is contained in:
parent
61b6492961
commit
30a89338eb
1 changed files with 9 additions and 11 deletions
|
@ -685,24 +685,22 @@ pycore_init_import_warnings(PyThreadState *tstate, PyObject *sysmod)
|
|||
return status;
|
||||
}
|
||||
|
||||
const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp);
|
||||
if (_Py_IsMainInterpreter(tstate)) {
|
||||
/* Initialize _warnings. */
|
||||
status = _PyWarnings_InitState(tstate);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
/* Initialize _warnings. */
|
||||
status = _PyWarnings_InitState(tstate);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
if (config->_install_importlib) {
|
||||
const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp);
|
||||
if (config->_install_importlib) {
|
||||
if (_Py_IsMainInterpreter(tstate)) {
|
||||
status = _PyConfig_WritePathConfig(config);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* This call sets up builtin and frozen import support */
|
||||
if (config->_install_importlib) {
|
||||
/* This call sets up builtin and frozen import support */
|
||||
status = init_importlib(tstate, sysmod);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue