mirror of
https://github.com/python/cpython.git
synced 2026-04-15 08:11:10 +00:00
gh-146199: Fix error handling in code_richcompare when PyObject_RichCompareBool fails (#146200)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
7dc2f52a6f
commit
e017971eb9
3 changed files with 14 additions and 1 deletions
|
|
@ -2607,7 +2607,7 @@ code_richcompare(PyObject *self, PyObject *other, int op)
|
|||
cp = (PyCodeObject *)other;
|
||||
|
||||
eq = PyObject_RichCompareBool(co->co_name, cp->co_name, Py_EQ);
|
||||
if (!eq) goto unequal;
|
||||
if (eq <= 0) goto unequal;
|
||||
eq = co->co_argcount == cp->co_argcount;
|
||||
if (!eq) goto unequal;
|
||||
eq = co->co_posonlyargcount == cp->co_posonlyargcount;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue