HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/osm/venv/lib/python3.10/site-packages/setuptools/__pycache__/monkey.cpython-310.pyc
o

0i��@s�dZddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
gZ	dd�Zdd�Z
dd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�ZdS)z
Monkey patching of distutils.
�N)�
import_modulecCs"t��dkr|f|jSt�|�S)am
    Returns the bases classes for cls sorted by the MRO.

    Works around an issue on Jython where inspect.getmro will not return all
    base classes if multiple classes share the same name. Instead, this
    function will return a tuple containing the class itself, and the contents
    of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024.
    �Jython)�platform�python_implementation�	__bases__�inspect�getmro)�cls�r
�?/opt/osm/venv/lib/python3.10/site-packages/setuptools/monkey.py�_get_mros	
rcCs.t|t�rtnt|tj�rtndd�}||�S)NcSsdS)Nr
)�itemr
r
r�<lambda>(szget_unpatched.<locals>.<lambda>)�
isinstance�type�get_unpatched_class�types�FunctionType�get_unpatched_function)r
�lookupr
r
r�
get_unpatched$s
�rcCs:dd�t|�D�}t|�}|j�d�sd|}t|��|S)z�Protect against re-patching the distutils if reloaded

    Also ensures that no other distutils extension monkeypatched the distutils
    first.
    css �|]}|j�d�s|VqdS)�
setuptoolsN)�
__module__�
startswith)�.0r	r
r
r�	<genexpr>3s�
�
�z&get_unpatched_class.<locals>.<genexpr>�	distutilsz(distutils has already been patched by %r)r�nextrr�AssertionError)r	Zexternal_bases�base�msgr
r
rr-s�rcCs�tjtj_tjdk}|rtjtj_dtjkodknp*dtjko(dkn}|r4d}|tjj	_
t�tjtjtj
fD]}tjj|_q?tjjtj_tjjtj_dtjvr`tjjtjd_t�dS)N)��r!)r!�)r!r#�)r!r"zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)r�Commandr�core�sys�version_info�findall�filelist�configZ
PyPIRCCommand�DEFAULT_REPOSITORY�_patch_distribution_metadata�dist�cmd�Distribution�	extensionZ	Extension�modules�#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ	warehouse�moduler
r
r�	patch_all?s&


�


�
r5cCs*dD]}ttj|�}ttjj||�qdS)zDPatch write_pkg_file and read_pkg_file for higher metadata standards)Zwrite_pkg_fileZ
read_pkg_fileZget_metadata_versionN)�getattrrr.�setattrrZDistributionMetadata)�attr�new_valr
r
rr-ds�r-cCs*t||�}t|��d|�t|||�dS)z�
    Patch func_name in target_mod with replacement

    Important - original must be resolved by name to avoid
    patching an already patched function.
    �	unpatchedN)r6�vars�
setdefaultr7)�replacementZ
target_mod�	func_name�originalr
r
r�
patch_funcks
r@cCs
t|d�S)Nr:)r6)�	candidater
r
rr|s
rcs|td��t��dkrdS�fdd�}t�|d�}zt|d��Wn	ty)Ynwz	t|d��WdSty=YdSw)	z\
    Patch functions in distutils to use standalone Microsoft Visual C++
    compilers.
    zsetuptools.msvc�WindowsNcs@d}||�d�}t�|�}t|�}t||�st|��|||fS)zT
        Prepare the parameters for patch_func to patch indicated function.
        Zmsvc14_�_)�lstripr6r�hasattr�ImportError)�mod_namer>Zrepl_prefixZ	repl_name�repl�mod�Zmsvcr
r�patch_params�s


z9patch_for_msvc_specialized_compiler.<locals>.patch_paramszdistutils._msvccompilerZ_get_vc_envZgen_lib_options)rr�system�	functools�partialr@rF)rKZmsvc14r
rJrr3�s
��r3)�__doc__r'Zdistutils.filelistrrrrM�	importlibrrr�__all__rrrr5r-r@rr3r
r
r
r�<module>s&	%