From: Victor Stinner Date: Fri, 21 Jan 2022 15:45:14 +0000 (+0100) Subject: bpo-46417: Revert remove_subclass() change (GH-30750) X-Git-Tag: v3.11.0a5~179 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fda88864980ffce57add0ea03fb9cbda2798975e;p=thirdparty%2FPython%2Fcpython.git bpo-46417: Revert remove_subclass() change (GH-30750) remove_subclass() doesn't clear the tp_subclasses dict if the dict becomes empty. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 97a9a65c36b0..34a9817a3178 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