]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-116767: fix crash on 'async with' with many context managers (GH-118348...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Wed, 1 May 2024 17:23:29 +0000 (18:23 +0100)
committerGitHub <noreply@github.com>
Wed, 1 May 2024 17:23:29 +0000 (18:23 +0100)
commitebef3c5ba48aa4d5bdf8c02aba6c6356aef9d56b
tree7d4a2979efa2dbd1d33b4c1d33fb1a533579e1e5
parentf5406ef454662b98df107775d18ff71ae6849618
[3.12] gh-116767: fix crash on 'async with' with many context managers (GH-118348) (#118477)

gh-116767: fix crash on 'async with' with many context managers (GH-118348)

Account for `add_stopiteration_handler` pushing a block for `async with`.
To allow generator functions that previously almost hit the `CO_MAXBLOCKS`
limit by nesting non-async blocks, the limit is increased by 1.
This increase allows one more block in non-generator functions.

(cherry picked from commit c1bf4874c1e9db2beda1d62c8c241229783c789b)
Include/cpython/code.h
Lib/test/test_syntax.py
Misc/NEWS.d/next/Core and Builtins/2024-04-27-16-23-29.gh-issue-116767.z9UFpr.rst [new file with mode: 0644]
Python/compile.c