summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/arrayobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index 599d9060e..b7b375b66 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -809,6 +809,11 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
int swap;
type_num = descr->type_num;
+ if ((type_num == PyArray_OBJECT) && \
+ (PyArray_Check((*((PyObject **)data))))) {
+ Py_INCREF(*((PyObject **)data));
+ return *((PyObject **)data);
+ }
itemsize = descr->elsize;
type = descr->typeobj;
copyswap = descr->f->copyswap;