Skip to content

Commit 8a7eb8b

Browse files
authored
gh-145500: Delete _PyType_GetMRO (gh-145501)
1 parent 6cdbd7b commit 8a7eb8b

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

Include/internal/pycore_typeobject.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ PyAPI_FUNC(PyObject *) _PyType_LookupSubclasses(PyTypeObject *);
9696
PyAPI_FUNC(PyObject *) _PyType_InitSubclasses(PyTypeObject *);
9797

9898
extern PyObject * _PyType_GetBases(PyTypeObject *type);
99-
extern PyObject * _PyType_GetMRO(PyTypeObject *type);
10099
extern PyObject* _PyType_GetSubclasses(PyTypeObject *);
101100
extern int _PyType_HasSubclasses(PyTypeObject *);
102101

Objects/typeobject.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -651,28 +651,6 @@ lookup_tp_mro(PyTypeObject *self)
651651
return self->tp_mro;
652652
}
653653

654-
PyObject *
655-
_PyType_GetMRO(PyTypeObject *self)
656-
{
657-
#ifdef Py_GIL_DISABLED
658-
PyObject *mro = _Py_atomic_load_ptr_relaxed(&self->tp_mro);
659-
if (mro == NULL) {
660-
return NULL;
661-
}
662-
if (_Py_TryIncrefCompare(&self->tp_mro, mro)) {
663-
return mro;
664-
}
665-
666-
BEGIN_TYPE_LOCK();
667-
mro = lookup_tp_mro(self);
668-
Py_XINCREF(mro);
669-
END_TYPE_LOCK();
670-
return mro;
671-
#else
672-
return Py_XNewRef(lookup_tp_mro(self));
673-
#endif
674-
}
675-
676654
static inline void
677655
set_tp_mro(PyTypeObject *self, PyObject *mro, int initial)
678656
{

0 commit comments

Comments
 (0)