Your IP : 18.222.91.173


Current Path : /opt/alt/python310/lib64/python3.10/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/distutils/__pycache__/util.cpython-310.opt-2.pyc

o

6��f(R�@s	ddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddlm
Z
ddlmZdd�Zd	d
�Zdd�Zd
d�Zdadd�Zdd�Zd)dd�Zdaaadd�Zdd�Zd*dd�Zdd�Z				d+dd �Zd!d"�Zd,d#d$�Z 		d-d%d&�Z!Gd'd(�d(�Z"dS).�N)�DistutilsPlatformError)�newer)�spawn)�log)�DistutilsByteCompileErrorcCs�	tjdkr$dtj��vrdSdtj��vrdSdtj��vr!dStjSdtjvr.tjdStjd	ks8ttd
�s;tjSt��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkrfd||fS|dd�dkr�|ddkr�d}dt
|d�d|dd�f}ddd�}|d|tj7}nL|dd�dkr�ddlm
}|�S|dd �d!kr�d!}t�d"tj�}|�|�}|r�|��}n|dd �d#kr�ddl}	ddl}
|	�|
j��|||�\}}}d$|||fS)%N�ntZamd64�	win-amd64z(arm)�	win-arm32z(arm64)z	win-arm64Z_PYTHON_HOST_PLATFORM�posix�uname�/�� �_�-�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%s��Z32bitZ64bit)i���l����z.%sZaix)�aix_platform��cygwinz[\d.]+�darwinz%s-%s-%s)�os�name�sys�version�lower�platform�environ�hasattrr�replace�int�maxsizeZ_aix_supportr�re�compile�ASCII�match�group�_osx_supportZdistutils.sysconfigZget_platform_osxZ	sysconfigZget_config_vars)ZosnameZhost�releaser�machineZbitnessrZrel_re�mr)�	distutils�r.�5/opt/alt/python310/lib64/python3.10/distutils/util.py�get_host_platformsV


 
�
�
�r0cCs4tjdkrdddd�}|�tj�d��pt�St�S)NrZwin32rr	)Zx86Zx64ZarmZVSCMD_ARG_TGT_ARCH)rr�getrr0)ZTARGET_TO_PLATr.r.r/�get_platformcs
�r2cCs�	tjdkr|S|s|S|ddkrtd|��|ddkr$td|��|�d�}d|vr6|�d�d|vs-|s;tjStjj|�S)Nrrzpath '%s' cannot be absolute���zpath '%s' cannot end with '/'�.)r�sep�
ValueError�split�remove�curdir�path�join)�pathname�pathsr.r.r/�convert_pathns 


�r>cCs�	tjdkrtj�|�stj�||�Stj�||dd��Stjdkr>tj�|�\}}|ddkr7|dd�}tj�||�Stdtj��)Nr
�rr�\z!nothing known about platform '%s')rrr:�isabsr;�
splitdriver)Znew_rootr<Zdriver:r.r.r/�change_root�s

rCc	Csx	trdStjdkr-dtjvr-zddl}|�t���dtjd<Wnttfy,Ynwdtjvr8t	�tjd<dadS)Nr
�HOMErrZPLATr?)
�_environ_checkedrrr�pwd�getpwuid�getuid�ImportError�KeyErrorr2)rFr.r.r/�
check_environ�s�
rKc
CsJ	t�|fdd�}zt�d||�WSty$}ztd|��d}~ww)NcSs(|�d�}||vrt||�Stj|S)Nr?)r(�strrr)r'�
local_varsZvar_namer.r.r/�_subst�s

