summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-04-22 17:25:27 -0700
committerMark Wiebe <mwwiebe@gmail.com>2011-04-22 17:25:27 -0700
commit700dc6972245735e183d62f35f5dcc42960ff7e7 (patch)
treebd6976d606ac620afee401da5f05a5e9084b7b4b /numpy
parentdeb290356248b39176518b2b22af743e11e91496 (diff)
downloadnumpy-700dc6972245735e183d62f35f5dcc42960ff7e7.tar.gz
BUG: PyArray_FromString failed to disallow object arrays
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/ctors.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index 8cfe5da51..261e6754b 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -3548,7 +3548,8 @@ PyArray_FromString(char *data, npy_intp slen, PyArray_Descr *dtype,
if (dtype == NULL) {
dtype=PyArray_DescrFromType(PyArray_DEFAULT);
}
- if (PyDataType_FLAGCHK(dtype, NPY_ITEM_IS_POINTER)) {
+ if (PyDataType_FLAGCHK(dtype, NPY_ITEM_IS_POINTER) ||
+ PyDataType_REFCHK(dtype)) {
PyErr_SetString(PyExc_ValueError,
"Cannot create an object array from" \
" a string");