
    ȃe                        d Z ddlmZ ddlZddlZddlmZ ej                            e	          Z
d ZdZ G d d          Zej                            d e                       dS )	z?Patches that are applied at runtime to the virtual environment.    )annotationsN)suppressc                B    | j         j        fd}|| j         _        dS )a  
    Distutils allows user to configure some arguments via a configuration file:
    https://docs.python.org/3/install/index.html#distutils-configuration-files.

    Some of this arguments though don't make sense in context of the virtual environment files, let's fix them up.
    c                     | g|R i |}|                      d          }d|v r3t          t          j                            t
          j                  f|d<   dD ]!}d| }||v r|                    |d            "|S )Ninstallprefix)purelibplatlibheadersscriptsdatainstall_)get_option_dictVIRTUALENV_PATCH_FILEospathabspathsysr   pop)selfargskwargsresultr   basekeyold_parse_config_filess          H/home/p21-0144/basic/vpnGate/lib/python3.11/site-packages/_virtualenv.pyparse_config_filesz&patch_dist.<locals>.parse_config_files   s    ''>t>>>v>>&&y11w 5rwsz7R7R RGHH 	' 	'D#T##Cg~~C&&&    N)Distributionr   )distr   r   s     @r   
patch_distr"      s=     ".A
 
 
 
 
 ,>D(((r   )zdistutils.distzsetuptools.distc                  N    e Zd ZdZdZg ZddZed             Zed             Z	dS )_FinderzGA meta path finder that allows patching the imported distutils modules.Nc           
        |t           v rT| j        Lt          | j                  dk    r2dd l}|                                }| j                            |           ddlm} ddl	m
} | j        d         5  || _        	  |||          }|t          |j        d          }	|	rdnd}
t          |j        |
          }|	r| j        n| j        }||urLt!          t"                    5  t%          |j        |
 |||                     d d d            n# 1 swxY w Y   |d | _        cd d d            S 	 d | _        n# d | _        w xY w	 d d d            n# 1 swxY w Y   d S )Nr   )partial)	find_specexec_moduleload_module)_DISTUTILS_PATCHfullnamelenlock	threadingLockappend	functoolsr&   importlib.utilr'   hasattrloadergetattrr(   r)   r   AttributeErrorsetattr)r   r+   r   targetr.   r-   r&   r'   spec
is_new_api	func_nameoldfuncs                r   r'   z_Finder.find_spec5   sC   '''DM,A49~~""     ~~'' 	  &&&))))))0000001 ) ) ()$9Xt44D'%,T[-%H%H
5?$RMM]	%dk9==3=St//4CSd??!).!9!9 T T 'Yc@R@R S S ST T T T T T T T T T T T T T T#$(DM) ) ) ) ) ) ) ) ( %)DMMDDM((((M) ) ) ) ) ) ) ) ) ) ) ) ) ) )  tsU   6E?A&D;%!DD;D	D;D	D;E3E;	EEEEc                Z     | |           |j         t          v rt          |           d S d S N__name__r*   r"   )r<   modules     r   r(   z_Finder.exec_moduleX   s9    F?...v /.r   c                V     | |          }|j         t          v rt          |           |S r?   r@   )r<   namerB   s      r   r)   z_Finder.load_module^   s0    T?...vr   r?   )
rA   
__module____qualname____doc__r+   r-   r'   staticmethodr(   r)    r   r   r$   r$   +   sq        QQH
 D! ! ! !F   \
   \  r   r$   )rG   
__future__r   r   r   
contextlibr   r   join__file__r   r"   r*   r$   	meta_pathinsertrI   r   r   <module>rP      s    E E " " " " " " 				 



      X.. > > >6 7 8 8 8 8 8 8 8 8v   Q		 " " " " "r   