Commit b76dde1
Try __await__ method for generator subclasses in anext_awaitable
For generators without CO_ITERABLE_COROUTINE flag, try to get __await__
method instead of returning an error immediately. This matches CPython's
_PyCoro_GetAwaitableIter behavior which allows generator subclasses that
define __await__ to be used in await expressions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent ae3a2eb commit b76dde1
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
607 | 611 | | |
608 | 612 | | |
609 | 613 | | |
| |||
0 commit comments