diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2019-12-01 16:13:14 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2019-12-01 16:45:11 +0000 |
commit | 6fa0ff8e56e7e09f0c1cdbce2da338be073947e9 (patch) | |
tree | 2a1173553a9929dce7188820af629906c3bd2b0d /numpy/f2py/src/fortranobject.c | |
parent | b83f10ef7ee766bf30ccfa563b6cc8f7fd38a4c8 (diff) | |
download | numpy-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.c | 7 |
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; } |