Skip to content

Commit

Permalink
_PyStaticType_Dealloc() -> _PyStaticType_FiniBuiltin()
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently committed May 31, 2024
1 parent 07e3b65 commit 1e3005d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Include/internal/pycore_typeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ _PyType_GetModuleState(PyTypeObject *type)
extern int _PyStaticType_InitBuiltin(PyInterpreterState *, PyTypeObject *type);
extern static_builtin_state * _PyStaticType_GetState(PyInterpreterState *, PyTypeObject *);
extern void _PyStaticType_ClearWeakRefs(PyInterpreterState *, PyTypeObject *type);
extern void _PyStaticType_Dealloc(PyInterpreterState *, PyTypeObject *);
extern void _PyStaticType_FiniBuiltin(PyInterpreterState *, PyTypeObject *);

// Export for 'math' shared extension, used via _PyType_IsReady() static inline
// function
Expand Down
2 changes: 1 addition & 1 deletion Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -3725,7 +3725,7 @@ _PyExc_FiniTypes(PyInterpreterState *interp)
{
for (Py_ssize_t i=Py_ARRAY_LENGTH(static_exceptions) - 1; i >= 0; i--) {
PyTypeObject *exc = static_exceptions[i].exc;
_PyStaticType_Dealloc(interp, exc);
_PyStaticType_FiniBuiltin(interp, exc);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ _PyTypes_FiniTypes(PyInterpreterState *interp)
// their base classes.
for (Py_ssize_t i=Py_ARRAY_LENGTH(static_types)-1; i>=0; i--) {
PyTypeObject *type = static_types[i];
_PyStaticType_Dealloc(interp, type);
_PyStaticType_FiniBuiltin(interp, type);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Objects/structseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ _PyStructSequence_FiniBuiltin(PyInterpreterState *interp, PyTypeObject *type)
return;
}

_PyStaticType_Dealloc(interp, type);
_PyStaticType_FiniBuiltin(interp, type);

if (_Py_IsMainInterpreter(interp)) {
// Undo _PyStructSequence_InitBuiltinWithFlags().
Expand Down
2 changes: 1 addition & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5686,7 +5686,7 @@ clear_static_type_objects(PyInterpreterState *interp, PyTypeObject *type)
}

void
_PyStaticType_Dealloc(PyInterpreterState *interp, PyTypeObject *type)
_PyStaticType_FiniBuiltin(PyInterpreterState *interp, PyTypeObject *type)
{
assert(type->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN);
assert(_Py_IsImmortal((PyObject *)type));
Expand Down
6 changes: 3 additions & 3 deletions Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -15520,9 +15520,9 @@ unicode_is_finalizing(void)
void
_PyUnicode_FiniTypes(PyInterpreterState *interp)
{
_PyStaticType_Dealloc(interp, &EncodingMapType);
_PyStaticType_Dealloc(interp, &PyFieldNameIter_Type);
_PyStaticType_Dealloc(interp, &PyFormatterIter_Type);
_PyStaticType_FiniBuiltin(interp, &EncodingMapType);
_PyStaticType_FiniBuiltin(interp, &PyFieldNameIter_Type);
_PyStaticType_FiniBuiltin(interp, &PyFormatterIter_Type);
}


Expand Down
4 changes: 2 additions & 2 deletions Python/crossinterp_exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ static void
fini_exceptions(PyInterpreterState *interp)
{
// Likewise with _fini_not_shareable_error_type().
_PyStaticType_Dealloc(interp, &_PyExc_InterpreterNotFoundError);
_PyStaticType_Dealloc(interp, &_PyExc_InterpreterError);
_PyStaticType_FiniBuiltin(interp, &_PyExc_InterpreterNotFoundError);
_PyStaticType_FiniBuiltin(interp, &_PyExc_InterpreterError);
}

0 comments on commit 1e3005d

Please sign in to comment.