Commit cd4bf33
gh-143055: address review (fix throw() arity crash, doc precision)
- async_gen_unpack_throw: validate arity with _PyArg_CheckPositional so that
calling throw() with no arguments on the internal wrapper (reachable via
ag_await while suspended at the delegation) raises TypeError instead of
crashing the interpreter via gen_set_exception(NULL, ...).
- Correct the whatsnew/NEWS/reference wording: an async generator
expression's aclose() throws GeneratorExit into the sub-iterator via its
throw(), rather than calling close().
- Add a regression test for the throw() arity check.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent c1e0905 commit cd4bf33
5 files changed
Lines changed: 31 additions & 13 deletions
File tree
- Doc
- reference
- whatsnew
- Lib/test
- Misc/NEWS.d/next/Core_and_Builtins
- Objects
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
898 | | - | |
899 | | - | |
900 | | - | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
901 | 902 | | |
902 | 903 | | |
903 | 904 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
904 | 918 | | |
905 | 919 | | |
906 | 920 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2351 | 2351 | | |
2352 | 2352 | | |
2353 | 2353 | | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
2354 | 2357 | | |
2355 | 2358 | | |
2356 | 2359 | | |
| |||
2361 | 2364 | | |
2362 | 2365 | | |
2363 | 2366 | | |
2364 | | - | |
| 2367 | + | |
2365 | 2368 | | |
2366 | 2369 | | |
2367 | 2370 | | |
| |||
0 commit comments