Your IP : 3.138.134.163


Current Path : /opt/alt/python37/lib/python3.7/site-packages/filelock/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/filelock/__pycache__/_windows.cpython-37.pyc

B

���a��@s�ddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ejd	kr|ddlZGd
d�de�ZnGdd�dee�ZdgZdS)
�)�annotationsN)�ABC)�ENOENT)�cast�)�BaseFileLock)�raise_on_exist_ro_file�win32c@s,eZdZdZdd�dd�Zdd�dd�ZdS)	�WindowsFileLockzWUses the :func:`msvcrt.locking` function to hard lock the lock file on windows systems.�None)�returnc
Cs�t|j�tjtjBtjB}yt�|j|�}Wn.tk
r\}z|jt	krL�Wdd}~XYn<Xyt
�|t
jd�Wntk
r�t�
|�YnX||_dS)Nr)r�
_lock_file�os�O_RDWR�O_CREAT�O_TRUNC�open�OSError�errnor�msvcrt�lockingZLK_NBLCK�close�
_lock_file_fd)�self�mode�fd�	exception�r�B/opt/alt/python37/lib/python3.7/site-packages/filelock/_windows.py�_acquires

zWindowsFileLock._acquirecCsVtt|j�}d|_t�|tjd�t�|�yt�|j	�Wnt
k
rPYnXdS)Nr)r�intrrrZLK_UNLCKrr�remover
r)rrrrr�_release&s
zWindowsFileLock._releaseN)�__name__�
__module__�__qualname__�__doc__rr"rrrrr
sr
c@seZdZdZdS)r
zWUses the :func:`msvcrt.locking` function to hard lock the lock file on windows systems.N)r#r$r%r&rrrrr
4s)�
__future__rr�sys�abcrrr�typingrZ_apirZ_utilr�platformrr
�__all__rrrr�<module>s
%

?>