mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +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
|
@ -137,7 +137,8 @@ PyThread_GetInfo(void)
|
|||
int len;
|
||||
#endif
|
||||
|
||||
if (_PyStructSequence_InitBuiltin(&ThreadInfoType, &threadinfo_desc) < 0) {
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
if (_PyStructSequence_InitBuiltin(interp, &ThreadInfoType, &threadinfo_desc) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -191,9 +192,5 @@ PyThread_GetInfo(void)
|
|||
void
|
||||
_PyThread_FiniType(PyInterpreterState *interp)
|
||||
{
|
||||
if (!_Py_IsMainInterpreter(interp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_PyStructSequence_FiniBuiltin(&ThreadInfoType);
|
||||
_PyStructSequence_FiniBuiltin(interp, &ThreadInfoType);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue