diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-11 21:50:30 +0000 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-11 21:50:30 +0000 |
commit | 6c0337717509d719f8d445b99ef0152afed2a055 (patch) | |
tree | 1c44499bef1facf9db635ef703da7c73c6c682d4 /Modules/_ctypes/cfield.c | |
parent | 3c1dbd9154d38ab72788e8f2a98538aacd7dd98d (diff) | |
download | cpython-6c0337717509d719f8d445b99ef0152afed2a055.tar.gz |
Issue #8966: If a ctypes structure field is an array of c_char, convert its
value to bytes instead of str (as done for c_char and c_char_p).
Diffstat (limited to 'Modules/_ctypes/cfield.c')
-rw-r--r-- | Modules/_ctypes/cfield.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 441ed9e447..876e2c0c75 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1333,7 +1333,7 @@ s_get(void *ptr, Py_ssize_t size) break; } - return PyUnicode_FromStringAndSize((char *)ptr, (Py_ssize_t)i); + return PyBytes_FromStringAndSize((char *)ptr, (Py_ssize_t)i); } static PyObject * |