[ctypes-commit] ctypes/source _ctypes.c,1.194,1.195
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2004-12-30 13:36:41
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17927 Modified Files: _ctypes.c Log Message: Assinging None to a POINTER structure field makes a NULL pointer. Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.194 retrieving revision 1.195 diff -C2 -d -r1.194 -r1.195 *** _ctypes.c 30 Dec 2004 13:03:51 -0000 1.194 --- _ctypes.c 30 Dec 2004 13:36:25 -0000 1.195 *************** *** 1901,1904 **** --- 1901,1908 ---- return _CData_set(dst, type, setfunc, ob, size, ptr); + } else if (value == Py_None && PointerTypeObject_Check(type)) { + *(void **)dst->b_ptr = NULL; + Py_INCREF(Py_None); + return Py_None; } else { PyErr_Format(PyExc_TypeError, |