Commit 3e06faec authored by Thomas Heller's avatar Thomas Heller

Modify ctypes types with 'official' functions. Backport from trunk,

snv rev 59943 and 59946.
parent 14121854
...@@ -92,6 +92,9 @@ Core and builtins ...@@ -92,6 +92,9 @@ Core and builtins
Library 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 - Issue #3895: _lsprof could be crashed with an external timer that did not
return a float when a Profiler object is garbage collected. return a float when a Profiler object is garbage collected.
......
...@@ -410,7 +410,7 @@ static int ...@@ -410,7 +410,7 @@ static int
StructType_setattro(PyObject *self, PyObject *key, PyObject *value) StructType_setattro(PyObject *self, PyObject *key, PyObject *value)
{ {
/* XXX Should we disallow deleting _fields_? */ /* XXX Should we disallow deleting _fields_? */
if (-1 == PyObject_GenericSetAttr(self, key, value)) if (-1 == PyType_Type.tp_setattro(self, key, value))
return -1; return -1;
if (value && PyString_Check(key) && if (value && PyString_Check(key) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment