()
| 536 | # Issue #23140: cancel Process.wait() |
| 537 | |
| 538 | async def cancel_wait(): |
| 539 | proc = await asyncio.create_subprocess_exec(*PROGRAM_BLOCKED) |
| 540 | |
| 541 | # Create an internal future waiting on the process exit |
| 542 | task = self.loop.create_task(proc.wait()) |
| 543 | self.loop.call_soon(task.cancel) |
| 544 | try: |
| 545 | await task |
| 546 | except asyncio.CancelledError: |
| 547 | pass |
| 548 | |
| 549 | # Cancel the future |
| 550 | task.cancel() |
| 551 | |
| 552 | # Kill the process and wait until it is done |
| 553 | proc.kill() |
| 554 | await proc.wait() |
| 555 | |
| 556 | self.loop.run_until_complete(cancel_wait()) |
| 557 |
nothing calls this directly
no test coverage detected