mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Fix refcounting bug reported by Amaury Forgeot d'Arc.
This commit is contained in:
parent
42dae6a89b
commit
6b18a5bb32
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue