diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2024-05-01 11:01:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-01 11:01:16 (GMT) |
commit | c1bf4874c1e9db2beda1d62c8c241229783c789b (patch) | |
tree | 9a03e0d5d1e32979489f84319484e7a62e0ed352 /Include | |
parent | f6fab21721c8aedc5dca97dbeb6292a067c19bf1 (diff) | |
download | cpython-c1bf4874c1e9db2beda1d62c8c241229783c789b.zip cpython-c1bf4874c1e9db2beda1d62c8c241229783c789b.tar.gz cpython-c1bf4874c1e9db2beda1d62c8c241229783c789b.tar.bz2 |
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.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/code.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h index b0e226e..ef8f930 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -226,7 +226,7 @@ struct PyCodeObject _PyCode_DEF(1); */ #define PY_PARSER_REQUIRES_FUTURE_KEYWORD -#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */ +#define CO_MAXBLOCKS 21 /* Max static block nesting within a function */ PyAPI_DATA(PyTypeObject) PyCode_Type; |