Perfect your code
With built-in code review tools, GitHub makes it easy to raise the quality bar before you ship. Join the 40 million developers who've merged over 200 million pull requests.
Sign up for free See pricing for teams and enterprisesbpo-39386: Prevent double awaiting of async iterator #18081
Conversation
This comment has been minimized.
This comment has been minimized.
@1st1 would be very nice if you can find time for the PR review. |
This comment has been minimized.
This comment has been minimized.
@njsmith I appreciate your review as well |
This comment has been minimized.
This comment has been minimized.
LGTM, Andrew. Thank you. |
a96e06d
into
python:master
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jan 20, 2020
Thanks @asvetlov for the PR |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 20, 2020
GH-18086 is a backport of this pull request to the 3.8 branch. |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 20, 2020
GH-18087 is a backport of this pull request to the 3.7 branch. |
This comment has been minimized.
This comment has been minimized.
Would it be redundant to explicitly test For example: def test_async_gen_await_asend_twice(self):
async def async_iterate():
yield 1
yield 2
async def run():
it = async_iterate()
nxt = it.asend(None)
await nxt
with self.assertRaisesRegex(
RuntimeError,
r"cannot reuse already awaited __anext__\(\)/asend\(\)"
):
await nxt
self.loop.run_until_complete(run()) This seems effectively covered by Otherwise, LGTM. |
This comment has been minimized.
This comment has been minimized.
Oh oops, looks like I was typing that just as it was being reviewed by Yury, never mind. |
This comment has been minimized.
This comment has been minimized.
@aeros sorry, I've pressed "Merge" button before reading your message. |
This comment has been minimized.
This comment has been minimized.
@asvetlov No worries! It was more of an afterthought than anything, and I don't think it will have a significant impact on the long-term stability if we don't include the explicit |
asvetlov commentedJan 20, 2020
•
edited by bedevere-bot
https://bugs.python.org/issue39386