mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +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
|
|
@ -1991,8 +1991,9 @@ PyStatus
|
|||
_PyFloat_InitTypes(PyInterpreterState *interp)
|
||||
{
|
||||
/* Init float info */
|
||||
if (_PyStructSequence_InitBuiltin(&FloatInfoType,
|
||||
&floatinfo_desc) < 0) {
|
||||
if (_PyStructSequence_InitBuiltin(interp, &FloatInfoType,
|
||||
&floatinfo_desc) < 0)
|
||||
{
|
||||
return _PyStatus_ERR("can't init float info type");
|
||||
}
|
||||
|
||||
|
|
@ -2028,9 +2029,7 @@ _PyFloat_Fini(PyInterpreterState *interp)
|
|||
void
|
||||
_PyFloat_FiniType(PyInterpreterState *interp)
|
||||
{
|
||||
if (_Py_IsMainInterpreter(interp)) {
|
||||
_PyStructSequence_FiniBuiltin(&FloatInfoType);
|
||||
}
|
||||
_PyStructSequence_FiniBuiltin(interp, &FloatInfoType);
|
||||
}
|
||||
|
||||
/* Print summary info about the state of the optimized allocator */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue