diff options
author | Nathaniel J. Smith <njs@pobox.com> | 2020-02-13 08:15:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-13 08:15:38 (GMT) |
commit | 925dc7fb1d0db85dc137afa4cd14211bf0d67414 (patch) | |
tree | c03ac2612f81cd6135dc9f084a491fb8663b260f /Misc | |
parent | 7514f4f6254f4a2d13ea8e5632a8e5f22b637e0b (diff) | |
download | cpython-925dc7fb1d0db85dc137afa4cd14211bf0d67414.zip cpython-925dc7fb1d0db85dc137afa4cd14211bf0d67414.tar.gz cpython-925dc7fb1d0db85dc137afa4cd14211bf0d67414.tar.bz2 |
bpo-39606: allow closing async generators that are already closed (GH-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:
https://github.com/python-trio/trio/pull/1396
https://bugs.python.org/issue39606
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2020-02-11-23-59-07.bpo-39606.a72Sxc.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-02-11-23-59-07.bpo-39606.a72Sxc.rst b/Misc/NEWS.d/next/Core and Builtins/2020-02-11-23-59-07.bpo-39606.a72Sxc.rst new file mode 100644 index 0000000..b7cbe4e --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-02-11-23-59-07.bpo-39606.a72Sxc.rst @@ -0,0 +1,2 @@ +Fix regression caused by fix for bpo-39386, that prevented calling +``aclose`` on an async generator that had already been closed or exhausted. |