ok

Mini Shell

Direktori : /opt/alt/python35/lib64/python3.5/importlib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/importlib/__pycache__/util.cpython-35.opt-2.pyc



���]S*�@s�ddlmZddlmZddlmZddlmZddlmZddlmZm	Z	ddlm
Z
ddlmZdd	lmZdd
lm
Z
ddlmZdd
lZdd
lZdd
lZdd
lZdd�Zd
dd�Zd
dd�Zedd��Zdd�Zdd�Zdd�ZGdd�dej�ZGdd�dej�ZGd d!�d!ej�Zd
S)"�)�abc)�module_from_spec)�
_resolve_name)�spec_from_loader)�
_find_spec)�MAGIC_NUMBER�_BACKCOMPAT_MAGIC_NUMBER)�cache_from_source)�
decode_source)�source_from_cache)�spec_from_file_location�)�contextmanagerNcCsv|jd�s|S|s.tdj|���d}x%|D]}|dkrNP|d7}q;Wt||d�||�S)N�.z,{!r} is not a relative name (no leading dot)r
r)�
startswith�
ValueError�formatr)�name�package�level�	character�r�)/opt/alt/python35/lib64/python3.5/util.py�resolve_names	
rcCs�|tjkrt||�Stj|}|dkr9dSy
|j}Wn*tk
rrtdj|��d�Yn&X|dkr�tdj|���|SdS)Nz{}.__spec__ is not setz{}.__spec__ is None)�sys�modulesr�__spec__�AttributeErrorrr)r�path�module�specrrr�_find_spec_from_path#s



r!cCs|jd�rt||�n|}|tjkr�|jd�d}|rqt|ddg�}t||j�St|d�Sn|tj|}|dkr�dSy
|j}Wn*t	k
r�t
dj|��d�Yn&X|dkr�t
dj|���|SdS)Nrr
�fromlist�__path__z{}.__spec__ is not setz{}.__spec__ is None)rrrr�
rpartition�
__import__rr#rrrr)rr�fullname�parent_name�parentrr rrr�	find_specBs"$


r)ccs�|tjk}tjj|�}|sOtt�|�}d|_|tj|<zKy	|VWn;tk
r�|s�ytj|=Wntk
r�YnXYnXWdd|_XdS)NTF)rr�get�type�__initializing__�	Exception�KeyError)r�	is_reloadrrrr�_module_to_loadjs	
	

r0cs%tj���fdd��}|S)Ncsutjdtdd��||�}t|dd�dkrq|j|_t|d�sq|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@cs%tj���fdd��}|S)NcsMtjdtdd��|||�}t|dd�dkrI||_|S)Nz7The import system now takes care of this automatically.r1r2�
__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�s!rDcs;tjdtdd�tj���fdd��}|S)Nz7The import system now takes care of this automatically.r1r2cs�t|��y}||_y|j|�}Wnttfk
rEYn)X|rX||_n|jd�d|_�||||�SWdQRXdS)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@seZdZdS)�_ModuleN)r8�
__module__�__qualname__rrrrrI�srIc@s(eZdZdd�Zdd�ZdS)�_LazyModulec	Cs	t|_|jj}|jj}|j}i}x]|j�D]O\}}||krb|||<q=t||�t||�kr=|||<q=W|jjj	|�|t
jkr�t|�tt
j|�kr�d}t|j
|���|jj|�t||�S)NzDmodule object for {!r} substituted in sys.modules during a lazy load)rI�	__class__rr�loader_state�__dict__�items�id�loader�exec_modulerrrr�updater7)	rB�attr�
original_name�
attrs_then�	attrs_now�
attrs_updated�key�value�msgrrr�__getattribute__�s"		
 z_LazyModule.__getattribute__cCs|j|�t||�dS)N)r]�delattr)rBrUrrr�__delattr__�s
z_LazyModule.__delattr__N)r8rJrKr]r_rrrrrL�s"rLc@sXeZdZedd��Zedd��Zdd�Zdd�Zd	d
�Z	dS)�
LazyLoadercCst|d�std��dS)NrSz loader must define exec_module())r9�	TypeError)rRrrr�__check_eager_loaderszLazyLoader.__check_eager_loadercs �j����fdd�S)Ncs��||��S)Nr)r:r;)�clsrRrr�<lambda>sz$LazyLoader.factory.<locals>.<lambda>)�_LazyLoader__check_eager_loader)rcrRr)rcrRr�factorys
zLazyLoader.factorycCs|j|�||_dS)N)rerR)rBrRrrr�__init__s
zLazyLoader.__init__cCs
t|j�S)N)rIr)rBr rrr�
create_moduleszLazyLoader.create_modulecCs=|j|j_|j|_|jj�|j_t|_dS)N)rRrrArO�copyrNrLrM)rBrrrrrSszLazyLoader.exec_moduleN)
r8rJrK�staticmethodre�classmethodrfrgrhrSrrrrr`s
r`) �r�
_bootstraprrrr�_bootstrap_externalrrr	r
rr�
contextlibrr>r�typesr4rr!r)r0r@rDrH�
ModuleTyperIrL�Loaderr`rrrr�<module>s0('.

Zerion Mini Shell 1.0