Issue #1717:  remove the cmp builtin function, the C-API functions
PyObject_Cmp, PyObject_Compare, and various support functions.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index b2ad89f..3f1df8d 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2897,7 +2897,7 @@
 	slots_a = ((PyHeapTypeObject *)a)->ht_slots;
 	slots_b = ((PyHeapTypeObject *)b)->ht_slots;
 	if (slots_a && slots_b) {
-		if (PyObject_Compare(slots_a, slots_b) != 0)
+		if (PyObject_RichCompareBool(slots_a, slots_b, Py_EQ) != 1)
 			return 0;
 		size += sizeof(PyObject *) * PyTuple_GET_SIZE(slots_a);
 	}