mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #23571: PyObject_Call(), PyCFunction_Call() and call_function() now
raise a SystemError if a function returns a result and raises an exception. The SystemError is chained to the previous exception. Refactor also PyObject_Call() and PyCFunction_Call() to make them more readable. Remove some checks which became useless (duplicate checks). Change reviewed by Serhiy Storchaka.
This commit is contained in:
parent
d81431f587
commit
4a7cc88472
7 changed files with 129 additions and 100 deletions
|
@ -680,11 +680,7 @@ static void
|
|||
_set_BlockingIOError(char *msg, Py_ssize_t written)
|
||||
{
|
||||
PyObject *err;
|
||||
#ifdef Py_DEBUG
|
||||
/* in debug mode, PyEval_EvalFrameEx() fails with an assertion error
|
||||
if an exception is set when it is called */
|
||||
PyErr_Clear();
|
||||
#endif
|
||||
err = PyObject_CallFunction(PyExc_BlockingIOError, "isn",
|
||||
errno, msg, written);
|
||||
if (err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue