npm.py 文件源码

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

项目:bridge-test 作者: Half-Shot 项目源码 文件源码
def __read_process_stream(self, proc, kill_after=None):
        timedOut = False
        outS = ""
        errS = ""
        try:
            outs, errs = proc.communicate(timeout=kill_after)
            outS = outs.decode()
            errS = errs.decode()
        except subprocess.TimeoutExpired as e:
            proc.terminate()
            proc.wait()
            if e.stdout is not None:
                outS = e.stdout.decode()
            if e.stderr is not None:
                errS = e.stderr.decode()
            timedOut = True
        logger.debug("%s was terminated", str(" ".join(proc.args)))
        return (outS, errS, timedOut)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号