HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/setuptools/__pycache__/monkey.cpython-310.pyc
o

;j��@s�UdZddlmZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlZed�Z
edeej�ZgZded<	d	d
�Ze
d!d
d��Ze
d"dd��Zd#dd�Zd$dd�Zd%dd�Zdd�Zd%dd�Zdd �ZdS)&z
Monkey patching of distutils.
�)�annotationsN)�TypeVar�cast�overload�_T�	_UnpatchTz	list[str]�__all__cCs"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__�inspectZgetmro)�cls�r�E/opt/saltstack/salt/lib/python3.10/site-packages/setuptools/monkey.py�_get_mros	
r�item�returncC�dS�Nr�rrrr�
get_unpatched(�r�object�NonecCrrrrrrrr*r�"type | types.FunctionType | object� type | types.FunctionType | NonecCs*t|t�r	t|�St|tj�rt|�SdSr)�
isinstance�type�get_unpatched_class�types�FunctionType�get_unpatched_functionrrrrr,s

r�type[_T]cCs<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�sttt|�VqdS)�
setuptoolsN)�
__module__�
startswithrrr)�.0rrrr�	<genexpr><s�
�
�z&get_unpatched_class.<locals>.<genexpr>�	distutilsz&distutils has already been patched by )r�nextr%r&�AssertionError)rZexternal_bases�base�msgrrrr6s�
rcCsrddl}|jtj_t�tjtjtjfD]}|jj|_q|jj	tj_	|jj	tj_	dt
jvr7|jj	t
jd_	dSdS)Nrzdistutils.command.build_ext)r$ZCommandr)�core�_patch_distribution_metadata�dist�cmdZDistribution�	extensionZ	Extension�sys�modules)r$�modulerrr�	patch_allHs

���r6cCs6ddlm}	dD]}t||�}ttjj||�q	dS)N�)�_core_metadata)Zwrite_pkg_infoZwrite_pkg_fileZ
read_pkg_fileZget_metadata_versionZget_fullname)�r8�getattr�setattrr)r0ZDistributionMetadata)r8�attr�new_valrrrr/]s
�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)r:�vars�
setdefaultr;)ZreplacementZ
target_modZ	func_name�originalrrr�
patch_funcls
rBcCs|jSr)r>)�	candidaterrrr"}sr")rrrr)rrrr)rrrr)rr#rr#)rr)�__doc__�
__future__rr
r
r3r �typingrrrZdistutils.filelistr)rrr!rr�__annotations__rrrr6r/rBr"rrrr�<module>s.