diff options
author | Robert Kern <robert.kern@gmail.com> | 2007-12-16 05:21:28 +0000 |
---|---|---|
committer | Robert Kern <robert.kern@gmail.com> | 2007-12-16 05:21:28 +0000 |
commit | e5789a3b032fccd3a1245f1ecbc311a22c41da06 (patch) | |
tree | 0da8a2c08ea5775b036a34cc3d7768d5adb14370 /numpy/core/src/arrayobject.c | |
parent | 5455500c4fc2ccc9b2a46511f5ec128d04b5de69 (diff) | |
download | numpy-e5789a3b032fccd3a1245f1ecbc311a22c41da06.tar.gz |
Make array_getcharbuf be the same as array_getreadbuf.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 11 |
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 = { |