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:
|
case Py_EQ:
|
||||||
res = (self == other) ? Py_True : Py_False;
|
res = (self == other) ? Py_True : Py_False;
|
||||||
|
Py_INCREF(res);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Py_NE:
|
case Py_NE:
|
||||||
|
@ -2334,10 +2335,10 @@ object_richcompare(PyObject *self, PyObject *other, int op)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
res = Py_NotImplemented;
|
res = Py_NotImplemented;
|
||||||
|
Py_INCREF(res);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_INCREF(res);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue