[Python-checkins] bpo-46417: Revert remove_subclass() change (GH-30750)

vstinner webhook-mailer at python.org
Fri Jan 21 10:45:19 EST 2022


https://github.com/python/cpython/commit/fda88864980ffce57add0ea03fb9cbda2798975e
commit: fda88864980ffce57add0ea03fb9cbda2798975e
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2022-01-21T16:45:14+01:00
summary:

bpo-46417: Revert remove_subclass() change (GH-30750)

remove_subclass() doesn't clear the tp_subclasses dict if the dict
becomes empty.

files:
M Objects/typeobject.c

diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 97a9a65c36b0e..34a9817a3178e 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



More information about the Python-checkins mailing list