Your IP : 3.144.227.73


Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/__pycache__/monkey.cpython-311.pyc

�

��bg����UdZddlmZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlZed��Z
edeej��ZgZded<	d	�Ze
dd���Ze
dd���Zdd�Zdd�Zd�Zd�Zd�Zd�ZdS)z
Monkey patching of distutils.
�)�annotationsN)�TypeVar�cast�overload�_T�	_UnpatchTz	list[str]�__all__c�n�tj��dkr|f|jzStj|��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)�clss �H/opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/monkey.py�_get_mrors7���%�'�'�8�3�3��v��
�%�%��>�#�����item�returnc��dS�N��rs r�
get_unpatchedr(s��14�r�object�Nonec��dSrrrs rrr*s��),�r�"type | types.FunctionType | object� type | types.FunctionType | Nonec��t|t��rt|��St|tj��rt|��SdSr)�
isinstance�type�get_unpatched_class�types�FunctionType�get_unpatched_functionrs rrr,sL���$����)�"�4�(�(�(��$��*�+�+�,�%�d�+�+�+��4rr�type[_T]c��d�t|��D��}t|��}|j�d��sd|z}t	|���|S)z�Protect against re-patching the distutils if reloaded

    Also ensures that no other distutils extension monkeypatched the distutils
    first.
    c3�K�|]>}|j�d���ttt|��V��?dS)�
setuptoolsN)�
__module__�
startswithrr#r)�.0rs  r�	<genexpr>z&get_unpatched_class.<locals>.<genexpr><sZ��������~�(�(��6�6���T�"�X�s��������r�	distutilsz(distutils has already been patched by %r)r�nextr,r-�AssertionError)r�external_bases�base�msgs    rr$r$6sj�����C�=�=����N�
����D��?�%�%�k�2�2�"�8�3�>���S�!�!�!��Krc��ddl}|jtj_t	��tjtjtjfD]}|jj|_�|jj	tj_	|jj	tj_	dtjvr#|jj	tjd_	dSdS)Nrzdistutils.command.build_ext)r+�Commandr0�core�_patch_distribution_metadata�dist�cmd�Distribution�	extension�	Extension�sys�modules)r+�modules  r�	patch_allrBHs�������(�/�I�N�� �"�"�"��.�)�.�)�-�?�;�;��(�o�:���� *�3�=�I�N��$.�$8�$B�I��!�$���3�3�!�*�4�	��)�	
�
�)�)�4�3rc�~�ddlm}	dD]2}t||��}ttjj||���3dS)N�)�_core_metadata)�write_pkg_info�write_pkg_file�
read_pkg_file�get_metadata_version�get_fullname)�rE�getattr�setattrr0r:�DistributionMetadata)rE�attr�new_vals   rr9r9]sa�� � � � � � �N��D�D���.�$�/�/���	��3�T�7�C�C�C�C�D�Drc��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)rL�vars�
setdefaultrM)�replacement�
target_mod�	func_name�originals    r�
patch_funcrYlsM���z�9�-�-�H�	���� � ��h�7�7�7��J�	�;�/�/�/�/�/rc��|jSr)rR)�	candidates rr'r'}s����r)rrrr)rrrr)rrrr )rr(rr()�__doc__�
__future__rrrr?r%�typingrrr�distutils.filelistr0rr#r&rr	�__annotations__rrr$rBr9rYr'rrr�<module>ras_�����#�"�"�"�"�"���������
�
�
�
�����*�*�*�*�*�*�*�*�*�*������W�T�]�]���G�K��u�'9�:�:�	�����������
�4�4�4�
��4�	�,�,�,�
��,���������$5�5�5�*D�D�D�0�0�0�"����r

?>