diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-12-05 13:26:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-05 13:26:44 +0200 |
commit | 1783e6fc437f34af1d652cbae36a68abcbf41fbc (patch) | |
tree | 4bce264cfcafca39df9fe41fa96d6a009017523e /numpy/f2py/src/fortranobject.c | |
parent | 9a79803e5edd0819bfa4c19a3442f75209fee5ec (diff) | |
parent | 3c6bbd7b43bf584aeef780a9e42acf2ecce7b179 (diff) | |
download | numpy-1783e6fc437f34af1d652cbae36a68abcbf41fbc.tar.gz |
Merge pull request #15022 from eric-wieser/better-f2py-error
ENH: f2py: improve error messages
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; } |