]> granicus.if.org Git - python/commitdiff
merge 3.2
authorBenjamin Peterson <benjamin@python.org>
Sun, 1 Apr 2012 22:51:37 +0000 (18:51 -0400)
committerBenjamin Peterson <benjamin@python.org>
Sun, 1 Apr 2012 22:51:37 +0000 (18:51 -0400)
1  2 
Objects/typeobject.c

index a4414a925f44a1b29f0ce7d1e0b6f88ee005795f,8cfa8894b0c08bc590c20fc6138a4fd39197042b..4b3c63cce76d1c091c4026d29c64b78346f1f79c
@@@ -490,18 -458,16 +490,15 @@@ type_set_bases(PyTypeObject *type, PyOb
      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 old- or "
 -                         "new-style classes, not '%s'",
++                         "%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;
          }
      }