summaryrefslogtreecommitdiff
path: root/numpy/core/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-01-06 10:14:10 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-01-06 10:14:10 +0000
commit6315c4c27eaeca7f2080ea585b1901e2b683b3ff (patch)
tree2777bf768a4fb125ad3ceb1940f46f70ad4e2d51 /numpy/core/src/arrayobject.c
parent5f5c4b92573a060d20cf9bbf70db00d45cda7268 (diff)
downloadnumpy-6315c4c27eaeca7f2080ea585b1901e2b683b3ff.tar.gz
Added new feature to .view method so that if the argument is a sub-type of the ndarray, an object is returned with all the information of the array.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r--numpy/core/src/arrayobject.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index 11ebc4d04..494d77a13 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -3797,7 +3797,7 @@ array_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
/* For now, let's just use this to create an empty, contiguous
array of a specific type and shape.
- */
+ */
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O&O&LO&i",
kwlist, PyArray_IntpConverter,
@@ -8352,7 +8352,10 @@ arraydescr_str(PyArray_Descr *self)
if (self->fields && self->fields != Py_None) {
PyObject *lst;
lst = arraydescr_protocol_descr_get(self);
- if (!lst) sub = PyString_FromString("<err>");
+ if (!lst) {
+ sub = PyString_FromString("<err>");
+ PyErr_Clear();
+ }
else sub = PyObject_Str(lst);
Py_XDECREF(lst);
if (self->type_num != PyArray_VOID) {