diff options
author | Michael W. Hudson <mwh@python.net> | 2002-11-27 10:24:44 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-11-27 10:24:44 (GMT) |
commit | caf17be1b7886f4c51558fb10ec8a51483102d38 (patch) | |
tree | 9297bddcaf3338451dd27e8b382ebd5a54de174d /Objects | |
parent | e16e01fac6685e83a0121d1c6feca984fef8b946 (diff) | |
download | cpython-caf17be1b7886f4c51558fb10ec8a51483102d38.zip cpython-caf17be1b7886f4c51558fb10ec8a51483102d38.tar.gz cpython-caf17be1b7886f4c51558fb10ec8a51483102d38.tar.bz2 |
I had the inheritance cycle stuff backwards. Oops!
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index a5779ef..82237c8 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; + } } } |