MCPcopy Index your code
hub / github.com/python/cpython / cancel_wait

Method cancel_wait

Lib/test/test_asyncio/test_subprocess.py:538–554  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

create_taskMethod · 0.45
waitMethod · 0.45
call_soonMethod · 0.45
cancelMethod · 0.45
killMethod · 0.45

Tested by

no test coverage detected