Skip to content
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

[3.8] bpo-39606: allow closing async generators that are already closed (GH-18475) #18501

Merged
merged 1 commit into from Feb 13, 2020

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Feb 13, 2020

The fix for bpo-39386 attempted to make it so you couldn't reuse a
agen.aclose() coroutine object. It accidentally also prevented you
from calling aclose() at all on an async generator that was already
closed or exhausted. This commit fixes it so we're only blocking the
actually illegal cases, while allowing the legal cases.

The new tests failed before this patch. Also confirmed that this fixes
the test failures we were seeing in Trio with Python dev builds:
python-trio/trio#1396

https://bugs.python.org/issue39606
(cherry picked from commit 925dc7f)

Co-authored-by: Nathaniel J. Smith njs@pobox.com

https://bugs.python.org/issue39606

Automerge-Triggered-By: @njsmith

…thonGH-18475)

The fix for [bpo-39386](https://bugs.python.org/issue39386) attempted to make it so you couldn't reuse a
agen.aclose() coroutine object. It accidentally also prevented you
from calling aclose() at all on an async generator that was already
closed or exhausted. This commit fixes it so we're only blocking the
actually illegal cases, while allowing the legal cases.

The new tests failed before this patch. Also confirmed that this fixes
the test failures we were seeing in Trio with Python dev builds:
  python-trio/trio#1396

https://bugs.python.org/issue39606
(cherry picked from commit 925dc7f)

Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
@miss-islington
Copy link
Contributor Author

@njsmith: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 8dbdf5f into python:3.8 Feb 13, 2020
@miss-islington miss-islington deleted the backport-925dc7f-3.8 branch February 13, 2020 08:43
@miss-islington
Copy link
Contributor Author

@njsmith: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington
Copy link
Contributor Author

@njsmith: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants