summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-09 14:28:11 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-09 14:28:11 (GMT)
commit867bcbcd6d7b251a2cd8a01ce70fdbc1dba6f029 (patch)
treee37379f71b592fe4046f35926007c1d4bcc8fc79
parent65b6a80f19736d6313d5eb896d6b2fb6bbf65a03 (diff)
downloadcpython-867bcbcd6d7b251a2cd8a01ce70fdbc1dba6f029.zip
cpython-867bcbcd6d7b251a2cd8a01ce70fdbc1dba6f029.tar.gz
cpython-867bcbcd6d7b251a2cd8a01ce70fdbc1dba6f029.tar.bz2
Forgot to submit this earlier; it's needed to make test_threading pass.
-rw-r--r--Modules/_ctypes/_ctypes.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 83f23ca..d126ca5 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -797,14 +797,14 @@ CharArray_set_value(CDataObject *self, PyObject *value)
conversion_mode_errors);
if (!value)
return -1;
- } else if (!PyString_Check(value)) {
+ } else if (!PyBytes_Check(value)) {
PyErr_Format(PyExc_TypeError,
- "string expected instead of %s instance",
+ "str/bytes expected instead of %s instance",
value->ob_type->tp_name);
return -1;
} else
Py_INCREF(value);
- size = PyString_GET_SIZE(value);
+ size = PyBytes_GET_SIZE(value);
if (size > self->b_size) {
PyErr_SetString(PyExc_ValueError,
"string too long");
@@ -812,7 +812,7 @@ CharArray_set_value(CDataObject *self, PyObject *value)
return -1;
}
- ptr = PyString_AS_STRING(value);
+ ptr = PyBytes_AS_STRING(value);
memcpy(self->b_ptr, ptr, size);
if (size < self->b_size)
self->b_ptr[size] = '\0';