summaryrefslogtreecommitdiff
path: root/numpy/core/src/arraymethods.c
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-09-07 18:12:53 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-09-07 18:12:53 +0000
commitaa2c09a7ddb8c7e7eb1170edc24ec274aaa636b1 (patch)
treeb922dfe26f7c9cf14b76289f58d6848e4b6aa20b /numpy/core/src/arraymethods.c
parent49f41ff05c4ed9442539debe1e612a2ea557e122 (diff)
downloadnumpy-aa2c09a7ddb8c7e7eb1170edc24ec274aaa636b1.tar.gz
Fix invalid keyword argument error in reshape method.
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r--numpy/core/src/arraymethods.c8
1 files changed, 6 insertions, 2 deletions
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;
}