summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-03-12 11:35:01 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-03-12 11:35:01 +0000
commit2ce697cf4dde594f9e39905c0b6b44172a60e7f6 (patch)
tree258be541cf725f0a12795fe3083bb0043e1edf4d /numpy
parent0c436ea6d48135bc14edf760f1cecc53f1c5d5a9 (diff)
downloadnumpy-2ce697cf4dde594f9e39905c0b6b44172a60e7f6.tar.gz
Fix object array setting.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/arrayobject.c6
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,