Merged revisions 74664 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r74664 | thomas.heller | 2009-09-04 20:24:41 +0200 (Fr, 04 Sep 2009) | 1 line

  Issue 6239: ctypes.c_char_p return value must return bytes.
........
This commit is contained in:
Thomas Heller 2009-09-04 18:37:03 +00:00
parent c35adc082d
commit e83c938e21
15 changed files with 60 additions and 57 deletions

View file

@ -1428,7 +1428,8 @@ z_get(void *ptr, Py_ssize_t size)
return NULL;
}
#endif
return PyUnicode_FromString(*(char **)ptr);
return PyBytes_FromStringAndSize(*(char **)ptr,
strlen(*(char **)ptr));
} else {
Py_INCREF(Py_None);
return Py_None;