]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] 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:52 +0000 (11:12 +0200)
committerGitHub <noreply@github.com>
Tue, 10 Oct 2023 09:12:52 +0000 (11:12 +0200)
commit2b3a4182798bc95a426e55d1f9f7199e2f2b5662
tree26918761ea6e7a47e5e03de150d21065b3d15763
parentd099defc63681a9134771f768059066116122599
[3.11] gh-110378: Close invalid generators in contextmanager and asynccontextmanager (GH-110499) (#110589)

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>
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Lib/contextlib.py
Lib/test/test_contextlib.py
Misc/NEWS.d/next/Library/2023-10-07-13-50-12.gh-issue-110378.Y4L8fl.rst [new file with mode: 0644]