portalocker.py 文件源码

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

项目:concurrent-log-handler 作者: Preston-Landers 项目源码 文件源码
def lock(file, flags):
        hfile = win32file._get_osfhandle(file.fileno())
        try:
            win32file.LockFileEx(hfile, flags, 0, nNumberOfBytesToLockHigh, __overlapped)
        except pywintypes.error as exc_value:
            # error: (33, 'LockFileEx', 'The process cannot access the file because another
            # process has locked a portion of the file.')
            if exc_value.winerror == 33:
                raise LockException(str(exc_value))
            else:
                # Q:  Are there exceptions/codes we should be dealing with here?
                raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号