Issue #23571: _Py_CheckFunctionResult() now gives the name of the function

which returned an invalid result (result+error or no result without error) in
the exception message.

Add also unit test to check that the exception contains the name of the
function.

Special case: the final _PyEval_EvalFrameEx() check doesn't mention the
function since it didn't execute a single function but a whole frame.
This commit is contained in:
Victor Stinner 2015-03-21 15:04:43 +01:00
parent 6921c13bbb
commit efde146b0c
6 changed files with 93 additions and 12 deletions

View file

@ -142,7 +142,7 @@ PyCFunction_Call(PyObject *func, PyObject *args, PyObject *kwds)
}
}
return _Py_CheckFunctionResult(res, "PyCFunction_Call");
return _Py_CheckFunctionResult(func, res, NULL);
}
/* Methods (the standard built-in methods, that is) */