mirror of https://github.com/python/cpython
Fix refcounting bug reported by Amaury Forgeot d'Arc.
This commit is contained in:
parent
42dae6a89b
commit
6b18a5bb32
|
@ -2311,6 +2311,7 @@ object_richcompare(PyObject *self, PyObject *other, int op)
|
|||
|
||||
case Py_EQ:
|
||||
res = (self == other) ? Py_True : Py_False;
|
||||
Py_INCREF(res);
|
||||
break;
|
||||
|
||||
case Py_NE:
|
||||
|
@ -2334,10 +2335,10 @@ object_richcompare(PyObject *self, PyObject *other, int op)
|
|||
|
||||
default:
|
||||
res = Py_NotImplemented;
|
||||
Py_INCREF(res);
|
||||
break;
|
||||
}
|
||||
|
||||
Py_INCREF(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue