mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +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
|
@ -18,6 +18,8 @@ PyAPI_FUNC(PyObject *) PyErr_Occurred(void);
|
|||
PyAPI_FUNC(void) PyErr_Clear(void);
|
||||
PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
|
||||
PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
|
||||
PyAPI_FUNC(PyObject *) PyErr_GetRaisedException(void);
|
||||
PyAPI_FUNC(void) PyErr_SetRaisedException(PyObject *);
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030b0000
|
||||
PyAPI_FUNC(PyObject*) PyErr_GetHandledException(void);
|
||||
PyAPI_FUNC(void) PyErr_SetHandledException(PyObject *);
|
||||
|
@ -51,6 +53,10 @@ PyAPI_FUNC(void) PyException_SetCause(PyObject *, PyObject *);
|
|||
PyAPI_FUNC(PyObject *) PyException_GetContext(PyObject *);
|
||||
PyAPI_FUNC(void) PyException_SetContext(PyObject *, PyObject *);
|
||||
|
||||
|
||||
PyAPI_FUNC(PyObject *) PyException_GetArgs(PyObject *);
|
||||
PyAPI_FUNC(void) PyException_SetArgs(PyObject *, PyObject *);
|
||||
|
||||
/* */
|
||||
|
||||
#define PyExceptionClass_Check(x) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue