summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-01-22 21:55:39 (GMT)
committerGitHub <noreply@github.com>2022-01-22 21:55:39 (GMT)
commit1626bf4ac7aef1244e6f886e63a31f7ed65fbd10 (patch)
tree21e80b2b17eaff62c94f0cecd764e7f7ddba6265 /Objects/exceptions.c
parent621a45ccacd121f9ae4d8a539f040410c74b253b (diff)
downloadcpython-1626bf4ac7aef1244e6f886e63a31f7ed65fbd10.zip
cpython-1626bf4ac7aef1244e6f886e63a31f7ed65fbd10.tar.gz
cpython-1626bf4ac7aef1244e6f886e63a31f7ed65fbd10.tar.bz2
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.
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 6bf70e2..065503f 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -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);
}
}