()
| 505 | # Issue #23140: cancel Process.wait() |
| 506 | |
| 507 | async def cancel_wait(): |
| 508 | proc = await asyncio.create_subprocess_exec(*PROGRAM_BLOCKED) |
| 509 | |
| 510 | # Create an internal future waiting on the process exit |
| 511 | task = self.loop.create_task(proc.wait()) |
| 512 | self.loop.call_soon(task.cancel) |
| 513 | try: |
| 514 | await task |
| 515 | except asyncio.CancelledError: |
| 516 | pass |
| 517 | |
| 518 | # Cancel the future |
| 519 | task.cancel() |
| 520 | |
| 521 | # Kill the process and wait until it is done |
| 522 | proc.kill() |
| 523 | await proc.wait() |
| 524 | |
| 525 | self.loop.run_until_complete(cancel_wait()) |
| 526 |
nothing calls this directly
no test coverage detected