ruạṛ
a �u:j* � @ s� d Z ddlZddlZddlmZmZ ddlmZ ddlm Z zddlm Z W n$ eyp eedd�d d �Z Y n0 ed�Z dd � Zede f eee d�dd�Zdefdd�Zdd� Zdd� ZdS )z2Convenience layer on top of stdlib's shutil and os� N)�Callable�TypeVar� )�py311)�log)�chmod)�args�kwargs�returnc O s d S �N� )r r r r �E/opt/bart/bart_venv/lib/python3.9/site-packages/setuptools/_shutil.pyr s r �_Tc C sR t �d| |� zt| |� W n0 tyL } zt �d|� W Y d }~n d }~0 0 d S )Nzchanging mode of %s to %ozchmod failed: %s)r �debugr �OSError)�path�mode�er r r �attempt_chmod_verbose s r .)�func�arg�excr c C s6 | t jt jfv r.t jdkr.t|tj� | |�S |�dS )zIshutils onexc callback to automatically call chmod for certain functions.�ntN)�os�unlink�remove�namer �stat�S_IWRITE)r r r r r r �_auto_chmod s r Fc C s t �| ||�S )zx Similar to ``shutil.rmtree`` but automatically executes ``chmod`` for well know Windows failure scenarios. )r Z shutil_rmtree)r � ignore_errors�onexcr r r �rmtree+ s r"