
    ϶vg                         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	 	 ddlm
Z
 n# e$ r ded	ed
dfdZ
Y nw xY w ed          Zd Zdedef         deded
efdZdefdZd ZdS )z2Convenience layer on top of stdlib's shutil and os    N)CallableTypeVar   )py311)log)chmodargskwargsreturnc                      d S N )r	   r
   s     O/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/setuptools/_shutil.pyr   r      s        _Tc                     t          j        d| |           	 t          | |           d S # t          $ r }t          j        d|           Y d }~d S d }~ww xY w)Nzchanging mode of %s to %ozchmod failed: %s)r   debugr   OSError)pathmodees      r   attempt_chmod_verboser      sv    I)4666)dD ) ) )	$a((((((((()s   * 
AAAfunc.argexcc                     | t           j        t           j        fv r5t           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   s      r   _auto_chmodr$       sG    
 	29%%%"'T//c4=111tCyy
Ir   Fc                 .    t          j        | ||          S )zx
    Similar to ``shutil.rmtree`` but automatically executes ``chmod``
    for well know Windows failure scenarios.
    )r   shutil_rmtree)r   ignore_errorsonexcs      r   rmtreer)   +   s    
 t]E:::r   c                 b    t           j                            |           rt          | fi | d S d S r   )r   r   isdirr)   )r   optss     r   rmdirr-   3   s>    	w}}T tt r   )__doc__r   r"   typingr   r   compatr   	distutilsr   r   ImportErrorobjectr   r   strBaseExceptionr$   r)   r-   r   r   r   <module>r6      sP   8 8 				  $ $ $ $ $ $ $ $               V v $       WT]]) ) )
37
"%,9     %K ; ; ; ;    s   ' 99