HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/setuptools/_distutils/__pycache__/util.cpython-310.pyc
o

��h�F�@s�dZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZmZmZddlmZmZddlmZddlmZdd	lmZdd
lmZmZddlmZerpddlm Z m!Z!e d
�Z"d^dd�Z#d^dd�Z$ej%dkr�da&dZ'dd�Z(dd�Z)dd�Z*d_dd�Z+ed`d"d#��Z,dad'd(�Z-ej.dbd*d+��Z/dcd.d/�Z0d0d1�Z1ddded6d7�Z2da3a4a5d8d9�Z6dfd;d<�Z7		=	=dgdhdFdG�Z8didIdJ�Z9		=			K	=	djdkdUdV�Z:dldXdY�Z;dmdZd[�Z<d\d]�Z=dS)nzudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
�)�annotationsN)�Callable�Iterable�Mapping)�
TYPE_CHECKING�AnyStr)�	pass_none�)�log)�newer)�DistutilsByteCompileError�DistutilsPlatformError)�spawn)�TypeVarTuple�Unpack�_Ts�return�strcCst��S)z�
    Return a string that identifies the current platform. Use this
    function to distinguish platform-specific build directories and
    platform-specific built distributions.
    )�	sysconfig�get_platform�rr�E/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/util.py�get_host_platform#srcCs:tjdkrddddd�}tj�d�}|�|�pt�St�S)N�nt�win32z	win-amd64z	win-arm32z	win-arm64)�x86�x64�arm�arm64�VSCMD_ARG_TGT_ARCH)�os�name�environ�getr)�TARGET_TO_PLAT�targetrrrr1s
�r�darwin�MACOSX_DEPLOYMENT_TARGETcCsdadS)zFor testing only. Do not call.N)�_syscfg_macosx_verrrrr�_clear_cached_macosx_verCsr)cCs.tdurddlm}|�t�pd}|r|atS)z�Get the version of macOS latched in the Python interpreter configuration.
    Returns the version as a string or None if can't obtain one. Cached.Nr)r�)r(�	distutilsr�get_config_var�MACOSX_VERSION_VAR)r�verrrr�!get_macosx_target_ver_from_syscfgIsr/cCsdt�}tj�t�}|r0|r.t|�ddgkr.t|�ddgkr.dtd|�d|�d�}t|��|S|S)aReturn the version of macOS for which we are building.

    The target version defaults to the version in sysconfig latched at time
    the Python interpreter was built, unless overridden by an environment
    variable. If neither source has a value, then None is returned�
��$z mismatch: now "z" but "z*" during configure; must use 10.3 or later)r/r r"r#r-�
split_versionr
)�
syscfg_ver�env_ver�my_msgrrr�get_macosx_target_verVs ����r7�s�	list[int]cCsdd�|�d�D�S)zEConvert a dot-separated string into a list of numbers for comparisonscSsg|]}t|��qSr)�int)�.0�nrrr�
<listcomp>xsz!split_version.<locals>.<listcomp>�.)�split)r8rrrr3vsr3�pathname�str | os.PathLike[str]cCst�t�|��S)a.
    Allow for pathlib.Path inputs, coax to a native path string.

    If None is passed, will just pass it through as
    Setuptools relies on this behavior.

    >>> convert_path(None) is None
    True

    Removes empty paths.

    >>> convert_path('foo/./bar').replace('\\', '/')
    'foo/bar'
    )r �fspath�pathlib�PurePath)r@rrr�convert_path{srE�new_root�AnyStr | os.PathLike[AnyStr]rcCs�tjdkrtj�|�stj�||�Stj�||dd��Stjdkr>tj�|�\}}|dtjkr7|dd�}tj�||�Stdtj�d���)a	Return 'pathname' with 'new_root' prepended.  If 'pathname' is
    relative, this is equivalent to "os.path.join(new_root,pathname)".
    Otherwise, it requires making 'pathname' relative and then joining the
    two, which is tricky on DOS/Windows and Mac OS.
    �posixr	Nrrznothing known about platform '�')r r!�path�isabs�join�
splitdrive�sepr
)rFr@�driverJrrr�change_root�s

