mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-101578: Normalize the current exception (GH-101607)
* Make sure that the current exception is always normalized. * Remove redundant type and traceback fields for the current exception. * Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException * Add new API functions: PyException_GetArgs, PyException_SetArgs
This commit is contained in:
parent
027adf42cd
commit
feec49c407
29 changed files with 477 additions and 172 deletions
4
Python/generated_cases.c.h
generated
4
Python/generated_cases.c.h
generated
|
@ -1036,9 +1036,7 @@
|
|||
Py_DECREF(exc_value);
|
||||
}
|
||||
else {
|
||||
PyObject *exc_type = Py_NewRef(Py_TYPE(exc_value));
|
||||
PyObject *exc_traceback = PyException_GetTraceback(exc_value);
|
||||
_PyErr_Restore(tstate, exc_type, Py_NewRef(exc_value), exc_traceback);
|
||||
_PyErr_SetRaisedException(tstate, Py_NewRef(exc_value));
|
||||
goto exception_unwind;
|
||||
}
|
||||
STACK_SHRINK(2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue