summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-21 14:04:43 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-21 14:04:43 (GMT)
commitefde146b0c42f2643f96d00896c99a90d501fb69 (patch)
treeccb5f7484b0c55bf005ec9b5eb80558d8adb7e46 /Python/ceval.c
parent6921c13bbbb2c9695edd87331d98f7aa1e48f7f2 (diff)
downloadcpython-efde146b0c42f2643f96d00896c99a90d501fb69.zip
cpython-efde146b0c42f2643f96d00896c99a90d501fb69.tar.gz
cpython-efde146b0c42f2643f96d00896c99a90d501fb69.tar.bz2
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.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 25fbc0f..d68cdc6 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3253,7 +3253,7 @@ exit_eval_frame:
f->f_executing = 0;
tstate->frame = f->f_back;
- return _Py_CheckFunctionResult(retval, "PyEval_EvalFrameEx");
+ return _Py_CheckFunctionResult(NULL, retval, "PyEval_EvalFrameEx");
}
static void
@@ -4251,14 +4251,14 @@ call_function(PyObject ***pp_stack, int oparg
if (flags & METH_NOARGS && na == 0) {
C_TRACE(x, (*meth)(self,NULL));
- x = _Py_CheckFunctionResult(x, "call_function");
+ x = _Py_CheckFunctionResult(func, x, NULL);
}
else if (flags & METH_O && na == 1) {
PyObject *arg = EXT_POP(*pp_stack);
C_TRACE(x, (*meth)(self,arg));
Py_DECREF(arg);
- x = _Py_CheckFunctionResult(x, "call_function");
+ x = _Py_CheckFunctionResult(func, x, NULL);
}
else {
err_args(func, flags, na);