Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 34d7bee

Browse files
committed
Merge pull request #4315 from charris/fix-gh-2408
BUG: #2408, Fix f2py Python 3 error message string bug.
2 parents d54b678 + 1b83d85 commit 34d7bee

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

numpy/f2py/src/fortranobject.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -741,14 +741,12 @@ PyArrayObject* array_from_pyobj(const int type_num,
741741
return arr;
742742
}
743743

744-
if ((intent & F2PY_INTENT_INOUT)
745-
|| (intent & F2PY_INTENT_INPLACE)
746-
|| (intent & F2PY_INTENT_CACHE)) {
747-
sprintf(mess,"failed to initialize intent(inout|inplace|cache) array"
748-
" -- input must be array but got %s",
749-
PyString_AsString(PyObject_Str(PyObject_Type(obj)))
750-
);
751-
PyErr_SetString(PyExc_TypeError,mess);
744+
if ((intent & F2PY_INTENT_INOUT) ||
745+
(intent & F2PY_INTENT_INPLACE) ||
746+
(intent & F2PY_INTENT_CACHE)) {
747+
PyErr_SetString(PyExc_TypeError,
748+
"failed to initialize intent(inout|inplace|cache) "
749+
"array, input not an array");
752750
return NULL;
753751
}
754752

0 commit comments

Comments
 (0)