]> granicus.if.org Git - python/commitdiff
?Why did my tests not notice this before?
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Mon, 14 Jan 2008 01:07:27 +0000 (01:07 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Mon, 14 Jan 2008 01:07:27 +0000 (01:07 +0000)
Slots inheritance is very different from OO inheritance.
This code lead to infinite recursion on classes derived from StructType.

Modules/_ctypes/_ctypes.c

index a9eb032b0106b2656823d85189950bf0213baca9..9d7290f8e3774ad999b1d11a98b89c0978017030 100644 (file)
@@ -410,7 +410,7 @@ static int
 StructType_setattro(PyObject *self, PyObject *key, PyObject *value)
 {
        /* XXX Should we disallow deleting _fields_? */
-       if (-1 == Py_TYPE(self)->tp_base->tp_setattro(self, key, value))
+       if (-1 == PyType_Type.tp_setattro(self, key, value))
                return -1;
        
        if (value && PyString_Check(key) &&