summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-07-11 12:24:20 (GMT)
committerThomas Heller <theller@ctypes.org>2007-07-11 12:24:20 (GMT)
commit982479de234e7b33929b035716707025d4dbb173 (patch)
tree965031291387d2b872f22377cf7638903ee18e55
parent67611a6e4922691ff906971d38cb40d23322609e (diff)
downloadcpython-982479de234e7b33929b035716707025d4dbb173.zip
cpython-982479de234e7b33929b035716707025d4dbb173.tar.gz
cpython-982479de234e7b33929b035716707025d4dbb173.tar.bz2
Repair ctypes Structures.
-rw-r--r--Modules/_ctypes/_ctypes.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index d126ca5..0c5c708 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -413,8 +413,8 @@ StructType_setattro(PyObject *self, PyObject *key, PyObject *value)
if (-1 == PyObject_GenericSetAttr(self, key, value))
return -1;
- if (value && PyString_Check(key) &&
- 0 == strcmp(PyString_AS_STRING(key), "_fields_"))
+ if (value && PyUnicode_Check(key) &&
+ 0 == strcmp(PyUnicode_AsString(key), "_fields_"))
return StructUnionType_update_stgdict(self, value, 1);
return 0;
}
@@ -427,8 +427,8 @@ UnionType_setattro(PyObject *self, PyObject *key, PyObject *value)
if (-1 == PyObject_GenericSetAttr(self, key, value))
return -1;
- if (PyString_Check(key) &&
- 0 == strcmp(PyString_AS_STRING(key), "_fields_"))
+ if (PyUnicode_Check(key) &&
+ 0 == strcmp(PyUnicode_AsString(key), "_fields_"))
return StructUnionType_update_stgdict(self, value, 0);
return 0;
}
@@ -1540,7 +1540,7 @@ SimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
fmt = getentry(proto_str);
if (fmt == NULL) {
- Py_DECREF(result);
+ Py_DECREF((PyObject *)result);
PyErr_Format(PyExc_ValueError,
"_type_ '%s' not supported", proto_str);
return NULL;