Commit 60bc84a9 authored by Guido van Rossum's avatar Guido van Rossum

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.
parent 5fd22127
...@@ -777,10 +777,10 @@ try_3way_to_rich_compare(PyObject *v, PyObject *w, int op) ...@@ -777,10 +777,10 @@ try_3way_to_rich_compare(PyObject *v, PyObject *w, int op)
PyObject *result; PyObject *result;
c = try_3way_compare(v, w); c = try_3way_compare(v, w);
if (c <= -2)
return NULL;
if (c >= 2) if (c >= 2)
c = default_3way_compare(v, w); c = default_3way_compare(v, w);
if (c <= -2)
return NULL;
switch (op) { switch (op) {
case Py_LT: c = c < 0; break; case Py_LT: c = c < 0; break;
case Py_LE: c = c <= 0; break; case Py_LE: c = c <= 0; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment