From: Amaury Forgeot d'Arc Date: Mon, 14 Jan 2008 01:07:27 +0000 (+0000) Subject: ?Why did my tests not notice this before? X-Git-Tag: v2.6a1~621 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7cdf5f5c318869a7cfa1deaeefb2a7f07244c62e;p=python ?Why did my tests not notice this before? Slots inheritance is very different from OO inheritance. This code lead to infinite recursion on classes derived from StructType. --- diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index a9eb032b01..9d7290f8e3 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -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) &&