From fda88864980ffce57add0ea03fb9cbda2798975e Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 21 Jan 2022 16:45:14 +0100 Subject: bpo-46417: Revert remove_subclass() change (GH-30750) 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 97a9a65..34a9817 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 -- cgit v0.12