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
portalocker.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录