tahoe.py 文件源码

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

项目:tahoe-gui 作者: LeastAuthority 项目源码 文件源码
def stop(self):
        if not os.path.isfile(self.pidfile):
            print('No "twistd.pid" file found in {}'.format(self.nodedir))
            return
        with open(self.pidfile, 'r') as f:
            pid = f.read()
        pid = int(pid)
        print("Trying to kill PID {}...".format(pid))
        try:
            os.kill(pid, signal.SIGTERM)
        except OSError as err:
            print(err)
            if err.errno == errno.ESRCH or err.errno == errno.EINVAL:
                os.remove(self.pidfile)
            else:
                raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号