summaryrefslogtreecommitdiff
path: root/numpy/core/src/arraymethods.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-10-19 22:55:23 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-10-19 22:55:23 +0000
commitd4b47b7573c6d3d21cac7e97a0aee306d15b8d1b (patch)
tree0d89c81c584fd62b635c56468055682420f57ae5 /numpy/core/src/arraymethods.c
parentec2c2bc190e3a8fa9aa6e956cc0ce6dd63bde445 (diff)
downloadnumpy-d4b47b7573c6d3d21cac7e97a0aee306d15b8d1b.tar.gz
Fix missing comment characters in intel.py. Check for None in .reshape and .resize
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r--numpy/core/src/arraymethods.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c
index 5e9b16b15..a13da074f 100644
--- a/numpy/core/src/arraymethods.c
+++ b/numpy/core/src/arraymethods.c
@@ -71,6 +71,8 @@ array_reshape(PyArrayObject *self, PyObject *args, PyObject *kwds)
n = PyTuple_Size(args);
if (n <= 1) {
+ if (PyTuple_GET_ITEM(args, 0) == Py_None)
+ return PyArray_View(self, NULL, NULL);
if (!PyArg_ParseTuple(args, "O&", PyArray_IntpConverter,
&newshape)) return NULL;
}
@@ -774,6 +776,10 @@ array_resize(PyArrayObject *self, PyObject *args, PyObject *kwds)
}
n = PyTuple_Size(args);
if (n <= 1) {
+ if (PyTuple_GET_ITEM(args, 0) == Py_None) {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
if (!PyArg_ParseTuple(args, "O&", PyArray_IntpConverter,
&newshape)) return NULL;
}