summaryrefslogtreecommitdiff
path: root/scipy/base/src/arrayobject.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2005-09-20 05:40:52 +0000
committerTravis Oliphant <oliphant@enthought.com>2005-09-20 05:40:52 +0000
commit182a8c3fc8a6d827c878b9749af668e41cc0257d (patch)
tree97172c9620eba0df4a28982688358f53c424df4f /scipy/base/src/arrayobject.c
parent70edf5c9acbc231c9ce9078942fe210d8888305a (diff)
downloadnumpy-182a8c3fc8a6d827c878b9749af668e41cc0257d.tar.gz
Found problem with reshape.
Diffstat (limited to 'scipy/base/src/arrayobject.c')
-rw-r--r--scipy/base/src/arrayobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scipy/base/src/arrayobject.c b/scipy/base/src/arrayobject.c
index edb875439..368c04f62 100644
--- a/scipy/base/src/arrayobject.c
+++ b/scipy/base/src/arrayobject.c
@@ -3525,7 +3525,7 @@ array_shape_set(PyArrayObject *self, PyObject *val)
ret = PyArray_Reshape(self, val);
if (ret == NULL) return -1;
- if (self->nd > 0) { /* Free dimensions and strides */
+ if (self->nd > 0) { /* Free old dimensions and strides */
PyDimMem_FREE(self->dimensions);
}
nd = PyArray_NDIM(ret);
@@ -3543,6 +3543,7 @@ array_shape_set(PyArrayObject *self, PyObject *val)
memcpy(self->strides, PyArray_STRIDES(ret),
nd*sizeof(intp));
}
+ else self->dimensions=NULL;
Py_DECREF(ret);
return 0;
}