diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2011-03-07 22:29:29 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-03-07 22:30:47 -0700 |
commit | 9e845494355a7bb6c6548f0f48fa83485999a460 (patch) | |
tree | b68a784bfd73be580bc0bc8d3e2ed475ef6a812a | |
parent | 60adb1ac9fe688184973a02e8bce552d70d087f4 (diff) | |
download | numpy-9e845494355a7bb6c6548f0f48fa83485999a460.tar.gz |
Make a failed sequence access error set the object creation flag.
-rw-r--r-- | numpy/core/src/multiarray/ctors.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index a98116afe..f41ab1a4a 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -825,6 +825,7 @@ discover_dimensions(PyObject *s, int *maxndim, npy_intp *d, int check_it, if ((e = PySequence_GetItem(s, 0)) == NULL) { /* not a list */ *maxndim = 0; + *out_is_object = 1; PyErr_Clear(); return 0; } @@ -844,6 +845,7 @@ discover_dimensions(PyObject *s, int *maxndim, npy_intp *d, int check_it, if ((e = PySequence_GetItem(s, 0)) == NULL) { /* not a list */ *maxndim = 0; + *out_is_object = 1; PyErr_Clear(); return 0; } |