]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
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 11:01:16 +0000 (12:01 +0100)
committerGitHub <noreply@github.com>
Wed, 1 May 2024 11:01:16 +0000 (13:01 +0200)
commitc1bf4874c1e9db2beda1d62c8c241229783c789b
tree9a03e0d5d1e32979489f84319484e7a62e0ed352
parentf6fab21721c8aedc5dca97dbeb6292a067c19bf1
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.
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