debugger.py 文件源码

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

项目:python-ptrace 作者: vstinner 项目源码 文件源码
def _wait_event_pid(self, wanted_pid, blocking=True):
        """
        Wait for a process event from the specified process identifier. If
        blocking=False, return None if there is no new event, otherwise return
        an object based on ProcessEvent.
        """
        process = None
        while not process:
            try:
                pid, status = self._waitpid(wanted_pid, blocking)
            except OSError as err:
                if err.errno == ECHILD:
                    process = self.dict[wanted_pid]
                    return process.processTerminated()
                else:
                    raise err
            if not blocking and not pid:
                return None
            try:
                process = self.dict[pid]
            except KeyError:
                warning("waitpid() warning: Unknown PID %r" % pid)
        return process.processStatus(status)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号