AlkantarClanX12

Your IP : 3.138.36.168


Current Path : /opt/alt/python35/lib/python3.5/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/setuptools/__pycache__/monkey.cpython-35.pyc



�Re��@s�dZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlZgZ
dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)z
Monkey patching of distutils.
�N�)�
import_module)�sixcCs-tj�dkr |f|jStj|�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��/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/monkey.py�_get_mros	rcCsFt|tj�rtn!t|tj�r0tn	dd�}||�S)NcSsdS)Nr)�itemrrr
�<lambda>*szget_unpatched.<locals>.<lambda>)�
isinstancer�class_types�get_unpatched_class�types�FunctionType�get_unpatched_function)r�lookuprrr
�
get_unpatched&srcCsQdd�t|�D�}t|�}|jjd�sMd|}t|��|S)z�Protect against re-patching the distutils if reloaded

    Also ensures that no other distutils extension monkeypatched the distutils
    first.
    css'|]}|jjd�s|VqdS)�
setuptoolsN)�
__module__�
startswith)�.0rrrr
�	<genexpr>6sz&get_unpatched_class.<locals>.<genexpr>�	distutilsz(distutils has already been patched by %r)r�nextrr�AssertionError)rZexternal_bases�base�msgrrr
r/s	
rcCsNtjtj_tjdk}|r3tjtj_tjdkp�d
tjko\dknp�dtjko{dknp�dtjko�dkn}|r�d	}|tjj	_
t�t�x/tj
tjtjfD]}tj
j|_q�Wtjjtj_tjjtj_d
tjkrCtjjtjd
_t�dS)N�����
r��zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)r#r$r#)r%r&r')r#r)r#r#r&)r#r()r#r(r))r#r$)r#r$r#)r�Commandr�core�sys�version_info�findall�filelist�config�
PyPIRCCommand�DEFAULT_REPOSITORY�+_patch_distribution_metadata_write_pkg_file�+_patch_distribution_metadata_write_pkg_info�dist�cmd�Distribution�	extension�	Extension�modules�#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ	warehouse�modulerrr
�	patch_allAs(r=cCstjjtjj_dS)zDPatch write_pkg_file to also write Requires-Python/Requires-ExternalN)rr5�write_pkg_filer�DistributionMetadatarrrr
r3ksr3cCsLdtjdd�ko$dkn}|s3dStjjtjj_dS)z�
    Workaround issue #197 - Python 3 prior to 3.2.2 uses an environment-local
    encoding to save the pkg_info. Monkey-patch its write_pkg_info method to
    correct this undesirable behavior.
    r#Nr%)r#)r#r%r%)r,r-rr5�write_pkg_inforr?)Zenvironment_localrrr
r4rs)r4cCs9t||�}t|�jd|�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)�getattr�vars�
setdefault�setattr)�replacementZ
target_mod�	func_name�originalrrr
�
patch_func�srIcCs
t|d�S)NrA)rB)�	candidaterrr
r�srcs�td��tj�dkr"dS�fdd�}tj|d�}tj|d�}y$t|d��t|d	��Wntk
r�YnXyt|d
��Wntk
r�YnXyt|d��Wntk
r�YnXdS)z\
    Patch functions in distutils to use standalone Microsoft Visual C++
    compilers.
    zsetuptools.msvc�WindowsNcsnd|krdnd}||jd�}t�|�}t|�}t||�sat|��|||fS)zT
        Prepare the parameters for patch_func to patch indicated function.
        �msvc9Zmsvc9_Zmsvc14_�_)�lstriprBr�hasattr�ImportError)�mod_namerGZrepl_prefixZ	repl_name�repl�mod)�msvcrr
�patch_params�sz9patch_for_msvc_specialized_compiler.<locals>.patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ_get_vc_envZgen_lib_options)rr�system�	functools�partialrIrP)rUrLZmsvc14r)rTr
r;�s&



r;)�__doc__r,�distutils.filelistrrrrWr	Z
py26compatrZsetuptools.externrr�__all__rrrr=r3r4rIrr;rrrr
�<module>s&	*