
    :ji                         d Z ddlZddl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.    Nc                 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.11/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          E/root/voice-cloning/.venv/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 r:| j        2t          | 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r2	 t!          |j        |
 |||                     n# t"          $ r Y nw xY w|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'   setattrAttributeError)r   r)   r   targetr,   r+   r$   r%   spec
is_new_api	func_nameoldfuncs                r   r%   z_Finder.find_spec2   s   '''DM,A49~~""     ~~'' 	  &&&))))))0000001 ) ) ()$9Xt44D'%,T[-%H%H
5?$RMM]	%dk9==3=St//4CSd??% 'Yc@R@R S S S S#1 % % % $%#$(DM#) ) ) ) ) ) ) ) ( %)DMMDDM((((M#) ) ) ) ) ) ) ) ) ) ) ) ) ) )$ tsU   6D:?AD! C32D!3
D =D!?D  D!D:D:!	D**D::D>D>c                 Z     | |           |j         t          v rt          |           d S d S N__name__r(   r    )r:   modules     r   r&   z_Finder.exec_moduleW   s9    F?...v /.r   c                 V     | |          }|j         t          v rt          |           |S r=   r>   )r:   namer@   s      r   r'   z_Finder.load_module]   s0    T?...vr   r=   )
r?   
__module____qualname____doc__r)   r+   r%   staticmethodr&   r'    r   r   r"   r"   (   sq        QQH
 D# # # #J   \
   \  r   r"   )rE   r   r   r   join__file__r   r    r(   r"   	meta_pathinsertrG   r   r   <module>rL      s    E E 				 



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