diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-04-01 22:51:37 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-04-01 22:51:37 (GMT) |
commit | 9ee601e197c6f5473a29bd5e8317651ce11f7b89 (patch) | |
tree | 76d5c025876a3b7633a7f2f36218a9cbe52fdf26 | |
parent | 41e031004bd156ea579a35d8e1d74cafe8dac3e0 (diff) | |
parent | b6af60c2a9e2625987bcdd6775eb9fe8834c9641 (diff) | |
download | cpython-9ee601e197c6f5473a29bd5e8317651ce11f7b89.zip cpython-9ee601e197c6f5473a29bd5e8317651ce11f7b89.tar.gz cpython-9ee601e197c6f5473a29bd5e8317651ce11f7b89.tar.bz2 |
merge 3.2
-rw-r--r-- | Objects/typeobject.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index a4414a9..4b3c63c 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -490,26 +490,22 @@ type_set_bases(PyTypeObject *type, PyObject *value, void *context) for (i = 0; i < PyTuple_GET_SIZE(value); i++) { ob = PyTuple_GET_ITEM(value, i); if (!PyType_Check(ob)) { - PyErr_Format( - PyExc_TypeError, - "%s.__bases__ must be tuple of classes, not '%s'", - type->tp_name, Py_TYPE(ob)->tp_name); - return -1; + PyErr_Format(PyExc_TypeError, + "%s.__bases__ must be tuple of classes, not '%s'", + type->tp_name, Py_TYPE(ob)->tp_name); + 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; - } + if (PyType_IsSubtype((PyTypeObject*)ob, type)) { + PyErr_SetString(PyExc_TypeError, + "a __bases__ item causes an inheritance cycle"); + return -1; } } new_base = best_base(value); - if (!new_base) { + if (!new_base) return -1; - } if (!compatible_for_assignment(type->tp_base, new_base, "__bases__")) return -1; |