[Python-3000-checkins] r56260 - python/branches/py3k-struni/Modules/_ctypes/_ctypes.c
thomas.heller
python-3000-checkins at python.org
Wed Jul 11 14:24:20 CEST 2007
Author: thomas.heller
Date: Wed Jul 11 14:24:20 2007
New Revision: 56260
Modified:
python/branches/py3k-struni/Modules/_ctypes/_ctypes.c
Log:
Repair ctypes Structures.
Modified: python/branches/py3k-struni/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/branches/py3k-struni/Modules/_ctypes/_ctypes.c (original)
+++ python/branches/py3k-struni/Modules/_ctypes/_ctypes.c Wed Jul 11 14:24:20 2007
@@ -413,8 +413,8 @@
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 @@
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 @@
}
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;
More information about the Python-3000-checkins
mailing list