관리-도구
편집 파일: file_cache.cpython-38.opt-1.pyc
U ��.e9 � @ s~ d dl Z d dlZd dlmZ ddlmZ ddlmZ ze W n e k rX e efZY nX dd� ZG dd � d e�Z d d� ZdS )� N)�dedent� )� BaseCache)�CacheControllerc C s� t j}|t jt jB O }tt d�r*|t jO }tt d�r>|t jO }zt �| � W n tt fk rd Y nX t � | ||�}zt �|d�W S t �|� � Y nX d S )N� O_NOFOLLOW�O_BINARY�wb) �os�O_WRONLY�O_CREAT�O_EXCL�hasattrr r �remove�IOError�OSError�open�fdopen�close)�filenameZfmode�flags�fd� r �N/usr/lib/python3.8/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py�_secure_open_write s r c @ sB e Zd Zddd�Zedd� �Zd d � Zdd� Zd d� Zdd� Z dS )� FileCacheF� � Nc C s� |d k r|d k rt d��zddlm} ddlm} W n$ tk rX td�} t| ��Y nX |rd|}n|d krp|}|| _|| _|| _ || _ || _d S )Nz/Cannot use use_dir_lock and lock_class togetherr )�LockFile)� MkdirLockFilez� NOTE: In order to use the FileCache you must have lockfile installed. You can install it via pip: pip install lockfile )� ValueErrorZlockfiler Zlockfile.mkdirlockfiler �ImportErrorr � directory�forever�filemode�dirmode� lock_class) �selfr! r"