[Python-checkins] r66972 - in python/branches/release25-maint: Misc/NEWS Modules/_ctypes/_ctypes.c

thomas.heller python-checkins at python.org
Sat Oct 18 23:33:45 CEST 2008


Author: thomas.heller
Date: Sat Oct 18 23:33:44 2008
New Revision: 66972

Log:
Modify ctypes types with 'official' functions.  Backport from trunk,
snv rev 59943 and 59946.


Modified:
   python/branches/release25-maint/Misc/NEWS
   python/branches/release25-maint/Modules/_ctypes/_ctypes.c

Modified: python/branches/release25-maint/Misc/NEWS
==============================================================================
--- python/branches/release25-maint/Misc/NEWS	(original)
+++ python/branches/release25-maint/Misc/NEWS	Sat Oct 18 23:33:44 2008
@@ -92,6 +92,9 @@
 Library
 -------
 
+- Assigning methods to ctypes.Structure and ctypes.Union subclasses
+  after creation of the class does now work correctly.  See Issue #1700288.
+
 - Issue #3895: _lsprof could be crashed with an external timer that did not
   return a float when a Profiler object is garbage collected.
 

Modified: python/branches/release25-maint/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/branches/release25-maint/Modules/_ctypes/_ctypes.c	(original)
+++ python/branches/release25-maint/Modules/_ctypes/_ctypes.c	Sat Oct 18 23:33:44 2008
@@ -410,7 +410,7 @@
 StructType_setattro(PyObject *self, PyObject *key, PyObject *value)
 {
 	/* XXX Should we disallow deleting _fields_? */
-	if (-1 == PyObject_GenericSetAttr(self, key, value))
+	if (-1 == PyType_Type.tp_setattro(self, key, value))
 		return -1;
 	
 	if (value && PyString_Check(key) &&


More information about the Python-checkins mailing list