From caf17be1b7886f4c51558fb10ec8a51483102d38 Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Wed, 27 Nov 2002 10:24:44 +0000 Subject: I had the inheritance cycle stuff backwards. Oops! --- Objects/typeobject.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Objects/typeobject.c') diff --git a/Objects/typeobject.c b/Objects/typeobject.c index a5779ef3fe..82237c870c 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -208,10 +208,12 @@ type_set_bases(PyTypeObject *type, PyObject *value, void *context) type->tp_name, ob->ob_type->tp_name); return -1; } - if (PyType_IsSubtype(type, (PyTypeObject*)ob)) { - PyErr_SetString(PyExc_TypeError, - "a __bases__ item causes an inheritance cycle"); - return -1; + if (PyType_Check(ob)) { + if (PyType_IsSubtype((PyTypeObject*)ob, type)) { + PyErr_SetString(PyExc_TypeError, + "a __bases__ item causes an inheritance cycle"); + return -1; + } } } -- cgit v1.2.1