[Python-3000-checkins] r56269 - python/branches/py3k-struni/Modules/_ctypes/cfield.c
thomas.heller
python-3000-checkins at python.org
Wed Jul 11 15:55:28 CEST 2007
Author: thomas.heller
Date: Wed Jul 11 15:55:28 2007
New Revision: 56269
Modified:
python/branches/py3k-struni/Modules/_ctypes/cfield.c
Log:
PyUnicode_AsEncodedString() returns a bytes object.
Modified: python/branches/py3k-struni/Modules/_ctypes/cfield.c
==============================================================================
--- python/branches/py3k-struni/Modules/_ctypes/cfield.c (original)
+++ python/branches/py3k-struni/Modules/_ctypes/cfield.c Wed Jul 11 15:55:28 2007
@@ -1343,7 +1343,8 @@
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
More information about the Python-3000-checkins
mailing list