]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF bug #439104: Tuple richcompares has code-typo.
authorTim Peters <tim.peters@gmail.com>
Fri, 6 Jul 2001 17:48:47 +0000 (17:48 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 6 Jul 2001 17:48:47 +0000 (17:48 +0000)
Symptom:  (1, 2, 3) <= (1, 2) returned 1.
Also an isomorphic error was in the list richcompare code.

Objects/listobject.c
Objects/tupleobject.c

index 0087c63521e9baca2de73bda6deb66c7d66313fa..7044edeea4f6b79744cd8a6f59b27de44414ffce 100644 (file)
@@ -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;
index 183fd33319aadc432d1daa5faa0dde8b71233c23..ca76bb5923ff88549af37ed25ffc9b8ba614ef4e 100644 (file)
@@ -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;