def unlock(file):
hfile = win32file._get_osfhandle(file.fileno())
try:
win32file.UnlockFileEx(hfile, 0, nNumberOfBytesToLockHigh, __overlapped)
except pywintypes.error as exc_value:
if exc_value.winerror == 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
portalocker.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录