o
    LK&h*  ã                	   @   sÊ   d Z ddlZddlZddlmZmZ ddlmZ ddlm	Z	 zddlm
Z
 W n ey:   ded	ed
dfdd„Z
Y nw edƒZdd„ Zdedef deded
efdd„Zdefdd„Zdd„ Zdd„ ZdS )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/var/www/html/venv/lib/python3.10/site-packages/setuptools/_shutil.pyr      s   r   Ú_Tc              
   C   sR   t  d| |¡ zt| |ƒ W d S  ty( } zt  d|¡ W Y d }~d S d }~ww )Nzchanging mode of %s to %ozchmod failed: %s)r   Údebugr   ÚOSError)ÚpathÚmodeÚer   r   r   Úattempt_chmod_verbose   s   €ÿr   Úfunc.ÚargÚexcc                 C   s2   | t jt jfv rt jdkrt|tjƒ | |ƒS |‚)zIshutils onexc callback to automatically call chmod for certain functions.Únt)Ú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   Úshutil_rmtree)r   Úignore_errorsÚonexcr   r   r   Úrmtree+   s   r#   c                 K   s$   t j | ¡rt| fi |¤Ž d S d S r   )r   r   Úisdirr#   )r   Úoptsr   r   r   Úrmdir3   s   ÿr&   c                  C   s   t  d¡} t  | ¡ | S )Né   )r   Úumask)Útmpr   r   r   Úcurrent_umask8   s   

r*   )Ú__doc__r   r   Útypingr   r   Úcompatr   Ú	distutilsr   r   ÚImportErrorÚobjectr   r   ÚstrÚBaseExceptionr   r#   r&   r*   r   r   r   r   Ú<module>   s2    þ	
ÿÿÿ
þ