summaryrefslogtreecommitdiff
path: root/numpy/f2py/src/fortranobject.c
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2019-12-01 16:13:14 +0000
committerEric Wieser <wieser.eric@gmail.com>2019-12-01 16:45:11 +0000
commit6fa0ff8e56e7e09f0c1cdbce2da338be073947e9 (patch)
tree2a1173553a9929dce7188820af629906c3bd2b0d /numpy/f2py/src/fortranobject.c
parentb83f10ef7ee766bf30ccfa563b6cc8f7fd38a4c8 (diff)
downloadnumpy-6fa0ff8e56e7e09f0c1cdbce2da338be073947e9.tar.gz
ENH: Show the incorrect type in the fortran error message
I just got this error while hacking some scipy internals, and had nowhere near enough information to debug it. This is a little closer to useful.
Diffstat (limited to 'numpy/f2py/src/fortranobject.c')
-rw-r--r--numpy/f2py/src/fortranobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c
index 8aa55555d..eb1050dd7 100644
--- a/numpy/f2py/src/fortranobject.c
+++ b/numpy/f2py/src/fortranobject.c
@@ -839,9 +839,10 @@ PyArrayObject* array_from_pyobj(const int type_num,
if ((intent & F2PY_INTENT_INOUT) ||
(intent & F2PY_INTENT_INPLACE) ||
(intent & F2PY_INTENT_CACHE)) {
- PyErr_SetString(PyExc_TypeError,
- "failed to initialize intent(inout|inplace|cache) "
- "array, input not an array");
+ PyErr_Format(PyExc_TypeError,
+ "failed to initialize intent(inout|inplace|cache) "
+ "array, input '%s' object is not an array",
+ Py_TYPE(obj)->tp_name);
return NULL;
}