Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-143939: Fix assignment to_PyThreadStateImpl.generator_return_kind#143951
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…n_kindThe assignment to generator_return_kind has to be after any potentiallyescaping calls or it might be overwritten.
| class CallGeneratorOnDealloc: | ||
| def __del__(self): | ||
| def gen(): | ||
| yield 1 | ||
| next(gen()) | ||
| async def coro(): | ||
| obj = CallGeneratorOnDealloc() | ||
| return 42 |
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.
A little bit smaller in size:
| classCallGeneratorOnDealloc: | |
| def__del__(self): | |
| defgen(): | |
| yield1 | |
| next(gen()) | |
| asyncdefcoro(): | |
| obj=CallGeneratorOnDealloc() | |
| return42 | |
| classCallGeneratorOnDealloc: | |
| def__del__(self): | |
| next(xforxin [42]) | |
| asyncdefcoro(): | |
| obj=CallGeneratorOnDealloc() |
kumaraditya303 left a comment
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.
LGTM
43bb630 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
The assignment to generator_return_kind must be after any potentially escaping calls to ensure that it's not overwritten.