Another comparison patch-up: comparing a type with a dynamic metatype
to one with a static metatype raised an obscure error.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 20c149e..027a568 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2033,7 +2033,8 @@
if (!PyArg_ParseTuple(args, "O", &other))
return NULL;
- if (!PyType_IsSubtype(other->ob_type, self->ob_type)) {
+ if (other->ob_type->tp_compare != func &&
+ !PyType_IsSubtype(other->ob_type, self->ob_type)) {
PyErr_Format(
PyExc_TypeError,
"%s.__cmp__(x,y) requires y to be a '%s', not a '%s'",