File: //home/arjun/projects/env/lib/python3.10/site-packages/filelock/__pycache__/_soft.cpython-310.pyc
o
!we� � @ sz d dl mZ d dlZd dlZd dlmZ d dlmZmZ d dl m
Z
ddlmZ ddl
mZmZ G d d
� d
e�Zd
gZdS )� )�annotationsN)�suppress)�EACCES�EEXIST)�Path� )�BaseFileLock)�ensure_directory_exists�raise_on_not_writable_filec @ s$ e Zd ZdZd dd�Zd dd�ZdS )
�SoftFileLockz.Simply watches the existence of the lock file.�return�Nonec
C s� t | j� t| j� tjtjB tjB tjB }zt�| j|| j j
�}W n* tyL } z|jt
ks:|jtkr9tjdksA� W Y d }~d S W Y d }~d S d }~ww || j _d S )N�win32)r
� lock_filer �os�O_WRONLY�O_CREAT�O_EXCL�O_TRUNC�open�_context�mode�OSError�errnor r �sys�platform�lock_file_fd)�self�flags�file_handler� exception� r! �G/home/arjun/projects/env/lib/python3.10/site-packages/filelock/_soft.py�_acquire s*
����
���zSoftFileLock._acquirec C sb | j jd usJ �t�| j j� d | j _tt�� t| j��� W d � d S 1 s*w Y d S )N) r r r �closer r r r �unlink)r r! r! r"