]> granicus.if.org Git - python/commitdiff
Remove unnecessary check in tests for slots allowed.
authorJeremy Hylton <jeremy@alum.mit.edu>
Wed, 16 Jul 2003 16:08:23 +0000 (16:08 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Wed, 16 Jul 2003 16:08:23 +0000 (16:08 +0000)
The !PyType_Check(base) check snuck in as part of rev 2.215, but was
unrelated to the SF patch that is mentioned in the checkin comment.
The test is currently unnecessary because base is set to the return
value of best_bases(), which returns a type or NULL.

Objects/typeobject.c

index a8c8b159e7af4191897643784efa8cd2d10aa8f7..f2511791b2ce9690e095340e68dda771f3f79732 100644 (file)
@@ -1653,7 +1653,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
 
                /* Are slots allowed? */
                nslots = PyTuple_GET_SIZE(slots);
-               if (nslots > 0 && base->tp_itemsize != 0 && !PyType_Check(base)) {
+               if (nslots > 0 && base->tp_itemsize != 0) {
                        /* for the special case of meta types, allow slots */
                        PyErr_Format(PyExc_TypeError,
                                     "nonempty __slots__ "