classification
Title: Add PyErr_GetActiveException and PyErr_SetActiveException
Type: enhancement Stage: patch review
Components: C API, Interpreter Core Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: iritkatriel Nosy List: eric.snow, iritkatriel
Priority: normal Keywords: patch

Created on 2022-01-11 12:43 by iritkatriel, last changed 2022-01-11 17:04 by iritkatriel.

Pull Requests
URL Status Linked Edit
PR 30531 open iritkatriel, 2022-01-11 13:09
Messages (3)
msg410299 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-11 12:43
Following the removal of exc_type and exc_traceback from the interpreter's active exception in issue45711, we can now provide simplified get-set functions in the C Api:

PyAPI_FUNC(void) PyErr_GetActiveException(PyObject **);
PyAPI_FUNC(void) PyErr_SetActiveException(PyObject *);

as alternatives to 

PyAPI_FUNC(void) PyErr_GetExcInfo(PyObject **, PyObject **, PyObject **);
PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *);

See also issue46328 re the corresponding change in the sys module.
msg410312 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2022-01-11 16:27
Why not `PyAPI_FUNC(PyObject *) PyErr_GetActiveException(void);`?
msg410318 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-11 17:04
Yes, you’re right of course ;)
History
Date User Action Args
2022-01-11 17:04:02iritkatrielsetmessages: + msg410318
2022-01-11 16:27:42eric.snowsetnosy: + eric.snow
messages: + msg410312
2022-01-11 13:09:08iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28733
2022-01-11 12:43:40iritkatrielcreate