portalocker.py 文件源码

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

项目:python-agent 作者: sandabuliu 项目源码 文件源码
def unlock(file):
        hfile = win32file._get_osfhandle(_getfd(file))
        try:
            win32file.UnlockFileEx(hfile, 0, -0x10000, __overlapped)
        except pywintypes.error, exc_value:
            if exc_value[0] == 158:
                # error: (158, 'UnlockFileEx', 'The segment is already unlocked.')
                # To match the 'posix' implementation, silently ignore this error
                pass
            else:
                # Q:  Are there exceptions/codes we should be dealing with here?
                raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号