def _checkpg(pid): """ Checks if any members of a process group are alive. """ try: os.killpg(pid, 0) return True except OSError: return False