def kill_process(pid: int) -> None:
                """Callback to kill a process.

                This callback implementation would be ineffective and unsafe on Windows.
                """
                p = Popen(["ps", "--ppid", str(pid)], stdout=PIPE)
                child_pids = []
                if p.stdout is not None:
                    for line in p.stdout:
                        if len(line.split()) > 0:
                            local_pid = (line.split())[0]
                            if local_pid.isdigit():
                                child_pids.append(int(local_pid))
                try:
                    os.kill(pid, signal.SIGKILL)
                    for child_pid in child_pids:
                        try:
                            os.kill(child_pid, signal.SIGKILL)
                        except OSError:
                            pass
                    # Tell the main routine that the process was killed.
                    kill_check.set()
                except OSError:
                    # It is possible that the process gets completed in the duration
                    # after timeout happens and before we try to kill the process.
                    pass
                return
Callback to kill a process.

                This callback implementation would be ineffective and unsafe on Windows.
                
git/cmd.py