client.py 文件源码

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

项目:PenguinDome 作者: quantopian 项目源码 文件源码
def poll(self, timeout=None):
        if self.pending_data:
            return True
        if self.done:
            raise EOFError('Child process is done')
        if timeout is None:
            timeout = 0
        while True:
            try:
                self.child.expect(r'.', timeout=timeout)
            except pexpect.TIMEOUT:
                return True if self.pending_data else False
            except pexpect.EOF:
                self.pending_data += self.child.before
                self.done = True
                if self.pending_data:
                    return True
                raise EOFError('Child process is done')
            else:
                self.pending_data += self.child.before + self.child.after
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号