Viewing File: /opt/hc_python/lib/python3.12/site-packages/filelock/__pycache__/_soft.cpython-312.pyc

�

`��g����ddlmZddlZddlZddlmZddlmZmZddl	m
Z
ddlmZddl
mZmZGd	�d
e�Zd
gZy)�)�annotationsN)�suppress)�EACCES�EEXIST)�Path�)�BaseFileLock)�ensure_directory_exists�raise_on_not_writable_filec� �eZdZdZdd�Zdd�Zy)�SoftFileLockz.Simply watches the existence of the lock file.c��t|j�t|j�tjtj
ztjztjz}	tj|j||jj�}||j_y#t$rI}|jtk(s,|jtk(rt j"dk(s�Yd}~yYd}~yd}~wwxYw)N�win32)r�	lock_filer
�os�O_WRONLY�O_CREAT�O_EXCL�O_TRUNC�open�_context�mode�lock_file_fd�OSError�errnorr�sys�platform)�self�flags�file_handler�	exceptions    �=/opt/hc_python/lib/python3.12/site-packages/filelock/_soft.py�_acquirezSoftFileLock._acquires���"�4�>�>�2�����/�
�K�K��j�j�
��i�i�
��j�j�
�	�		6��7�7�4�>�>�5�$�-�-�:L�:L�M�L�*6�D�M�M�&���	����6�)��O�O�v�-�#�,�,�'�2I��3J�*��	�s�/5B6�6	D�?:D�Dc�6�|jj�J�tj|jj�d|j_t	t
�5t
|j�j�ddd�y#1swYyxYw)N)	rrr�closerrrr�unlink)rs r"�_releasezSoftFileLock._release%sc���}�}�)�)�5�5�5�
������+�+�,�%)��
�
�"�
�g�
����� �'�'�)��
�
�s�"$B�BN)�return�None)�__name__�
__module__�__qualname__�__doc__r#r'��r"r
r

s��8�6�**r/r
)�
__future__rrr�
contextlibrrrr�pathlibr�_apir	�_utilr
rr
�__all__r.r/r"�<module>r6s6��"�	�
�� ���F�*�<�*�B��r/
Back to Directory File Manager