We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class MyExc(Exception): pass import itertools async def agenfn(): for i in itertools.count(): try: yield i except MyExc: pass agen = agenfn() try: agen.asend(None).send(None) except StopIteration as e: print(f"{e.value=}") athrow = agen.athrow(MyExc) try: athrow.throw(MyExc) except StopIteration as e: print(f"{e.value=}") try: athrow.throw(MyExc) except RuntimeError: print("good") except StopIteration as e: print(f"bad {e.value=}")
outputs:
e.value=0 e.value=1 bad e.value=2
should output:
e.value=0 e.value=1 good
3.8, 3.9, 3.10, 3.11, 3.12, 3.13, CPython main branch
Linux
The text was updated successfully, but these errors were encountered:
GH-117536: GH-117894: fix athrow().throw(...) unawaited warning (GH-1…
7d369d4
…17851)
[3.12] GH-117894: prevent aclose()/athrow() being re-used after StopI…
fc1732c
…teration (GH-117851) (GH-118226) (cherry picked from commit 7d369d4)
No branches or pull requests
Bug report
Bug description:
outputs:
should output:
CPython versions tested on:
3.8, 3.9, 3.10, 3.11, 3.12, 3.13, CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: