Index: object.c =================================================================== --- object.c (revision 59215) +++ object.c (working copy) @@ -494,6 +494,11 @@ /* Now try three-way compare before giving up. This is intentionally elaborate; if you have a it will raise TypeError if it detects two objects that aren't ordered with respect to each other. */ + ok = PyObject_RichCompareBool(v, w, Py_EQ); + if (ok < 0) + return -1; /* Error */ + if (ok) + return 0; /* Equal */ ok = PyObject_RichCompareBool(v, w, Py_LT); if (ok < 0) return -1; /* Error */ @@ -504,11 +509,6 @@ return -1; /* Error */ if (ok) return 1; /* Greater than */ - ok = PyObject_RichCompareBool(v, w, Py_EQ); - if (ok < 0) - return -1; /* Error */ - if (ok) - return 0; /* Equal */ /* Give up */ PyErr_Format(PyExc_TypeError,