__init__.py 文件源码

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

项目:pifpaf 作者: jd 项目源码 文件源码
def _kill(self, process):
        try:
            process.terminate()
        except ProcessLookupError:
            # Python 3
            return
        except OSError as e:
            if e.errno != errno.ESRCH:
                raise
            return
        try:

            self._wait(process)
        except tenacity.RetryError:
            LOG.warning("PID %d didn't terminate cleanly after 10 seconds, "
                        "sending SIGKILL to its process group", process.pid)
            # Cleanup remaining processes
            try:
                pgrp = os.getpgid(process.pid)
            except OSError as e:
                # ESRCH is returned if process just died in the meantime
                if e.errno != errno.ESRCH:
                    raise
            else:
                os.killpg(pgrp, signal.SIGKILL)
        process.wait()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号