U e@sddlmZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z dd lmZmZejd krddlZGd d d e ZnGd d d e Zd gZdS)) annotationsN)suppress)EACCES)Path)cast) BaseFileLock)ensure_directory_existsraise_on_not_writable_filewin32c@s,eZdZdZddddZddddZdS) WindowsFileLockWUses the :func:`msvcrt.locking` function to hard lock the lock file on Windows systems.Nonereturnc Cst|jt|jtjtjBtjB}zt|j||jj }Wn.t k rl}z|j t kr\W5d}~XYnXXzt |t jdWn8t k r}zt||j t krW5d}~XYn X||j_dSNr)r lock_filer osO_RDWRO_CREATO_TRUNCopen_contextmodeOSErrorerrnormsvcrtlockingZLK_NBLCKclose lock_file_fd)selfflagsfd exceptionr$?/opt/hc_python/lib/python3.8/site-packages/filelock/_windows.py_acquires(     WindowsFileLock._acquirec CsVtt|jj}d|j_t|tjdt|t t t |j  W5QRXdSr)rintrrrrZLK_UNLCKrrrrrrunlink)r r"r$r$r%_release*s   WindowsFileLock._releaseN__name__ __module__ __qualname____doc__r&r*r$r$r$r%r sr c@s,eZdZdZddddZddddZdS) r r rrcCstdSNNotImplementedErrorr r$r$r%r&8sr'cCstdSr1r2r4r$r$r%r*;sr+Nr,r$r$r$r%r 5s) __future__rrsys contextlibrrrpathlibrtypingrZ_apirZ_utilr r platformrr __all__r$r$r$r%s       %