summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-07-11 13:55:28 (GMT)
committerThomas Heller <theller@ctypes.org>2007-07-11 13:55:28 (GMT)
commite16d2502d288742534ca5ebc2636ab25aa12ccf6 (patch)
tree887ee422e5c57730c62acd3f38c79b18b6074347 /Modules
parent13eb6cad7e67ed47261505dc853e2ad7dbf527af (diff)
downloadcpython-e16d2502d288742534ca5ebc2636ab25aa12ccf6.zip
cpython-e16d2502d288742534ca5ebc2636ab25aa12ccf6.tar.gz
cpython-e16d2502d288742534ca5ebc2636ab25aa12ccf6.tar.bz2
PyUnicode_AsEncodedString() returns a bytes object.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/cfield.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index 7ba0fa6..9c49c1e 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -1343,7 +1343,8 @@ z_set(void *ptr, PyObject *value, Py_ssize_t size)
conversion_mode_errors);
if (str == NULL)
return NULL;
- *(char **)ptr = PyString_AS_STRING(str);
+ assert(PyBytes_Check(str));
+ *(char **)ptr = PyBytes_AS_STRING(str);
return str;
} else if (PyInt_Check(value) || PyLong_Check(value)) {
#if SIZEOF_VOID_P == SIZEOF_LONG_LONG