Skip to content

gh-131666: mark anext_awaitable.close as a METH_NOARGS instead of METH_VARARGS #131671

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

Merged

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Mar 24, 2025

It's not really an issue because the underlying coroutine wrapper will raise a TypeError, so there won't be a different exception raised now. It's just that instead of "coroutine_wrapper.close taskes no argument", we have "anext_awaitable.close takes no argument".

@kumaraditya303 kumaraditya303 merged commit 1393bd3 into python:main Mar 25, 2025
46 checks passed
@picnixz picnixz deleted the fix/await/anextawaitable-close-131666 branch March 25, 2025 05:21
return self

anext_awaitable = anext(A(), "a").__await__()
self.assertRaises(TypeError, anext_awaitable.close, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

this results in an unawaited coroutine warning

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed here #131708

diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 1, 2025
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants