summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-08-29 02:47:39 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-08-29 02:47:39 +0000
commit762dacd686faa83c7de12c115e0a5874eef0481e (patch)
treeba39d11ca3cdf5f1c62e5f6fcc61f89c85af4ee5 /numpy/core/src
parent8d80b96d2aa1f498b80fc19b296ff881185cd363 (diff)
downloadnumpy-762dacd686faa83c7de12c115e0a5874eef0481e.tar.gz
Add float, int, etc. to numpy name-space. Flesh out tensordot. Fix-up getcharbuf to allow all 8-bit types to be returned as a charbuf.
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/arrayobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index abc01614a..d66e01647 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -3038,12 +3038,13 @@ 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->type_num == PyArray_UNICODE || \
+ self->descr->elsize == 1)
return array_getreadbuf(self, segment, (void **) ptrptr);
else {
PyErr_SetString(PyExc_TypeError,
- "non-character array cannot be interpreted "\
- "as character buffer");
+ "non-character (or 8-bit) array cannot be "\
+ "interpreted as character buffer");
return -1;
}
}