diff options
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 4b5c3de90..98ce359ae 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -723,7 +723,7 @@ PyArray_CopyObject(PyArrayObject *dest, PyObject *src_object) { PyArrayObject *src; int ret; - + Py_INCREF(dest->descr); src = (PyArrayObject *)PyArray_FromAny(src_object, dest->descr, 0, @@ -5593,6 +5593,10 @@ Array_FromSequence(PyObject *s, PyArray_Descr *typecode, int fortran, goto fail; } + if (max_depth && PyTypeNum_ISOBJECT(type) && (nd > max_depth)) { + nd = max_depth; + } + if ((max_depth && nd > max_depth) || \ (min_depth && nd < min_depth)) { PyErr_SetString(PyExc_ValueError, |