OwlCyberSecurity - MANAGER
Edit File: monkey.cpython-38.pyc
U �����Qab�����������������������@���s����d�Z�ddlZddlZddlZddlZddlZddlmZ�ddl Z ddl mZ�ddlZg�Z dd��Zdd��Zd d ��Zdd��Zd d��Zdd��Zdd��Zdd��ZdS�)z Monkey patching of distutils. �����N)� import_module)�sixc�����������������C���s"���t����dkr|�f|�j�S�t�|��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. ZJython)�platformZpython_implementation� __bases__�inspectZgetmro)�cls��r����5/usr/lib/python3.8/site-packages/setuptools/monkey.py�_get_mro���s���� r ���c�����������������C���s0���t�|�tj�rtnt�|�tj�r tndd��}||��S�)Nc�����������������S���s���d�S�)Nr���)�itemr���r���r ����<lambda>*��������zget_unpatched.<locals>.<lambda>)� isinstancer���Zclass_types�get_unpatched_class�types�FunctionType�get_unpatched_function)r����lookupr���r���r ���� get_unpatched&���s �����r���c�����������������C���s:���dd��t�|��D��}t|�}|j�d�s6d|��}t|��|S�)z�Protect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. c�����������������s���s���|�]}|j��d��s|V��qdS�)� setuptoolsN)� __module__� startswith)�.0r���r���r���r ���� <genexpr>5���s����z&get_unpatched_class.<locals>.<genexpr>� distutilsz(distutils has already been patched by %r)r ����nextr���r����AssertionError)r���Zexternal_bases�base�msgr���r���r ���r���/���s�����r���c������������������C���s����t�jtj_tjdk}�|�r"t�jtj_tjdk�p^dtj��k�o@dk�n��p^dtj��k�oZdkn��}|rrd}|tjj _ t���tjtjtj fD�]}t�jj|_q�t�jjtj_t�jjtj_dtjkr�t�jjtjd�_t���d�S�)N)��������r���)��������� ���)r�������)r���r$�������)r���r ���zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)r���ZCommandr���Zcore�sys�version_info�findallZfilelistZconfigZ PyPIRCCommandZDEFAULT_REPOSITORY�_patch_distribution_metadata�dist�cmdZDistribution� extensionZ Extension�modules�#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ warehouse�moduler���r���r ���� patch_allA���s*���� �� � r0���c������������������C���s*���dD�] }�t�tj|��}ttjj|�|��qdS�)zDPatch write_pkg_file and read_pkg_file for higher metadata standards)Zwrite_pkg_fileZ read_pkg_fileZget_metadata_versionN)�getattrr���r*����setattrr���ZDistributionMetadata)�attrZnew_valr���r���r ���r)���h���s����r)���c�����������������C���s*���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)r1����vars� setdefaultr2���)ZreplacementZ target_mod� func_name�originalr���r���r ���� patch_funco���s���� r9���c�����������������C���s ���t�|�d�S�)Nr4���)r1���)� candidater���r���r ���r�������s����r���c���������������������s����t�d���t���dkrdS���fdd�}�t�|�d�}t�|�d�}zt|d����t|d ����W�n�tk rl���Y�nX�zt|d ����W�n�tk r����Y�nX�zt|d����W�n�tk r����Y�nX�dS�)z\ Patch functions in distutils to use standalone Microsoft Visual C++ compilers. zsetuptools.msvcZWindowsNc��������������������sL���d|�krdnd}||��d��}t��|�}t|��}t||�sBt|��|||fS�)zT Prepare the parameters for patch_func to patch indicated function. �msvc9Zmsvc9_Zmsvc14_�_)�lstripr1���r����hasattr�ImportError)Zmod_namer7���Zrepl_prefixZ repl_name�repl�mod�Zmsvcr���r ����patch_params����s���� z9patch_for_msvc_specialized_compiler.<locals>.patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ_get_vc_envZgen_lib_options)r���r����system� functools�partialr9���r?���)rC���r;���Zmsvc14r���rB���r ���r.�������s&���� r.���)�__doc__r&���Zdistutils.filelistr���r���r���rE���� importlibr���r���Zsetuptools.externr���r����__all__r ���r���r���r0���r)���r9���r���r.���r���r���r���r ����<module>���s$��� '