summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
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");