Repository URL to install this package:
|
Version:
1.0.10 ▾
|
wlanpi-profiler
/
opt
/
wlanpi-profiler
/
lib
/
python3.7
/
site-packages
/
setuptools
/
__pycache__
/
monkey.cpython-37.pyc
|
|---|
B
½7ÙÎx
ã @ s d Z ddlZddlZddlZddlZddlZddlmZ ddl Z ddl
Z
g Zdd Zdd Z
dd Zd
d Zdd
Zdd Zdd Zdd ZdS )z
Monkey patching of distutils.
é N)Ú
import_modulec 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.
ÚJython)ÚplatformÚpython_implementationÚ __bases__ÚinspectÚgetmro)Úcls© r
ú/build/wlanpi-profiler-7At3M6/wlanpi-profiler-1.0.10/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/setuptools/monkey.pyÚ_get_mro s r c C s. t | trtnt | tjrtndd }|| S )Nc S s d S )Nr
)Úitemr
r
r Ú<lambda>( ó zget_unpatched.<locals>.<lambda>)Ú
isinstanceÚtypeÚ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 )zProtect 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>4 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 x"tjtjtj
fD ]}t jj|_qW 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 ÚCommandr ÚcoreÚsysÚversion_infoÚfindallÚfilelistÚconfigÚ
PyPIRCCommandÚDEFAULT_REPOSITORYÚ_patch_distribution_metadataÚdistÚcmdÚDistributionÚ extensionÚ ExtensionÚmodulesÚ#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ warehouseÚmoduler
r
r Ú patch_all? s$
r; c C s. x(dD ] } t tj| }ttjj| | qW dS )zDPatch write_pkg_file and read_pkg_file for higher metadata standards)Úwrite_pkg_fileÚ
read_pkg_fileZget_metadata_versionN)Úgetattrr r3 Úsetattrr ÚDistributionMetadata)ÚattrÚnew_valr
r
r r2 f s
r2 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)r>