This is terribly slow and has different results (I'm not killing the process, I'm just emitting signals).

<pre>
def signal_pid(pid, sig):
    """
    Sends a signal to a process id. Returns True if the process terminated
    successfully, False otherwise.
    """
    try:
        os.kill(pid, sig)
    except OSError:
        # The process may have died before we could kill it.
        pass

    for i in range(5):
        if not pid_is_alive(pid):
            return True
        time.sleep(1)

    # The process is still alive
    return False
</pre>

If you really hate this so much, I can get the pid by `process.process_id` and use `os.kill()` directly. It's still a bit slower, but hopefully quick enough to catch some bad signal handling.