summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index bed5ce6cb..fe2ab8e82 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -3139,16 +3139,7 @@ array_getwritebuf(PyArrayObject *self, Py_ssize_t segment, void **ptrptr)
static Py_ssize_t
array_getcharbuf(PyArrayObject *self, Py_ssize_t segment, constchar **ptrptr)
{
- if (self->descr->type_num == PyArray_STRING || \
- self->descr->type_num == PyArray_UNICODE || \
- self->descr->elsize == 1)
- return array_getreadbuf(self, segment, (void **) ptrptr);
- else {
- PyErr_SetString(PyExc_TypeError,
- "non-character (or 8-bit) array cannot be "\
- "interpreted as character buffer");
- return -1;
- }
+ return array_getreadbuf(self, segment, (void **) ptrptr);
}
static PyBufferProcs array_as_buffer = {