MCPcopy Index your code
hub / github.com/RustPython/RustPython / cancel_wait

Method cancel_wait

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

Source from the content-addressed store, hash-verified

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

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