Commit ebef3c5
authored
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 c1bf487)
1 parent f5406ef commit ebef3c5
File tree
4 files changed
+50
-7
lines changed- Include/cpython
- Lib/test
- Misc/NEWS.d/next/Core and Builtins
- Python
4 files changed
+50
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2269 | 2269 | | |
2270 | 2270 | | |
2271 | 2271 | | |
2272 | | - | |
| 2272 | + | |
| 2273 | + | |
2273 | 2274 | | |
2274 | | - | |
| 2275 | + | |
2275 | 2276 | | |
2276 | 2277 | | |
2277 | 2278 | | |
2278 | | - | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
2279 | 2306 | | |
2280 | 2307 | | |
2281 | 2308 | | |
| |||
2407 | 2434 | | |
2408 | 2435 | | |
2409 | 2436 | | |
2410 | | - | |
| 2437 | + | |
| 2438 | + | |
2411 | 2439 | | |
2412 | 2440 | | |
2413 | 2441 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
1546 | 1547 | | |
1547 | 1548 | | |
1548 | 1549 | | |
| 1550 | + | |
1549 | 1551 | | |
1550 | 1552 | | |
1551 | 1553 | | |
| |||
2235 | 2237 | | |
2236 | 2238 | | |
2237 | 2239 | | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
2238 | 2251 | | |
2239 | 2252 | | |
2240 | 2253 | | |
2241 | | - | |
| 2254 | + | |
2242 | 2255 | | |
2243 | 2256 | | |
2244 | 2257 | | |
2245 | 2258 | | |
| 2259 | + | |
2246 | 2260 | | |
2247 | 2261 | | |
2248 | 2262 | | |
| |||
0 commit comments