diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-10-02 22:48:14 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-10-02 22:48:14 +0000 |
commit | 5c876be793ddfee6da8bb4c0a1bd5b64bf1d5a97 (patch) | |
tree | abca2a1bf00f0acd592384281094da76e1c8973b /numpy/core/src/arrayobject.c | |
parent | d0791f7ade3b1d6d2673c0de93d58e0a3e225b4e (diff) | |
download | numpy-5c876be793ddfee6da8bb4c0a1bd5b64bf1d5a97.tar.gz |
Fix bugs: uncaught error, way record data-types print, asbuffer function fixed.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 6f83eb5ee..03772199a 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -7519,7 +7519,7 @@ _broadcast_cast(PyArrayObject *out, PyArrayObject *in, } _pya_free(buffers[0]); _pya_free(buffers[1]); - if (!PyArray_ISNUMBER(in) && PyErr_Occurred()) return -1; + if (PyErr_Occurred()) return -1; return 0; } @@ -8282,28 +8282,26 @@ PyArray_FromAny(PyObject *op, PyArray_Descr *newtype, int min_depth, isobject = 1; } if (PySequence_Check(op)) { - PyObject *thiserr; + PyObject *thiserr=NULL; /* necessary but not sufficient */ Py_INCREF(newtype); r = Array_FromSequence(op, newtype, flags & FORTRAN, min_depth, max_depth); - if (r == NULL && (thiserr=PyErr_Occurred()) && \ - !PyErr_GivenExceptionMatches(thiserr, - PyExc_MemoryError)) { + if (r == NULL && (thiserr=PyErr_Occurred())) { + if (PyErr_GivenExceptionMatches(thiserr, + PyExc_MemoryError)) + return NULL; /* If object was explicitly requested, then try nested list object array creation */ + PyErr_Clear(); if (isobject) { - PyErr_Clear(); Py_INCREF(newtype); r = ObjectArray_FromNestedList \ (op, newtype, flags & FORTRAN); seq = TRUE; Py_DECREF(newtype); } - else { - PyErr_Clear(); - } } else { seq = TRUE; |