]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
try_3way_compare() was returning -1 in one case where it should return
authorGuido van Rossum <guido@python.org>
Mon, 16 Dec 2002 22:32:46 +0000 (22:32 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 16 Dec 2002 22:32:46 +0000 (22:32 +0000)
-2 (i.e. an exception was set).  (This was already fixed in 2.3
through a different refactoring.)

Worth the release of Pyton 2.2.3?  Eventually, I guess...

Objects/object.c

index b14a9c07e8c27dbae2c9d57da8c9f9bf2da7696b..d68356f9e7ad6499e339d942cdb58ee0fb8b80f3 100644 (file)
@@ -482,7 +482,7 @@ try_3way_compare(PyObject *v, PyObject *w)
        if (f != NULL && f == w->ob_type->tp_compare) {
                c = (*f)(v, w);
                if (c < 0 && PyErr_Occurred())
-                       return -1;
+                       return -2;
                return c < 0 ? -1 : c > 0 ? 1 : 0;
        }