mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +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
|
|
@ -3143,8 +3143,7 @@ init_dump_ascii_wstr(const wchar_t *str)
|
|||
void
|
||||
_Py_DumpPathConfig(PyThreadState *tstate)
|
||||
{
|
||||
PyObject *exc_type, *exc_value, *exc_tb;
|
||||
_PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb);
|
||||
PyObject *exc = _PyErr_GetRaisedException(tstate);
|
||||
|
||||
PySys_WriteStderr("Python path configuration:\n");
|
||||
|
||||
|
|
@ -3202,5 +3201,5 @@ _Py_DumpPathConfig(PyThreadState *tstate)
|
|||
PySys_WriteStderr(" ]\n");
|
||||
}
|
||||
|
||||
_PyErr_Restore(tstate, exc_type, exc_value, exc_tb);
|
||||
_PyErr_SetRaisedException(tstate, exc);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue