From: Tim Peters Date: Fri, 6 Jul 2001 17:48:47 +0000 (+0000) Subject: SF bug #439104: Tuple richcompares has code-typo. X-Git-Tag: v2.1.1c1~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c633be895cb4c63820b77173be93dd4bc60a9de;p=thirdparty%2FPython%2Fcpython.git SF bug #439104: Tuple richcompares has code-typo. Symptom: (1, 2, 3) <= (1, 2) returned 1. Also an isomorphic error was in the list richcompare code. --- diff --git a/Objects/listobject.c b/Objects/listobject.c index 0087c63521e9..7044edeea4f6 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1461,7 +1461,7 @@ list_richcompare(PyObject *v, PyObject *w, int op) PyObject *res; switch (op) { case Py_LT: cmp = vs < ws; break; - case Py_LE: cmp = ws <= ws; break; + case Py_LE: cmp = vs <= ws; break; case Py_EQ: cmp = vs == ws; break; case Py_NE: cmp = vs != ws; break; case Py_GT: cmp = vs > ws; break; diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 183fd33319aa..ca76bb5923ff 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -414,7 +414,7 @@ tuplerichcompare(PyObject *v, PyObject *w, int op) PyObject *res; switch (op) { case Py_LT: cmp = vs < ws; break; - case Py_LE: cmp = ws <= ws; break; + case Py_LE: cmp = vs <= ws; break; case Py_EQ: cmp = vs == ws; break; case Py_NE: cmp = vs != ws; break; case Py_GT: cmp = vs > ws; break;