From: Guido van Rossum Date: Mon, 16 Dec 2002 22:32:46 +0000 (+0000) Subject: try_3way_compare() was returning -1 in one case where it should return X-Git-Tag: v2.2.3c1~201 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0a478a5bb33f9363193ca90b800dec4e3af5d6b3;p=thirdparty%2FPython%2Fcpython.git try_3way_compare() was returning -1 in one case where it should return -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... --- diff --git a/Objects/object.c b/Objects/object.c index b14a9c07e8c2..d68356f9e7ad 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -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; }