]> granicus.if.org Git - python/commitdiff
SF bug #439104: Tuple richcompares has code-typo.
authorTim Peters <tim.peters@gmail.com>
Fri, 6 Jul 2001 17:45:43 +0000 (17:45 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 6 Jul 2001 17:45:43 +0000 (17:45 +0000)
Symptom:  (1, 2, 3) <= (1, 2) returned 1.
This was already fixed in CVS for tuples, but an isomorphic error was in
the list richcompare code.

Objects/listobject.c

index 6fb3145d362846921b01ffe15e64ac5b184893bf..7166ced8cb4fa074463910a7927a7a240ae2d435 100644 (file)
@@ -1512,7 +1512,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;