summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-02-22 22:18:04 (GMT)
committerGuido van Rossum <guido@python.org>2001-02-22 22:18:04 (GMT)
commit2da0ea82ba0c817013fca1442d14ee3596f03bcb (patch)
treec9a2d6e68429e24640791c9d68d0717bd0f49607 /Objects
parent230d17d0d127bc1bc5a29cd635d1d5bdfba76434 (diff)
downloadcpython-2da0ea82ba0c817013fca1442d14ee3596f03bcb.zip
cpython-2da0ea82ba0c817013fca1442d14ee3596f03bcb.tar.gz
cpython-2da0ea82ba0c817013fca1442d14ee3596f03bcb.tar.bz2
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.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/object.c b/Objects/object.c
index a4c9f08..eff6d7a 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;