관리-도구
편집 파일: _soft.cpython-38.pyc
U *�e� � @ 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 ZdZdd�dd�Zdd�dd�ZdS ) �SoftFileLockz.Simply watches the existence of the lock file.�None)�returnc C s� t | j� t| j� tjtjB tjB tjB }zt�| j|| j j �}W nB tk r� } z$|jt ksv|jtkrttjdksv� W 5 d }~X Y n X || 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! �</opt/hc_python/lib/python3.8/site-packages/filelock/_soft.py�_acquire s* �������zSoftFileLock._acquirec C sL | j jd k st�t�| j j� d | j _tt�� t| j�� � W 5 Q R X d S )N) r r �AssertionErrorr �closer r r r �unlink)r r! r! r"