From 2da0ea82ba0c817013fca1442d14ee3596f03bcb Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 22 Feb 2001 22:18:04 +0000 Subject: [PATCH] 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. --- Objects/object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/object.c b/Objects/object.c index a4c9f087aa5..eff6d7ad072 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -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;