zsubst_vars.<locals>._substz\$([a-zA-Z_][a-zA-Z_0-9]*)zinvalid variable '$%s')rKr$�subrJr6)�srMrN�varr.r.r/�
subst_vars�s��rR�error: cCs|t|�S�N)rL)�exc�prefixr.r.r/�grok_environment_error�srWcCs(t�dtj�at�d�at�d�adS)Nz
[^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")r$r%�string�
whitespace�
_wordchars_re�
_squote_re�
_dquote_rer.r.r.r/�_init_regex�s
r]cCs�	tdurt�|��}g}d}|r�t�||�}|��}|t|�kr.|�|d|��	|S||tjvrI|�|d|��||d��	�}d}ni||dkrb|d|�||dd�}|d}nP||dkrot
�||�}n||dkr|t�||�}ntd||��|dur�t
d||��|��\}}|d|�||d|d�||d�}|��d}|t|�kr�|�|�	|S|s|S)	Nrr@r?�'�"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?)r)rZr]�stripr'�end�len�appendrXrY�lstripr[r\�RuntimeErrorr6�span)rPZwords�posr,raZbegr.r.r/�split_quoted�sF
�
,
�$rhcCsV	|durd|j|f}|dd�dkr|dd�d}t�|�|s)||�dSdS)Nz%s%r���z,)r�))�__name__r�info)�func�args�msg�verbose�dry_runr.r.r/�execute!s
�rrcCs0	|��}|dvrdS|dvrdStd|f��)N)�yZyes�t�trueZon�1r?)�nZno�fZfalseZoff�0rzinvalid truth value %r)rr6)�valr.r.r/�	strtobool4sr{r?c	Csh	ddl}tjrtd��|durd}|s�zddlm}	|	d�\}
}Wnty8ddlm}d|d�}
}Ynwt�	d|�|s�|
durLt
�|
d�}
nt|d�}
|
�&|
�
d	�|
�
d
�tt|��d�|
�
d|||||f�Wd�n1s|wYtj}tjg}|�|���|�d
|�d��|�|�t||d�tt
j|fd||d�dSddlm}|D]x}|dd�dkr�q�|dkr�|dkr�dn|}tjj||d�}ntj�|�}|}|r�|dt|��|kr�t d||f��|t|�d�}|�rt
j!�||�}t
j!�"|�}|�r1|�st#||��r*t�	d||�|�s)||||�q�t�$d||�q�dS)Nrzbyte-compiling is disabled.F)�mkstemp�.py)�mktempz$writing byte-compilation script '%s'�wz2from distutils.util import byte_compile
files = [
z,
z]
z�
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
z	-Wignore:z:DeprecationWarning)rqzremoving %s)r%���r
)�optimizationz1invalid prefix: filename %r doesn't start with %rzbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)%�
subprocessr�dont_write_bytecoderZtempfiler|rIr~rrlr�fdopen�open�writer;�map�reprr-Z_DEPRECATION_MESSAGE�
executable�extendZ"_optim_args_from_interpreter_flagsrcrrrr8�
py_compiler%�	importlib�util�cache_from_sourcerbr6r:�basenamer�debug)Zpy_files�optimizeZforcerVZbase_dirrprqZdirectr�r|Z	script_fdZscript_namer~Zscriptro�cmdr%�file�opt�cfile�dfileZ
cfile_baser.r.r/�byte_compileDs��

��

�������r�cCs	|�d�}d}|�|�S)N�
z	
        )r7r;)�header�linesr5r.r.r/�
rfc822_escape�s

r�cCsX	|sdSddlm}m}Gdd�d|�}|dur|d�}|||d�}|j|dd�dS)	Nr)�RefactoringTool�get_fixers_from_packagec@s$eZdZdd�Zdd�Zdd�ZdS)z*run_2to3.<locals>.DistutilsRefactoringToolc_�tj|g|�R�dSrT)r�error)�selfrorn�kwr.r.r/�	log_error��z4run_2to3.<locals>.DistutilsRefactoringTool.log_errorcWr�rT)rrl�r�rornr.r.r/�log_message�r�z6run_2to3.<locals>.DistutilsRefactoringTool.log_messagecWr�rT)rr�r�r.r.r/�	log_debug�r�z4run_2to3.<locals>.DistutilsRefactoringTool.log_debugN)rk�
__module__�__qualname__r�r�r�r.r.r.r/�DistutilsRefactoringTool�sr�z
lib2to3.fixes)�optionsT)r�)Zlib2to3.refactorr�r�Zrefactor)�files�fixer_namesr��explicitr�r�r��rr.r.r/�run_2to3�s
r�c	Cs	ddlm}ddlm}ddlm}|�}	t��}
t�|�z|	�	�Wt�|
�nt�|
�w|	j
|	jdd�<|rN|��D]}|�
�}|sHq?|	�|�q?g}|	jD]&}
tj�||
�}|tj�|��|tj�||
�|dd�}|dry|�|�qStdd�|D�|||d	�|S)
Nr)�mkpath)�	copy_file)�FileListr?)�updatecSsg|]}|���d�r|�qS)r})r�endswith)�.0�fnr.r.r/�
<listcomp>sz$copydir_run_2to3.<locals>.<listcomp>)r�r�r�)Zdistutils.dir_utilr�Zdistutils.file_utilr�Zdistutils.filelistr�r�getcwd�chdir�findallZallfilesr��
splitlinesr`Zprocess_template_liner:r;�dirnamercr�)�src�dest�templater�r�r�r�r�r�Zfilelistr9�lineZcopied�filenameZoutname�resr.r.r/�copydir_run_2to3s6


��r�c@s"eZdZ	dZdZdZdd�ZdS)�	Mixin2to3NcCst||j|j|j�SrT)r�r�r�r�)r�r�r.r.r/r�1szMixin2to3.run_2to3)rkr�r�r�r�r�r�r.r.r.r/r�!sr�)rS)Nrr)rrNNr?rN)NNN)NNNN)#rr$�importlib.utilr�rXrr-Zdistutils.errorsrZdistutils.dep_utilrZdistutils.spawnrrrr0r2r>rCrErKrRrWrZr[r\r]rhrrr{r�r�r�r�r�r.r.r.r/�<module>sJP

=
�


�!

?>