workflow.py 文件源码

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

项目:alfred-mpd 作者: deanishe 项目源码 文件源码
def _validate_lockfile(self):
        """Check existence and validity of lockfile.

        If the lockfile exists, but contains an invalid PID
        or the PID of a non-existant process, it is removed.

        """
        try:
            with open(self.lockfile) as fp:
                s = fp.read()
        except Exception:
            return

        try:
            pid = int(s)
        except ValueError:
            return self.release()

        from background import _process_exists
        if not _process_exists(pid):
            self.release()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号