-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
bpo-29587: Enable implicit exception chaining with gen.throw() #19811
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dcbad16
to
b377e49
Compare
Before this commit, if an exception was active inside a generator when calling gen.throw(), then that exception was lost (i.e. there was no implicit exception chaining). This commit fixes that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I think we should just land this -- if there's something wrong with it we'll shake it out during beta, but it looks likely that it's correct. Thanks for fixing this old bug!
Closing and reopening to re-trigger Azures CI build (that was unstable a while ago, should be better now). |
Whatever; the required tests pass, as do the non-Azure tests. I'll just land. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
All these tests pass for me locally, except test_idle which fails because I don't have the right Tcl/Tk installed. What to do? |
It seems like this change broke tons of buildbots, whereas tests passed on the PR, except on the Ubuntu job of Azure Pipelines.
Either fix it, or revert it. Depending on your availability :-) |
|
|
|
|
|
Before this commit, if an exception was active inside a generator when calling gen.throw(), then that exception was lost (i.e. there was no implicit exception chaining). This commit fixes that.
This enables implicit exception chaining when calling
generator.throw(exc)
by settingexc.__context__
.This is a naive attempt at fixing this, so I could very well be missing something.
https://bugs.python.org/issue29587