From d4b47b7573c6d3d21cac7e97a0aee306d15b8d1b Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 19 Oct 2006 22:55:23 +0000 Subject: Fix missing comment characters in intel.py. Check for None in .reshape and .resize --- numpy/core/src/arraymethods.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'numpy/core/src/arraymethods.c') 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; } -- cgit v1.2.1