Skip to content

Commit 8427579

Browse files
committed
Fix incorrect incref
1 parent 2fd33a3 commit 8427579

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Objects/weakrefobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ weakref_repr(PyWeakReference *self)
166166
if (PyWeakref_GET_OBJECT(self) == Py_None)
167167
return PyUnicode_FromFormat("<weakref at %p; dead>", self);
168168

169-
PyObect* obj = PyWeakref_GET_OBJECT(self);
169+
PyObject* obj = PyWeakref_GET_OBJECT(self);
170170
Py_INCREF(obj);
171171
if (_PyObject_LookupAttrId(obj, &PyId___name__, &name) < 0) {
172172
Py_DECREF(obj);
@@ -217,10 +217,10 @@ weakref_richcompare(PyWeakReference* self, PyWeakReference* other, int op)
217217
PyObject* obj = PyWeakref_GET_OBJECT(self);
218218
PyObject* other_obj = PyWeakref_GET_OBJECT(other);
219219
Py_INCREF(obj);
220-
Py_INCREF(other);
220+
Py_INCREF(other_obj);
221221
PyObject* res = PyObject_RichCompare(obj, other_obj, op);
222222
Py_DECREF(obj);
223-
Py_DECREF(other);
223+
Py_DECREF(other_obj);
224224
return res;
225225
}
226226

0 commit comments

Comments
 (0)