INNER CODE UNIT · Python

_terminate_windows_process_tree

lij768423-svg/grok-register-panel · batch_supervisor.py:130

def _terminate_windows_process_tree(
    process: subprocess.Popen,
    grace_seconds: float = 5.0,
    *,
    psutil_module=psutil,
) -> None:
    tracked = []
    try:
        root = psutil_module.Process(process.pid)
        tracked = root.children(recursive=True) + [root]
    except (psutil_module.Error, OSError):
        tracked = []

    ctrl_break = getattr(signal, "CTRL_BREAK_EVENT", None)
    if ctrl_break is not None:
        try:
            process.send_signal(ctrl_break)
        except (OSError, ValueError):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…