Commit ae3a2eb
Handle CO_ITERABLE_COROUTINE flag in anext_awaitable
Generators decorated with @types.coroutine have the CO_ITERABLE_COROUTINE
flag and can be used in await expressions. The PyAnextAwaitable's
get_awaitable_iter method was missing this check, causing builtin anext()
to fail with "object generator can't be used in 'await' expression" when
used with such generators.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent be354cd commit ae3a2eb
1 file changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
595 | 613 | | |
596 | 614 | | |
597 | 615 | | |
| |||
0 commit comments