Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-111375: UseNULL
in the exception stack to indicate an exception was handled#113302
New issue
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-111375: UseNULL
in the exception stack to indicate an exception was handled#113302
Uh oh!
There was an error while loading.Please reload this page.
Conversation
NULL
in the exception stack to indicate an exception was handledNULL
in the exception stack to indicate an exception was handledPreviously, both `NULL` and `Py_None` would be used interchangeably toindicate that an exception is no longer being handled. By ensuring thatonly `NULL` is used, this opens up the possibility to use `Py_None` toindicate a cleared exception. The difference here would be that clearingwould indicate that no exception is currently being handled vs. handlingwould indicate that the next exception in the stack is currently beinghandled.This functionality will be used to patch up some edge cases in how theexception context interacts with exceptions thrown into coroutines.This is implemented in this commit by changing code that could add`Py_None` to the exception stack to indicate that an exception is nolonger being handled to add `NULL` instead. An assert was also added toensure that `Py_None` is no longer added to the exception stack.Seepythongh-111676 for context.
69ec652
toc62f8ae
CompareUh oh!
There was an error while loading.Please reload this page.
bedevere-bot commentedDec 20, 2023
🤖 New build scheduled with the buildbot fleet by@iritkatriel for commit4ac01c0 🤖 If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
I checked a couple of the failed builedbots and the failures seem unrelated (and also appear in the previous runs). But we should check all of them to be sure there's nothing new before merging. Some buildbots are still running. |
… to indicate that an exception was handled (python#113302)
… to indicate that an exception was handled (python#113302)
… to indicate that an exception was handled (python#113302)
… to indicate that an exception was handled (python#113302)
Uh oh!
There was an error while loading.Please reload this page.
Previously, both
NULL
andPy_None
would be used interchangeably to indicate that an exception is no longer being handled. By ensuring that onlyNULL
is used, this opens up the possibility to usePy_None
to indicate a cleared exception. The difference here would be that clearing would indicate that no exception is currently being handled vs. handling would indicate that the next exception in the stack is currently being handled.This functionality will be used to patch up some edge cases in how the exception context interacts with exceptions thrown into coroutines. See#111676 (comment) for context.
This is implemented in this commit by changing code that could add
Py_None
to the exception stack to indicate that an exception is no longer being handled to addNULL
instead. An assert was also added to ensure thatPy_None
is no longer added to the exception stack.Possible reviewers based on
git blame
:@iritkatriel ,@markshannon@contextmanager
function doesn't clearsys.exception()
#111375