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 _______________________________________________ Python-3000-checkins mailing list Python-3000-checkins@python.org http://mail.python.org/mailman/listinfo/python-3000-checkins