https://github.com/python/cpython/commit/b1e32ff4f33d93d2b876ff83da3b578e7829c8d4
commit: b1e32ff4f33d93d2b876ff83da3b578e7829c8d4
branch: main
author: Kumar Aditya <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2026-10-23T08:33:57Z
summary:
gh-159580: use _Py_INCREF_TYPE in object.__class__ (#160424)
files:
M Objects/typeobject.c
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 5e772e5608d4c6..87da481f0a5f60 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -7472,7 +7472,9 @@ _Py_BaseObject_RichCompare(PyObject* self, PyObject*
other, int op)
static PyObject *
object_get_class(PyObject *self, void *closure)
{
- return Py_NewRef(Py_TYPE(self));
+ PyTypeObject *type = Py_TYPE(self);
+ _Py_INCREF_TYPE(type);
+ return (PyObject *)type;
}
static int
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]