def reap_zombies() -> None:
    """
    A SIGCHLD handler that reaps all zombies until there are no more.
    """
    try:
        # One signal might mean mulitple children have exited. Reap everything
        # that has exited, until there's nothing left.
        while True:
            wait_result = os.waitid(os.P_ALL, 0, os.WEXITED | os.WNOHANG)
            if wait_result is None:
                return
    except ChildProcessError:
        pass

    A SIGCHLD handler that reaps all zombies until there are no more.
    
libqtile/utils.py