]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46417: Revert remove_subclass() change (GH-30750) 30753/head
authorVictor Stinner <vstinner@python.org>
Fri, 21 Jan 2022 15:45:14 +0000 (16:45 +0100)
committerGitHub <noreply@github.com>
Fri, 21 Jan 2022 15:45:14 +0000 (16:45 +0100)
remove_subclass() doesn't clear the tp_subclasses dict if the dict
becomes empty.

Objects/typeobject.c

index 97a9a65c36b0e6078e7413b9a1411c3947294007..34a9817a3178e5603ff07b85bb25e68d8d1c34d2 100644 (file)
@@ -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