common.py 文件源码

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

项目:freeipa-pr-ci 作者: freeipa 项目源码 文件源码
def _terminate(self):
        if self.process is None:
            return
        try:
            parent = psutil.Process(pid=self.process.pid)
            procs = parent.children(recursive=True)
            procs.append(parent)
            for proc in procs:
                proc.terminate()
            gone, still_alive = psutil.wait_procs(
                procs,
                timeout=constants.POPEN_TERM_TIMEOUT)
            for proc in still_alive:
                proc.kill()
        except OSError as exc:
            if exc.errno != errno.ESRCH:
                # ESRCH -> process doesn't exist (already ended)
                raise exc
        except psutil.NoSuchProcess:
            pass  # probably ended already
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号