mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-94673: Properly Initialize and Finalize Static Builtin Types for Each Interpreter (gh-104072)
Until now, we haven't been initializing nor finalizing the per-interpreter state properly.
This commit is contained in:
parent
b1ca34d4d5
commit
fdd878650d
17 changed files with 146 additions and 135 deletions
|
@ -1342,8 +1342,9 @@ static PyStructSequence_Desc UnraisableHookArgs_desc = {
|
|||
PyStatus
|
||||
_PyErr_InitTypes(PyInterpreterState *interp)
|
||||
{
|
||||
if (_PyStructSequence_InitBuiltin(&UnraisableHookArgsType,
|
||||
&UnraisableHookArgs_desc) < 0) {
|
||||
if (_PyStructSequence_InitBuiltin(interp, &UnraisableHookArgsType,
|
||||
&UnraisableHookArgs_desc) < 0)
|
||||
{
|
||||
return _PyStatus_ERR("failed to initialize UnraisableHookArgs type");
|
||||
}
|
||||
return _PyStatus_OK();
|
||||
|
@ -1353,11 +1354,7 @@ _PyErr_InitTypes(PyInterpreterState *interp)
|
|||
void
|
||||
_PyErr_FiniTypes(PyInterpreterState *interp)
|
||||
{
|
||||
if (!_Py_IsMainInterpreter(interp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_PyStructSequence_FiniBuiltin(&UnraisableHookArgsType);
|
||||
_PyStructSequence_FiniBuiltin(interp, &UnraisableHookArgsType);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue