diff options
Diffstat (limited to 'scipy/base/src')
-rw-r--r-- | scipy/base/src/arrayobject.c | 11 | ||||
-rw-r--r-- | scipy/base/src/multiarraymodule.c | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/scipy/base/src/arrayobject.c b/scipy/base/src/arrayobject.c index 12e2c9208..e1f3a5576 100644 --- a/scipy/base/src/arrayobject.c +++ b/scipy/base/src/arrayobject.c @@ -3849,11 +3849,12 @@ array_descr_get(PyArrayObject *self) /* hand this off to the typeobject */ /* or give default */ - - res = PyObject_GetAttrString((PyObject *)self->descr->typeobj, - "__array_descr__"); - if (res) return res; - PyErr_Clear(); + if (PyArray_ISUSERDEF(self)) { + res = PyObject_GetAttrString((PyObject *)self->descr->typeobj, + "__array_descr__"); + if (res) return res; + PyErr_Clear(); + } /* get default */ dobj = PyTuple_New(2); if (dobj == NULL) return NULL; diff --git a/scipy/base/src/multiarraymodule.c b/scipy/base/src/multiarraymodule.c index 0d4326b9f..4ad5d03f4 100644 --- a/scipy/base/src/multiarraymodule.c +++ b/scipy/base/src/multiarraymodule.c @@ -1117,7 +1117,7 @@ PyArray_Concatenate(PyObject *op, int axis) return NULL; } - if ((0 < axis) && (axis < MAX_DIMS)) + if ((axis < 0) || ((0 < axis) && (axis < MAX_DIMS))) return _swap_and_concat(op, axis, n); ret = NULL; |