Mercurial > cpython-lru_cache-weakref
diff Objects/object.c @ 16741:8466bb37289c legacy-trunk
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.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 22 Feb 2001 22:18:04 +0000 |
| parents | 1fb6672b20ef |
| children | db61894b0d6f |
line wrap: on
line diff
--- a/Objects/object.c Thu Feb 22 21:28:04 2001 +0000 +++ b/Objects/object.c Thu Feb 22 22:18:04 2001 +0000 @@ -777,10 +777,10 @@ PyObject *result; c = try_3way_compare(v, w); + if (c >= 2) + c = default_3way_compare(v, w); if (c <= -2) return NULL; - if (c >= 2) - c = default_3way_compare(v, w); switch (op) { case Py_LT: c = c < 0; break; case Py_LE: c = c <= 0; break;
