Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
colesbury merged 2 commits intopython:mainfromcolesbury:gh-143939-coro-bug
Jan 20, 2026

Conversation

@colesbury
Copy link
Contributor

@colesburycolesbury commentedJan 17, 2026
edited by bedevere-appbot
Loading

The assignment to generator_return_kind must be after any potentially escaping calls to ensure that it's not overwritten.

…n_kindThe assignment to generator_return_kind has to be after any potentiallyescaping calls or it might be overwritten.
Comment on lines 2271 to 2279
class CallGeneratorOnDealloc:
def __del__(self):
def gen():
yield 1
next(gen())

async def coro():
obj = CallGeneratorOnDealloc()
return 42
Copy link
Member

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:

Suggested change
classCallGeneratorOnDealloc:
def__del__(self):
defgen():
yield1
next(gen())
asyncdefcoro():
obj=CallGeneratorOnDealloc()
return42
classCallGeneratorOnDealloc:
def__del__(self):
next(xforxin [42])
asyncdefcoro():
obj=CallGeneratorOnDealloc()

colesbury reacted with thumbs up emoji
Copy link
Contributor

@kumaraditya303kumaraditya303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@colesburycolesburyenabled auto-merge (squash)January 20, 2026 17:25
@colesburycolesburyenabled auto-merge (squash)January 20, 2026 17:26
@colesburycolesbury merged commit43bb630 intopython:mainJan 20, 2026
53 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@kumaraditya303kumaraditya303kumaraditya303 approved these changes

@johnslavikjohnslavikjohnslavik approved these changes

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@colesbury@kumaraditya303@johnslavik

[8]ページ先頭

©2009-2026 Movatter.jp