From 1a78f9b017f176bcc58b56da38efdac0cea122bf Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 21 Jan 2022 15:46:51 +0100 Subject: [PATCH] bpo-46417: Revert remove_subclass() change remove_subclass() doesn't clear the tp_subclasses dict if the dict becomes empty. --- Objects/typeobject.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 97a9a65c36b0e6..34a9817a3178e5 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -6553,10 +6553,6 @@ remove_subclass(PyTypeObject *base, PyTypeObject *type) PyErr_Clear(); } Py_XDECREF(key); - - if (PyDict_Size(dict) == 0) { - Py_CLEAR(base->tp_subclasses); - } } static void