Skip to content

Commit b1e32ff

Browse files
gh-159580: use _Py_INCREF_TYPE in object.__class__ (#160424)
1 parent ed797ba commit b1e32ff

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎Objects/typeobject.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7472,7 +7472,9 @@ _Py_BaseObject_RichCompare(PyObject* self, PyObject* other, int op)
74727472
static PyObject *
74737473
object_get_class(PyObject *self, void *closure)
74747474
{
7475-
return Py_NewRef(Py_TYPE(self));
7475+
PyTypeObject *type = Py_TYPE(self);
7476+
_Py_INCREF_TYPE(type);
7477+
return (PyObject *)type;
74767478
}
74777479

74787480
static int

0 commit comments

Comments
 (0)