summaryrefslogtreecommitdiff
path: root/Modules/_ctypes/cfield.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-06-11 21:50:30 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-06-11 21:50:30 +0000
commit6c0337717509d719f8d445b99ef0152afed2a055 (patch)
tree1c44499bef1facf9db635ef703da7c73c6c682d4 /Modules/_ctypes/cfield.c
parent3c1dbd9154d38ab72788e8f2a98538aacd7dd98d (diff)
downloadcpython-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.c2
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 *