From aa2c09a7ddb8c7e7eb1170edc24ec274aaa636b1 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 7 Sep 2006 18:12:53 +0000 Subject: Fix invalid keyword argument error in reshape method. --- numpy/core/src/arraymethods.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'numpy/core/src/arraymethods.c') diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index 9416b21ae..610a6a372 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -74,8 +74,12 @@ array_reshape(PyArrayObject *self, PyObject *args, PyObject *kwds) if (kwds != NULL) { PyObject *ref; ref = PyDict_GetItemString(kwds, "order"); - if (ref == NULL || \ - (PyArray_OrderConverter(ref, &order) == PY_FAIL)) + if (ref == NULL) { + PyErr_SetString(PyExc_TypeError, + "invalid keyword argument"); + return NULL; + } + if ((PyArray_OrderConverter(ref, &order) == PY_FAIL)) return NULL; } -- cgit v1.2.1