AlkantarClanX12

Your IP : 18.117.78.87


Current Path : /lib64/python3.6/importlib/__pycache__/
Upload File :
Current File : //lib64/python3.6/importlib/__pycache__/util.cpython-36.opt-2.pyc

3


 \�*�@sddlmZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddl
mZdd
lZdd
lZdd
lZdd
lZdd�Zd dd�Zd!dd�Zedd��Zdd�Zdd�Zdd�ZGdd�dej�ZGdd�dej�Zd
S)"�)�abc)�module_from_spec)�
_resolve_name)�spec_from_loader)�
_find_spec)�MAGIC_NUMBER)�cache_from_source)�
decode_source)�source_from_cache)�spec_from_file_location�)�contextmanagerNcCs^|jd�s|S|s&tdt|��d���d}x|D]}|dkr>P|d7}q0Wt||d�||�S)N�.zno package specified for z% (required for relative module names)rr)�
startswith�
ValueError�reprr)�name�package�level�	character�r�&/usr/lib64/python3.6/importlib/util.py�resolve_names

rcCsx|tjkrt||�Stj|}|dkr*dSy
|j}Wn$tk
rXtdj|��d�YnX|dkrptdj|���|SdS)Nz{}.__spec__ is not setz{}.__spec__ is None)�sys�modulesr�__spec__�AttributeErrorr�format)r�path�module�specrrr�_find_spec_from_path#s



r!cCs�|jd�rt||�n|}|tjkrZ|jd�d}|rNt|dgd�}t||j�St|d�Sn`tj|}|dkrpdSy
|j}Wn$t	k
r�t
dj|��d�YnX|dkr�t
dj|���|SdS)Nrr�__path__)�fromlistz{}.__spec__ is not setz{}.__spec__ is None)rrrr�
rpartition�
__import__rr"rrrr)rr�fullname�parent_name�parentrr rrr�	find_specBs"


r)ccs�|tjk}tjj|�}|s6tt�|�}d|_|tj|<zJy
|VWn:tk
r||sxytj|=Wntk
rvYnXYnXWdd|_XdS)NTF)rr�get�type�__initializing__�	Exception�KeyError)r�	is_reloadrrrr�_module_to_loadjs


r0cstj���fdd��}|S)NcsRtjdtdd��||�}t|dd�dkrN|j|_t|d�sN|jjd�d|_|S)Nz7The import system now takes care of this automatically.�)�
stacklevel�__package__r"rr)�warnings�warn�DeprecationWarning�getattr�__name__r3�hasattrr$)�args�kwargsr)�fxnrr�set_package_wrapper�s


z(set_package.<locals>.set_package_wrapper)�	functools�wraps)r<r=r)r<r�set_package�s
r@cstj���fdd��}|S)Ncs:tjdtdd��|f|�|�}t|dd�dkr6||_|S)Nz7The import system now takes care of this automatically.r1)r2�
__loader__)r4r5r6r7rA)�selfr:r;r)r<rr�set_loader_wrapper�s
z&set_loader.<locals>.set_loader_wrapper)r>r?)r<rCr)r<r�
set_loader�srDcs*tjdtdd�tj���fdd��}|S)Nz7The import system now takes care of this automatically.r1)r2cspt|��^}||_y|j|�}Wnttfk
r6YnX|rD||_n|jd�d|_�||f|�|�SQRXdS)Nrr)r0rA�
is_package�ImportErrorrr3r$)rBr&r:r;rrE)r<rr�module_for_loader_wrapper�s
z4module_for_loader.<locals>.module_for_loader_wrapper)r4r5r6r>r?)r<rGr)r<r�module_for_loader�s
rHc@seZdZdd�Zdd�ZdS)�_LazyModulec	Cs�tj|_|jj}|jjd}|jjd}|j}i}xF|j�D]:\}}||krV|||<q<t||�t||�kr<|||<q<W|jj	j
|�|tjkr�t|�ttj|�kr�t
d|�d���|jj|�t||�S)N�__dict__�	__class__zmodule object for z. substituted in sys.modules during a lazy load)�types�
ModuleTyperKrr�loader_staterJ�items�id�loader�exec_modulerrr�updater7)	rB�attr�
original_name�
attrs_then�
original_type�	attrs_now�
attrs_updated�key�valuerrr�__getattribute__�s"

z_LazyModule.__getattribute__cCs|j|�t||�dS)N)r\�delattr)rBrTrrr�__delattr__�s
z_LazyModule.__delattr__N)r8�
__module__�__qualname__r\r^rrrrrI�s#rIc@s<eZdZedd��Zedd��Zdd�Zdd�Zd	d
�Z	dS)�
LazyLoadercCst|d�std��dS)NrRz loader must define exec_module())r9�	TypeError)rQrrr�__check_eager_loaders
zLazyLoader.__check_eager_loadercs�j����fdd�S)Ncs��||��S)Nr)r:r;)�clsrQrr�<lambda>sz$LazyLoader.factory.<locals>.<lambda>)�_LazyLoader__check_eager_loader)rdrQr)rdrQr�factorys
zLazyLoader.factorycCs|j|�||_dS)N)rfrQ)rBrQrrr�__init__
s
zLazyLoader.__init__cCs|jj|�S)N)rQ�
create_module)rBr rrrriszLazyLoader.create_modulecCs@|j|j_|j|_i}|jj�|d<|j|d<||j_t|_dS)NrJrK)rQrrArJ�copyrKrNrI)rBrrNrrrrRs

zLazyLoader.exec_moduleN)
r8r_r`�staticmethodrf�classmethodrgrhrirRrrrrra�s
ra)N)N)�r�
_bootstraprrrr�_bootstrap_externalrrr	r
r�
contextlibr
r>rrLr4rr!r)r0r@rDrHrMrI�Loaderrarrrr�<module>s.

('/