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
|
@ -685,24 +685,22 @@ pycore_init_import_warnings(PyThreadState *tstate, PyObject *sysmod)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp);
|
/* Initialize _warnings. */
|
||||||
if (_Py_IsMainInterpreter(tstate)) {
|
status = _PyWarnings_InitState(tstate);
|
||||||
/* Initialize _warnings. */
|
if (_PyStatus_EXCEPTION(status)) {
|
||||||
status = _PyWarnings_InitState(tstate);
|
return status;
|
||||||
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);
|
status = _PyConfig_WritePathConfig(config);
|
||||||
if (_PyStatus_EXCEPTION(status)) {
|
if (_PyStatus_EXCEPTION(status)) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* This call sets up builtin and frozen import support */
|
/* This call sets up builtin and frozen import support */
|
||||||
if (config->_install_importlib) {
|
|
||||||
status = init_importlib(tstate, sysmod);
|
status = init_importlib(tstate, sysmod);
|
||||||
if (_PyStatus_EXCEPTION(status)) {
|
if (_PyStatus_EXCEPTION(status)) {
|
||||||
return status;
|
return status;
|
||||||
|
|
Loading…
Reference in New Issue