SIGN IN SIGN UP

gh-111085: Fix invalid state handling in TaskGroup and Timeout (#111111)

asyncio.TaskGroup and asyncio.Timeout classes now raise proper RuntimeError
if they are improperly used.

* When they are used without entering the context manager.
* When they are used after finishing.
* When the context manager is entered more than once (simultaneously or
  sequentially).
* If there is no current task when entering the context manager.

They now remain in a consistent state after an exception is thrown,
so subsequent operations can be performed correctly (if they are allowed).

Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
S
Serhiy Storchaka committed
6c23635f2b7067ef091a550954e09f8b7c329e3f
Parent: fd60549
Committed by GitHub <noreply@github.com> on 10/21/2023, 7:18:34 PM