[ctypes-commit] ctypes/source _ctypes.c,1.170,1.171
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2004-10-15 19:00:56
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2123 Modified Files: _ctypes.c Log Message: The leaks are back, but lazy Structures work again. Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.170 retrieving revision 1.171 diff -C2 -d -r1.170 -r1.171 *** _ctypes.c 15 Oct 2004 08:22:45 -0000 1.170 --- _ctypes.c 15 Oct 2004 19:00:09 -0000 1.171 *************** *** 584,598 **** assert(dict); - /* FIXME/CHECKME: What about subclasses? */ old_type = PyDict_GetItemString((PyObject *)dict, "_type_"); ! if (old_type == type) ! goto done; /* nothing to do */ ! ! if (old_type && old_type != type && type != Py_None) { PyErr_SetString(PyExc_AttributeError, "_type_ already set"); return NULL; } - if (-1 == PointerType_SetProto(dict, type)) return NULL; --- 584,593 ---- assert(dict); old_type = PyDict_GetItemString((PyObject *)dict, "_type_"); ! if (old_type && old_type != type) { PyErr_SetString(PyExc_AttributeError, "_type_ already set"); return NULL; } if (-1 == PointerType_SetProto(dict, type)) return NULL; *************** *** 600,604 **** if (-1 == PyDict_SetItemString((PyObject *)dict, "_type_", type)) return NULL; ! done: Py_INCREF(Py_None); return Py_None; --- 595,599 ---- if (-1 == PyDict_SetItemString((PyObject *)dict, "_type_", type)) return NULL; ! Py_INCREF(Py_None); return Py_None; |