(loop, task)
| 959 | |
| 960 | |
| 961 | def _leave_task(loop, task): |
| 962 | current_task = _current_tasks.get(loop) |
| 963 | if current_task is not task: |
| 964 | raise RuntimeError(f"Leaving task {task!r} does not match " |
| 965 | f"the current task {current_task!r}.") |
| 966 | del _current_tasks[loop] |
| 967 | |
| 968 | |
| 969 | def _unregister_task(task): |