Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
classMyExc(Exception):passimportitertoolsasyncdefagenfn():foriinitertools.count():try:yieldiexceptMyExc:passagen=agenfn()try:agen.asend(None).send(None)exceptStopIterationase:print(f"{e.value=}")athrow=agen.athrow(MyExc)try:athrow.throw(MyExc)exceptStopIterationase:print(f"{e.value=}")try:athrow.throw(MyExc)exceptRuntimeError:print("good")exceptStopIterationase:print(f"bad{e.value=}")
outputs:
e.value=0e.value=1bad e.value=2should output:
e.value=0e.value=1goodCPython versions tested on:
3.8, 3.9, 3.10, 3.11, 3.12, 3.13, CPython main branch
Operating systems tested on:
Linux