mirror of https://github.com/python/cpython
In try_3way_to_rich_compare(), swap the call to default_3way_compare()
and the test for errors, so that an error in the default compare doesn't go undetected. This fixes SF Bug #132933 (submitted by effbot) -- list.sort doesn't detect comparision errors.
This commit is contained in:
parent
230d17d0d1
commit
2da0ea82ba
|
@ -777,10 +777,10 @@ try_3way_to_rich_compare(PyObject *v, PyObject *w, int op)
|
|||
PyObject *result;
|
||||
|
||||
c = try_3way_compare(v, w);
|
||||
if (c <= -2)
|
||||
return NULL;
|
||||
if (c >= 2)
|
||||
c = default_3way_compare(v, w);
|
||||
if (c <= -2)
|
||||
return NULL;
|
||||
switch (op) {
|
||||
case Py_LT: c = c < 0; break;
|
||||
case Py_LE: c = c <= 0; break;
|
||||
|
|
Loading…
Reference in New Issue