diff options
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r-- | numpy/core/src/arraymethods.c | 8 |
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; } |