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:
Guido van Rossum 2001-02-22 22:18:04 +00:00
parent 230d17d0d1
commit 2da0ea82ba
1 changed files with 2 additions and 2 deletions

View File

@ -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;