]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-110378: Close invalid generators in contextmanager and asynccontextmanager...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 10 Oct 2023 09:12:28 +0000 (11:12 +0200)
committerGitHub <noreply@github.com>
Tue, 10 Oct 2023 09:12:28 +0000 (11:12 +0200)
commit2fc80814bf55445fb2cc56b25ec54d8e308e3408
tree20fd204c6a10e7c811bf4f27661c9dadea42dcf2
parent36886726a2fe9a2c8511cfb405704f39cf184d7c
[3.12] gh-110378: Close invalid generators in contextmanager and asynccontextmanager (GH-110499) (#110588)

contextmanager and asynccontextmanager context managers now close an invalid
underlying generator object that yields more then one value.
(cherry picked from commit 96fed66a65097eac2dc528ce29c9ba676bb07689)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/contextlib.py
Lib/test/test_contextlib.py
Lib/test/test_contextlib_async.py
Misc/NEWS.d/next/Library/2023-10-07-13-50-12.gh-issue-110378.Y4L8fl.rst [new file with mode: 0644]