gipc.py 文件源码

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

项目:gipc 作者: jgehrcke 项目源码 文件源码
def _validate(self):
        """Raise exception if this handle is closed or not registered to be
        used in the current process.

        Intended to be called before every operation on `self._fd`.
        Reveals wrong usage of this module in the context of multiple
        processes. Might prevent tedious debugging sessions. Has little
        performance impact.
        """
        if self._closed:
            raise GIPCClosed(
                "GIPCHandle has been closed before.")
        if os.getpid() != self._legit_pid:
            raise GIPCError(
                "GIPCHandle %s not registered for current process %s." % (
                    self, os.getpid()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号