mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-46417: Clear Unicode static types at exit (GH-30806)
Add _PyUnicode_FiniTypes() function, called by finalize_interp_types(). It clears these static types: * EncodingMapType * PyFieldNameIter_Type * PyFormatterIter_Type _PyStaticType_Dealloc() now does nothing if tp_subclasses is not NULL.
This commit is contained in:
parent
621a45ccac
commit
1626bf4ac7
6 changed files with 25 additions and 22 deletions
|
@ -3545,12 +3545,6 @@ _PyExc_FiniTypes(PyInterpreterState *interp)
|
|||
|
||||
for (Py_ssize_t i=Py_ARRAY_LENGTH(static_exceptions) - 1; i >= 0; i--) {
|
||||
PyTypeObject *exc = static_exceptions[i].exc;
|
||||
|
||||
// Cannot delete a type if it still has subclasses
|
||||
if (exc->tp_subclasses != NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
_PyStaticType_Dealloc(exc);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue