[Numpy-svn] r4595 - trunk/numpy/core/src
numpy-svn at scipy.org
numpy-svn at scipy.org
Sun Dec 16 00:21:32 EST 2007
Author: rkern
Date: 2007-12-15 23:21:28 -0600 (Sat, 15 Dec 2007)
New Revision: 4595
Modified:
trunk/numpy/core/src/arrayobject.c
Log:
Make array_getcharbuf be the same as array_getreadbuf.
Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c 2007-12-16 04:49:12 UTC (rev 4594)
+++ trunk/numpy/core/src/arrayobject.c 2007-12-16 05:21:28 UTC (rev 4595)
@@ -3139,16 +3139,7 @@
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 = {
More information about the Numpy-svn
mailing list