(task: asyncio.Task)
| 228 | current_task = asyncio.current_task() |
| 229 | |
| 230 | def cb(task: asyncio.Task) -> None: |
| 231 | if current_task: |
| 232 | current_task.remove_done_callback(cb) |
| 233 | if task.cancelled(): |
| 234 | self.future.cancel() |
| 235 | |
| 236 | if current_task: |
| 237 | current_task.add_done_callback(cb) |