]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-145500: Delete _PyType_GetMRO (gh-145501)
authorSam Gross <colesbury@gmail.com>
Wed, 4 Mar 2026 18:32:43 +0000 (13:32 -0500)
committerGitHub <noreply@github.com>
Wed, 4 Mar 2026 18:32:43 +0000 (13:32 -0500)
Include/internal/pycore_typeobject.h
Objects/typeobject.c

index 8af317d54c0bda5a6df0b100177aed0cce9c08af..9c8b00550e3980e2212a2f49833f6d7540088625 100644 (file)
@@ -96,7 +96,6 @@ PyAPI_FUNC(PyObject *) _PyType_LookupSubclasses(PyTypeObject *);
 PyAPI_FUNC(PyObject *) _PyType_InitSubclasses(PyTypeObject *);
 
 extern PyObject * _PyType_GetBases(PyTypeObject *type);
-extern PyObject * _PyType_GetMRO(PyTypeObject *type);
 extern PyObject* _PyType_GetSubclasses(PyTypeObject *);
 extern int _PyType_HasSubclasses(PyTypeObject *);
 
index d77d981085f4da26ce8a10c5253841bb867f4d96..c5e94a8668fef26b716190f9dabe1fb33718e032 100644 (file)
@@ -651,28 +651,6 @@ lookup_tp_mro(PyTypeObject *self)
     return self->tp_mro;
 }
 
-PyObject *
-_PyType_GetMRO(PyTypeObject *self)
-{
-#ifdef Py_GIL_DISABLED
-    PyObject *mro = _Py_atomic_load_ptr_relaxed(&self->tp_mro);
-    if (mro == NULL) {
-        return NULL;
-    }
-    if (_Py_TryIncrefCompare(&self->tp_mro, mro)) {
-        return mro;
-    }
-
-    BEGIN_TYPE_LOCK();
-    mro = lookup_tp_mro(self);
-    Py_XINCREF(mro);
-    END_TYPE_LOCK();
-    return mro;
-#else
-    return Py_XNewRef(lookup_tp_mro(self));
-#endif
-}
-
 static inline void
 set_tp_mro(PyTypeObject *self, PyObject *mro, int initial)
 {