summaryrefslogtreecommitdiff
path: root/Objects/floatobject.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-05-01 19:36:00 -0600
committerGitHub <noreply@github.com>2023-05-01 19:36:00 -0600
commitfdd878650d325297cd801305bc2d1b0e903e42b4 (patch)
tree9814f09627ef014852dcc3fa462dfec30e5e591d /Objects/floatobject.c
parentb1ca34d4d5e463b8108eea20090f12292390f0cf (diff)
downloadcpython-git-fdd878650d325297cd801305bc2d1b0e903e42b4.tar.gz
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.
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index a694ddcd01..d257857d9c 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -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 */