rP�Nonec	Csntjdkr(dtjvr(zddl}|�t���dtjd<Wnttfy'Ynwdtjvr5t�tjd<dSdS)aLEnsure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
    rH�HOMErN��PLAT)	r r!r"�pwd�getpwuid�getuid�ImportError�KeyErrorr)rUrrr�
check_environ�s	�
�rZ�
local_vars�Mapping[str, object]c
Cs`t�ttj�}|�dd�|��D��zt|��|�WSty/}zt	d|����d}~ww)a�
    Perform variable substitution on 'string'.
    Variables are indicated by format-style braces ("{var}").
    Variable is substituted by the value found in the 'local_vars'
    dictionary or in 'os.environ' if it's not in 'local_vars'.
    'os.environ' is first checked/augmented to guarantee that it contains
    certain values: see 'check_environ()'.  Raise ValueError for any
    variables not found in either 'local_vars' or 'os.environ'.
    css �|]\}}|t|�fVqdS�N�r)r;r!�valuerrr�	<genexpr>�s�zsubst_vars.<locals>.<genexpr>zinvalid variable N)
rZ�dictr r"�update�items�
_subst_compat�
format_maprY�
ValueError)r8r[�lookup�varrrr�
subst_vars�s

��ricCs6dd�}t�d||�}||krddl}|�dt�|S)zb
    Replace shell/Perl-style variable substitution with
    format-style. For compatibility.
    cSsd|�d��d�S)N�{r	�})�group)�matchrrr�_subst�sz_subst_compat.<locals>._substz\$([a-zA-Z_][a-zA-Z_0-9]*)rNz-shell/Perl-style substitutions are deprecated)�re�sub�warnings�warn�DeprecationWarning)r8rn�replrqrrrrd�s�rd�error: �exc�object�prefixcCs|t|�Sr]r^)rvrxrrr�grok_environment_error�srycCs,t�dtj�d��at�d�at�d�adS)Nz[^\\\'\"z ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")ro�compile�string�
whitespace�
_wordchars_re�
_squote_re�
_dquote_rerrrr�_init_regex�s
r��	list[str]cCs�tdurt�|��}g}d}|r�t�||�}|��}|t|�kr-|�|d|��	|S||tjvrH|�|d|��||d��	�}d}nm||dkra|d|�||dd�}|d}nT||dkrnt
�||�}n||dkr{t�||�}n
td||�d���|dur�t
d	||�d
���|��\}}|d|�||d|d�||d�}|��d}|t|�kr�|�|�	|S|s|S)aSplit a string up according to Unix shell-like rules for quotes and
    backslashes.  In short: words are delimited by spaces, as long as those
    spaces are not escaped by a backslash, or inside a quoted string.
    Single and double quotes are equivalent, and the quote characters can
    be backslash-escaped.  The backslash is stripped from any two-character
    escape sequence, leaving only the escaped character.  The quote
    characters are stripped from any quoted string.  Returns a list of
    words.
    Nr�\r	rI�"zthis can't happen (bad char 'z')zbad string (mismatched z	 quotes?)�)r}r��striprm�end�len�appendr{r|�lstripr~r�RuntimeErrorrf�span)r8�words�pos�mr��begrrr�split_quoted�sF"�
,
�'r�F�func�Callable[[Unpack[_Ts]], object]�args�tuple[Unpack[_Ts]]�msg�verbose�bool�dry_runcCsT|dur|j�|��}|dd�dkr|dd�d}t�|�|s(||�dSdS)a}
    Perform some action that affects the outside world (e.g. by
    writing to the filesystem). Such actions are special because they
    are disabled by the 'dry_run' flag. This method handles that
    complication; simply supply the
    function to call and an argument tuple for it (to embody the
    "external action" being performed) and an optional message to
    emit.
    N���z,)r�))�__name__r
�info)r�r�r�r�r�rrr�execute7s
�r��valcCs.|��}|dvr
dS|dvrdStd|����)z�Convert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )�y�yes�t�true�on�1T)r<�no�f�false�off�0Fzinvalid truth value )�lowerrf)r�rrr�	strtoboolQsr�T�py_files�
Iterable[str]�optimizer:�force�
str | None�base_dir�direct�bool | NonecCstjrtd��|dur|dk}|s�t�d�\}}	t�d|	�|satj|ddd	�}
|
�/|
�	d
�|
�	d�
tt|��d�|
�	d
|�d|�d|�d|�d|�d��Wd�n1s\wYtj
g}|�t���|�|	�t||d�ttj|	fd|	��|d�dSddlm}|D]v}
|
dd�dkr�q�|dkr�|dkr�dn|}tjj|
|d�}ntj�|
�}|
}|r�|
dt|��|kr�td|
�d|����|t|�d�}|r�tj�
||�}tj�|�}|�r|s�t|
|�r�t�d|
|�|s�||
||�q�t�d|
|�q�dS)a~Byte-compile a collection of Python source files to .pyc
    files in a __pycache__ subdirectory.  'py_files' is a list
    of files to compile; any files that don't end in ".py" are silently
    skipped.  'optimize' must be one of the following:
      0 - don't optimize
      1 - normal optimization (like "python -O")
      2 - extra optimization (like "python -OO")
    If 'force' is true, all files are recompiled regardless of
    timestamps.

    The source filename encoded in each bytecode file defaults to the
    filenames listed in 'py_files'; you can modify these with 'prefix' and
    'basedir'.  'prefix' is a string that will be stripped off of each
    source filename, and 'base_dir' is a directory name that will be
    prepended (after 'prefix' is stripped).  You can supply either or both
    (or neither) of 'prefix' and 'base_dir', as you wish.

    If 'dry_run' is true, doesn't actually do anything that would
    affect the filesystem.

    Byte-compilation is either done directly in this interpreter process
    with the standard py_compile module, or indirectly by writing a
    temporary script and executing it.  Normally, you should let
    'byte_compile()' figure out to use direct compilation or not (see
    the source for details).  The 'direct' flag is used by the script
    generated in indirect mode; unless you know what you're doing, leave
    it set to None.
    zbyte-compiling is disabled.NTrz.pyz$writing byte-compilation script '%s'�wzutf-8)�encodingz2from distutils.util import byte_compile
files = [
z,
z]
z
byte_compile(files, optimize=z, force=z,
             prefix=z, base_dir=z,
             verbose=z+, dry_run=False,
             direct=True)
)r�z	removing )rz���r*)�optimizationzinvalid prefix: filename z doesn't start with zbyte-compiling %s to %sz%skipping byte-compilation of %s to %s) �sys�dont_write_bytecoder�tempfile�mkstempr
r�r �fdopen�writerL�map�repr�
executable�extend�
subprocess�"_optim_args_from_interpreter_flagsr�rr��remove�
py_compilerz�	importlib�util�cache_from_sourcer�rfrJ�basenamer�debug)r�r�r�rxr�r�r�r��	script_fd�script_name�script�cmdrz�file�opt�cfile�dfile�
cfile_baserrr�byte_compileasx(��������
����r��headercCsFd}|jdd�}|o|d��d|dk}|r|nd}|�|�|S)z�Return a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    z        T)�keepends���rr*)�
splitlinesrL)r��indent�lines�ends_in_newline�suffixrrr�
rfc822_escape�s
r�cCstjdko
t��d�S)z�Returns True if the current platform is mingw.

    Python compiled with Mingw-w64 has sys.platform == 'win32' and
    get_platform() starts with 'mingw'.
    r�mingw)r��platformr�
startswithrrrr�is_mingw�sr�cCstt�d��S)zKReturn True if the Python interpreter is built with free threading support.�Py_GIL_DISABLED)r�rr,rrrr�is_freethreadedsr�)rr)r8rrr9)r@rArr)rFrGr@rGrr)rrQ)r[r\rr)ru)rvrwrxrrr)r8rrr�)NFF)r�r�r�r�r�rwr�r�r�r�rrQ)r�rrr�)rFNNTFN)r�r�r�r:r�r�rxr�r�r�r�r�r�r�r�r�rrQ)r�rrr)rr�)>�__doc__�
__future__r�	functools�importlib.utilr�r rCror{r�r�rr��collections.abcrrr�typingrr�jaraco.functoolsr�_logr
�	_modifiedr�errorsrr
r�typing_extensionsrrrrrr�r(r-r)r/r7r3rErP�	lru_cacherZrirdryr}r~rr�r�r�r�r�r�r�r�rrrr�<module>sv




 


E�
