autoreload.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:spichi 作者: ifkite 项目源码 文件源码
def wait_child(pid):
    while True:
        try:
            # wait for child process
            wpid, sts = os.waitpid(pid, 0)
        except KeyboardInterrupt:
            # handle exceptions when parent is waiting
            handle_parent_exit(pid)

        # if child process stopped
        if os.WIFSTOPPED(sts):
            continue
        # if receive keybord interuption or kill signal
        elif os.WIFSIGNALED(sts):
            return sts
        # seems not work
        elif os.WIFEXITED(sts):
            return sts
        else:
            raise "Not stopped, signaled or exited???"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号