We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
assignee = 'https://github.com/iritkatriel'
closed_at = None
created_at = <Date 2022-01-11.12:43:40.822>
labels = ['interpreter-core', 'expert-C-API', 'type-feature', '3.11']
title = 'Add PyErr_GetActiveException and PyErr_SetActiveException'
updated_at = <Date 2022-03-18.14:05:02.526>
user = 'https://github.com/iritkatriel'
activity = <Date 2022-03-18.14:05:02.526>
actor = 'iritkatriel'
assignee = 'iritkatriel'
closed = False
closed_date = None
closer = None
components = ['Interpreter Core', 'C API']
creation = <Date 2022-01-11.12:43:40.822>
creator = 'iritkatriel'
dependencies = 
files = 
hgrepos = 
issue_num = 46343
keywords = ['patch']
message_count = 5.0
messages = ['410299', '410312', '410318', '415491', '415498']
nosy_count = 3.0
nosy_names = ['asvetlov', 'eric.snow', 'iritkatriel']
pr_nums = ['30531']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue46343'
versions = ['Python 3.11']
The text was updated successfully, but these errors were encountered:
Following the removal of exc_type and exc_traceback from the interpreter's active exception in bpo-45711, 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 bpo-46328 re the corresponding change in the sys module.
Sorry, something went wrong.
Why not PyAPI_FUNC(PyObject *) PyErr_GetActiveException(void);?
PyAPI_FUNC(PyObject *) PyErr_GetActiveException(void);
Yes, you’re right of course ;)
I have a side question.
generator.throw() and coroutine.throw() have throw(type[, value[, traceback]]) signature.
Is there a plan to update generators somehow to accept the exception value only?
The change can go in line with other exception API changes.
We should make throw accept an exception instance, the same thing was done in the traceback module.
gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (…
No branches or pull requests