AlkantarClanX12

Your IP : 3.144.2.5


Current Path : /proc/self/root/opt/alt/python35/lib64/python3.5/importlib/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python35/lib64/python3.5/importlib/__pycache__/_bootstrap.cpython-35.pyc



��Yf��@s�dZdadd�Zdd�ZGdd�d�ZiZiZGdd	�d	e�ZGd
d�d�Z	Gdd
�d
�Z
Gdd�d�Zdd�Zdd�Z
dd�Zdddd�Zdd�Zdd�Zdd�Zd d!�ZGd"d#�d#�ZGd$d%�d%�Zd&dd'dd(d)�Ze�Zddd*d+�Zd,d-d.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z Gd<d=�d=�Z!Gd>d?�d?�Z"Gd@dA�dA�Z#dBdC�Z$dDdE�Z%ddFdG�Z&dHdI�Z'dJZ(e(dKZ)dLdM�Z*dNdO�Z+ddPdQdR�Z,dSdT�Z-dUdV�Z.ddfdPdWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2dS)_aSCore implementation of import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.

NcCs\xBddddgD].}t||�rt||t||��qW|jj|j�dS)z/Simple substitute for functools.update_wrapper.�
__module__�__name__�__qualname__�__doc__N)�hasattr�setattr�getattr�__dict__�update)�new�old�replace�r
�9/opt/alt/python35/lib64/python3.5/importlib/_bootstrap.py�_wrapsrcCstt�|�S)N)�type�sys)�namer
r
r�_new_module#src@s:eZdZdZdd�Zdd�Zdd�ZdS)	�
_ManageReloadz?Manages the possible clean-up of sys.modules for load_module().cCs
||_dS)N)�_name)�selfrr
r
r�__init__+sz_ManageReload.__init__cCs|jtjk|_dS)N)rr�modules�
_is_reload)rr
r
r�	__enter__.sz_ManageReload.__enter__cGsMtdd�|D��rI|jrIytj|j=Wntk
rHYnXdS)Ncss|]}|dk	VqdS)Nr
)�.0�argr
r
r�	<genexpr>2sz)_ManageReload.__exit__.<locals>.<genexpr>)�anyrrrr�KeyError)r�argsr
r
r�__exit__1s
#
z_ManageReload.__exit__N)rrrrrrr!r
r
r
rr'src@seZdZdS)�_DeadlockErrorN)rrrr
r
r
rr"@sr"c@sReZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_ModuleLockz�A recursive lock implementation which is able to detect deadlocks
    (e.g. thread 1 trying to take locks A then B, and thread 2 trying to
    take locks B then A).
    cCsFtj�|_tj�|_||_d|_d|_d|_dS)N�)�_thread�
allocate_lock�lock�wakeupr�owner�count�waiters)rrr
r
rrJs			z_ModuleLock.__init__cCsXtj�}|j}x<tj|�}|dkr7dS|j}||krdSqWdS)NFT)r%�	get_identr)�_blocking_on�get)r�me�tidr'r
r
r�has_deadlockRs		z_ModuleLock.has_deadlockcCs�tj�}|t|<z�x�|j�||jdksD|j|kr`||_|jd7_dS|j�r|td|��|jj	d�r�|j
d7_
WdQRX|jj	�|jj�qWWdt|=XdS)z�
        Acquire the module lock.  If a potential deadlock is detected,
        a _DeadlockError is raised.
        Otherwise, the lock is always acquired and True is returned.
        r$�Tzdeadlock detected by %rFN)r%r,r-r'r*r)r1r"r(�acquirer+�release)rr0r
r
rr3^s 

	
z_ModuleLock.acquirec
Cs�tj�}|j��|j|kr1td��|jdksFt�|jd8_|jdkr�d|_|jr�|jd8_|jj	�WdQRXdS)Nzcannot release un-acquired lockr$r2)
r%r,r'r)�RuntimeErrorr*�AssertionErrorr+r(r4)rr0r
r
rr4ws
		z_ModuleLock.releasecCsdj|jt|��S)Nz_ModuleLock({!r}) at {})�formatr�id)rr
r
r�__repr__�sz_ModuleLock.__repr__N)	rrrrrr1r3r4r9r
r
r
rr#Ds
r#c@sFeZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_DummyModuleLockzVA simple _ModuleLock equivalent for Python builds without
    multi-threading support.cCs||_d|_dS)Nr$)rr*)rrr
r
rr�s	z_DummyModuleLock.__init__cCs|jd7_dS)Nr2T)r*)rr
r
rr3�sz_DummyModuleLock.acquirecCs.|jdkrtd��|jd8_dS)Nr$zcannot release un-acquired lockr2)r*r5)rr
r
rr4�sz_DummyModuleLock.releasecCsdj|jt|��S)Nz_DummyModuleLock({!r}) at {})r7rr8)rr
r
rr9�sz_DummyModuleLock.__repr__N)rrrrrr3r4r9r
r
r
rr:�s
r:c@s4eZdZdd�Zdd�Zdd�ZdS)�_ModuleLockManagercCs||_d|_dS)N)r�_lock)rrr
r
rr�s	z_ModuleLockManager.__init__c
Cs5zt|j�|_Wdtj�X|jj�dS)N)�_get_module_lockrr<�_imp�release_lockr3)rr
r
rr�sz_ModuleLockManager.__enter__cOs|jj�dS)N)r<r4)rr �kwargsr
r
rr!�sz_ModuleLockManager.__exit__N)rrrrrr!r
r
r
rr;�sr;cs�d}yt��}Wntk
r+YnX|dkr�tdkrSt��}nt��}�fdd�}tj||�t�<|S)zmGet or create the module lock for a given module name.

    Should only be called with the import lock taken.Ncst�=dS)N)�
_module_locks)�_)rr
r�cb�sz_get_module_lock.<locals>.cb)rArr%r:r#�_weakref�ref)rr'rCr
)rrr=�s
r=cCsGt|�}tj�y|j�Wntk
r8YnX|j�dS)aRelease the global import lock, and acquires then release the
    module lock for a given module name.
    This is used to ensure a module is completely initialized, in the
    event it is being imported by another thread.

    Should only be called with the import lock taken.N)r=r>r?r3r"r4)rr'r
r
r�_lock_unlock_module�s

rFcOs
|||�S)a.remove_importlib_frames in import.c will always remove sequences
    of importlib frames that end with a call to this function

    Use it instead of a normal call in places where including the importlib
    frames introduces unwanted noise into the traceback (e.g. when executing
    module code)
    r
)�fr �kwdsr
r
r�_call_with_frames_removed�srI�	verbosityr2cGsKtjj|krG|jd�s+d|}t|j|�dtj�dS)z=Print the message to stderr if -v/PYTHONVERBOSE is turned on.�#�import z# �fileN)rKrL)r�flags�verbose�
startswith�printr7�stderr)�messagerJr r
r
r�_verbose_message�s
rTcs#�fdd�}t|��|S)z1Decorator to verify the named module is built-in.cs7|tjkr*tdj|�d|���||�S)Nz{!r} is not a built-in moduler)r�builtin_module_names�ImportErrorr7)r�fullname)�fxnr
r�_requires_builtin_wrapper�s	z4_requires_builtin.<locals>._requires_builtin_wrapper)r)rXrYr
)rXr�_requires_builtin�s
rZcs#�fdd�}t|��|S)z/Decorator to verify the named module is frozen.cs7tj|�s*tdj|�d|���||�S)Nz{!r} is not a frozen moduler)r>�	is_frozenrVr7)rrW)rXr
r�_requires_frozen_wrapper�s	z2_requires_frozen.<locals>._requires_frozen_wrapper)r)rXr\r
)rXr�_requires_frozen�s
r]cCsQt||�}|tjkrCtj|}t||�tj|St|�SdS)z�Load the specified module into sys.modules and return it.

    This method is deprecated.  Use loader.exec_module instead.

    N)�spec_from_loaderrr�_exec�_load)rrW�spec�moduler
r
r�_load_module_shims

rcc#Cst|dd�}t|d�rGy|j|�SWntk
rFYnXy
|j}Wntk
rhYnX|dk	rt|�Sy
|j}Wntk
r�d}YnXy
|j}Wn;tk
r�|dkr�dj	|�Sdj	||�SYnXdj	||�SdS)N�
__loader__�module_repr�?z
<module {!r}>z<module {!r} ({!r})>z<module {!r} from {!r}>)
rrre�	Exception�__spec__�AttributeError�_module_repr_from_specr�__file__r7)rb�loaderrar�filenamer
r
r�_module_reprs.








rnc@s4eZdZdd�Zdd�Zdd�ZdS)�_installed_safelycCs||_|j|_dS)N)�_modulerh�_spec)rrbr
r
rr6s	z_installed_safely.__init__cCs&d|j_|jtj|jj<dS)NT)rq�
_initializingrprrr)rr
r
rr:sz_installed_safely.__enter__cGsyze|j}tdd�|D��rNytj|j=Wqdtk
rJYqdXntd|j|j�Wdd|j_XdS)Ncss|]}|dk	VqdS)Nr
)rrr
r
rrDsz-_installed_safely.__exit__.<locals>.<genexpr>zimport {!r} # {!r}F)	rqrrrrrrTrlrr)rr rar
r
rr!As	
z_installed_safely.__exit__N)rrrrrr!r
r
r
rro4sroc@s�eZdZdZdddddddd�Zdd	�Zd
d�Zedd
��Zej	dd
��Zedd��Z
edd��Zej	dd��ZdS)�
ModuleSpeca�The specification for a module, used for loading.

    A module's spec is the source for information about the module.  For
    data associated with the module, including source, use the spec's
    loader.

    `name` is the absolute name of the module.  `loader` is the loader
    to use when loading the module.  `parent` is the name of the
    package the module is in.  The parent is derived from the name.

    `is_package` determines if the module is considered a package or
    not.  On modules this is reflected by the `__path__` attribute.

    `origin` is the specific location used by the loader from which to
    load the module, if that information is available.  When filename is
    set, origin will match.

    `has_location` indicates that a spec's "origin" reflects a location.
    When this is True, `__file__` attribute of the module is set.

    `cached` is the location of the cached bytecode file, if any.  It
    corresponds to the `__cached__` attribute.

    `submodule_search_locations` is the sequence of path entries to
    search when importing submodules.  If set, is_package should be
    True--and False otherwise.

    Packages are simply modules that (may) have submodules.  If a spec
    has a non-None value in `submodule_search_locations`, the import
    system will consider modules loaded from the spec as packages.

    Only finders (see importlib.abc.MetaPathFinder and
    importlib.abc.PathEntryFinder) should modify ModuleSpec instances.

    �originN�loader_state�
is_packagecCsO||_||_||_||_|r0gnd|_d|_d|_dS)NF)rrlrtru�submodule_search_locations�
_set_fileattr�_cached)rrrlrtrurvr
r
rrts					zModuleSpec.__init__cCs�dj|j�dj|j�g}|jdk	rL|jdj|j��|jdk	rt|jdj|j��dj|jjdj|��S)Nz	name={!r}zloader={!r}zorigin={!r}zsubmodule_search_locations={}z{}({})z, )	r7rrlrt�appendrw�	__class__r�join)rr r
r
rr9�s
zModuleSpec.__repr__cCs�|j}yk|j|jkor|j|jkor|j|jkor||jkor|j|jkor|j|jkSWntk
r�dSYnXdS)NF)rwrrlrt�cached�has_locationri)r�other�smslr
r
r�__eq__�s	
zModuleSpec.__eq__cCsU|jdkrN|jdk	rN|jrNtdkr9t�tj|j�|_|jS)N)ryrtrx�_bootstrap_external�NotImplementedError�_get_cached)rr
r
rr}�szModuleSpec.cachedcCs
||_dS)N)ry)rr}r
r
rr}�scCs.|jdkr#|jjd�dS|jSdS)z The name of the module's parent.N�.r$)rwr�
rpartition)rr
r
r�parent�szModuleSpec.parentcCs|jS)N)rx)rr
r
rr~�szModuleSpec.has_locationcCst|�|_dS)N)�boolrx)r�valuer
r
rr~�s)rrrrrr9r��propertyr}�setterr�r~r
r
r
rrsOs#
	rsrtrvcCs�t|d�rntdkr!t�tj}|dkrF||d|�S|rRgnd}||d|d|�S|dkr�t|d�r�y|j|�}Wq�tk
r�d}Yq�Xnd}t||d|d|�S)z5Return a module spec based on various loader methods.�get_filenameNrlrwrvFrt)rr�r��spec_from_file_locationrvrVrs)rrlrtrvr��searchr
r
rr^�s"	
r^c5Csvy
|j}Wntk
r!YnX|dk	r2|S|j}|dkriy
|j}Wntk
rhYnXy
|j}Wntk
r�d}YnX|dkr�|dkr�y
|j}Wq�tk
r�d}Yq�Xn|}y
|j}Wntk
rd}YnXyt|j�}Wntk
r/d}YnXt	||d|�}|dkrWdnd|_
||_||_|S)NrtFT)
rhrirrdrk�_ORIGIN�
__cached__�list�__path__rsrxr}rw)rbrlrtrar�locationr}rwr
r
r�_spec_from_module�sH

	








		r��overrideFc;Cs6|st|dd�dkrCy|j|_Wntk
rBYnX|sat|dd�dkr�|j}|dkr�|jdk	r�tdkr�t�tj}|j	|�}|j|_
y
||_Wntk
r�YnX|s�t|dd�dkr y|j|_
Wntk
rYnXy
||_Wntk
rAYnX|s`t|dd�dkr�|jdk	r�y|j|_Wntk
r�YnX|jr2|s�t|dd�dkr�y|j|_Wntk
r�YnX|s�t|dd�dkr2|jdk	r2y|j|_Wntk
r1YnX|S)Nrrd�__package__r�rkr�)rrrrirlrwr�r��_NamespaceLoader�__new__�_pathrdr�r�rhr�r~rtrkr}r�)rarbr�rlr�r
r
r�_init_module_attrs�s\
		





	

r�cCs�d}t|jd�r-|jj|�}n(t|jd�rUtjdtdd�|dkrpt|j�}t||�|S)z+Create a module based on the provided spec.N�
create_module�exec_modulezWstarting in Python 3.6, loaders defining exec_module() must also define create_module()�
stacklevel�)	rrlr��	_warnings�warn�DeprecationWarningrrr�)rarbr
r
r�module_from_spec:s	

r�cCs�|jdkrdn|j}|jdkr_|jdkrIdj|�Sdj||j�Sn2|jr{dj||j�Sdj|j|j�SdS)z&Return the repr to use for the module.Nrfz
<module {!r}>z<module {!r} ({!r})>z<module {!r} from {!r}>z<module {!r} ({})>)rrtrlr7r~)rarr
r
rrjLs
	rjcCs�|j}tj�t|���tjj|�|k	rYdj|�}t|d|��|j	dkr�|j
dkr�tdd|j��t||dd�|St||dd�t|j	d�s�|j	j
|�n|j	j|�WdQRXtj|S)z3Execute the spec in an existing module's namespace.zmodule {!r} not in sys.modulesrNzmissing loaderr�Tr�)rr>�acquire_lockr;rrr.r7rVrlrwr�r�load_moduler�)rarbr�msgr
r
rr_]s 	

r_cCs|jj|j�tj|j}t|dd�dkr`y|j|_Wntk
r_YnXt|dd�dkr�y8|j|_	t
|d�s�|jjd�d|_	Wntk
r�YnXt|dd�dkr�y
||_Wntk
r�YnX|S)Nrdr�r�r�r$rh)
rlr�rrrrrdrirr�rr�rh)rarbr
r
r�_load_backward_compatiblevs(



r�cCs�|jdk	r+t|jd�s+t|�St|�}t|��K|jdkrz|jdkr�tdd|j��n|jj|�WdQRXt	j
|jS)Nr�zmissing loaderr)rlrr�r�rorwrVrr�rr)rarbr
r
r�_load_unlocked�s

r�c	Cs/tj�t|j��t|�SWdQRXdS)z�Return a new module object, loaded by the spec's loader.

    The module is not added to its parent.

    If a module is already in sys.modules, that existing module gets
    clobbered.

    N)r>r�r;rr�)rar
r
rr`�s	
r`c@s�eZdZdZedd��Zedddd��Zeddd��Zed	d
��Z	edd��Z
eed
d���Zeedd���Z
eedd���Zee�ZdS)�BuiltinImporterz�Meta path import for built-in modules.

    All methods are either class or static methods to avoid the need to
    instantiate the class.

    cCsdj|j�S)zsReturn repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        z<module {!r} (built-in)>)r7r)rbr
r
rre�szBuiltinImporter.module_reprNcCs:|dk	rdStj|�r2t||dd�SdSdS)Nrtzbuilt-in)r>�
is_builtinr^)�clsrW�path�targetr
r
r�	find_spec�s
zBuiltinImporter.find_speccCs)|j||�}|dk	r%|jSdS)z�Find the built-in module.

        If 'path' is ever specified then the search is considered a failure.

        This method is deprecated.  Use find_spec() instead.

        N)r�rl)r�rWr�rar
r
r�find_module�s	zBuiltinImporter.find_modulecCsC|jtjkr3tdj|j�d|j��ttj|�S)zCreate a built-in modulez{!r} is not a built-in moduler)rrrUrVr7rIr>�create_builtin)rrar
r
rr��szBuiltinImporter.create_modulecCsttj|�dS)zExec a built-in moduleN)rIr>�exec_builtin)rrbr
r
rr��szBuiltinImporter.exec_modulecCsdS)z9Return None as built-in modules do not have code objects.Nr
)r�rWr
r
r�get_code�szBuiltinImporter.get_codecCsdS)z8Return None as built-in modules do not have source code.Nr
)r�rWr
r
r�
get_source�szBuiltinImporter.get_sourcecCsdS)z4Return False as built-in modules are never packages.Fr
)r�rWr
r
rrv�szBuiltinImporter.is_package)rrrr�staticmethodre�classmethodr�r�r�r�rZr�r�rvrcr�r
r
r
rr��s	r�c@s�eZdZdZedd��Zedddd��Zeddd��Zed	d
��Z	edd��Z
ed
d��Zeedd���Z
eedd���Zeedd���ZdS)�FrozenImporterz�Meta path import for frozen modules.

    All methods are either class or static methods to avoid the need to
    instantiate the class.

    cCsdj|j�S)zsReturn repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        z<module {!r} (frozen)>)r7r)�mr
r
rreszFrozenImporter.module_reprNcCs*tj|�r"t||dd�SdSdS)Nrt�frozen)r>r[r^)r�rWr�r�r
r
rr�szFrozenImporter.find_speccCstj|�r|SdS)z]Find a frozen module.

        This method is deprecated.  Use find_spec() instead.

        N)r>r[)r�rWr�r
r
rr�szFrozenImporter.find_modulecCsdS)z*Use default semantics for module creation.Nr
)r�rar
r
rr�%szFrozenImporter.create_modulecCs\|jj}tj|�s6tdj|�d|��ttj|�}t||j	�dS)Nz{!r} is not a frozen moduler)
rhrr>r[rVr7rI�get_frozen_object�execr)rbr�coder
r
rr�)s	zFrozenImporter.exec_modulecCs
t||�S)z_Load a frozen module.

        This method is deprecated.  Use exec_module() instead.

        )rc)r�rWr
r
rr�2szFrozenImporter.load_modulecCs
tj|�S)z-Return the code object for the frozen module.)r>r�)r�rWr
r
rr�;szFrozenImporter.get_codecCsdS)z6Return None as frozen modules do not have source code.Nr
)r�rWr
r
rr�AszFrozenImporter.get_sourcecCs
tj|�S)z.Return True if the frozen module is a package.)r>�is_frozen_package)r�rWr
r
rrvGszFrozenImporter.is_package)rrrrr�rer�r�r�r�r�r�r]r�r�rvr
r
r
rr�s			r�c@s.eZdZdZdd�Zdd�ZdS)�_ImportLockContextz$Context manager for the import lock.cCstj�dS)zAcquire the import lock.N)r>r�)rr
r
rrTsz_ImportLockContext.__enter__cCstj�dS)z<Release the import lock regardless of any raised exceptions.N)r>r?)r�exc_type�	exc_value�
exc_tracebackr
r
rr!Xsz_ImportLockContext.__exit__N)rrrrrr!r
r
r
rr�Psr�cCsX|jd|d�}t|�|kr4td��|d}|rTdj||�S|S)z2Resolve a relative module name to an absolute one.r�r2z2attempted relative import beyond top-level packager$z{}.{})�rsplit�len�
ValueErrorr7)r�package�level�bits�baser
r
r�
_resolve_name]s

r�cCs/|j||�}|dkr"dSt||�S)N)r�r^)�finderrr�rlr
r
r�_find_spec_legacyfsr�c	Cs*tjdk	r)tjr)tjdt�|tjk}x�tjD]�}t��Zy
|j}Wn3tk
r�t	|||�}|dkr�wBYnX||||�}WdQRX|dk	rB|r|tjkrtj|}y
|j
}Wntk
r|SYqX|dkr|S|SqB|SqBWdSdS)zFind a module's loader.Nzsys.meta_path is empty)r�	meta_pathr�r��
ImportWarningrr�r�rir�rh)	rr�r��	is_reloadr�r�rarbrhr
r
r�
_find_specos0





	r�cCs�t|t�s*tdjt|����|dkrBtd��|dkr~t|t�sltd��n|s~td��|r�|dkr�td��dS)zVerify arguments are "sane".zmodule name must be str, not {}r$zlevel must be >= 0z__package__ not set to a stringz6attempted relative import with no known parent packagezEmpty module nameN)�
isinstance�str�	TypeErrorr7rr�rV)rr�r�r
r
r�
_sanity_check�sr�zNo module named z{!r}cCs(d}|jd�d}|r�|tjkr;t||�|tjkrUtj|Stj|}y
|j}Wn=tk
r�tdj||�}t|d|�d�YnXt	||�}|dkr�ttj|�d|��nt
|�}|r$tj|}t||jd�d|�|S)Nr�r$z; {!r} is not a packagerr�)r�rrrIr�ri�_ERR_MSGr7rVr�r�r)r�import_r�r��
parent_moduler�rarbr
r
r�_find_and_load_unlocked�s*




r�c
Cs%t|��t||�SWdQRXdS)z6Find and load the module, and release the import lock.N)r;r�)rr�r
r
r�_find_and_load�s
r�r$cCs�t|||�|dkr.t|||�}tj�|tjkrTt|t�Stj|}|dkr�tj�dj	|�}t
|d|��t|�|S)a2Import and return the module based on its name, the package the call is
    being made from, and the level adjustment.

    This function represents the greatest common denominator of functionality
    between import_module and __import__. This includes setting __package__ if
    the loader did not.

    r$Nz(import of {} halted; None in sys.modulesr)r�r�r>r�rrr��_gcd_importr?r7rVrF)rr�r�rbrSr
r
rr��s	



	
r�cCs�t|d�r�d|krSt|�}|jd�t|d�rS|j|j�x�|D]�}t||�sZdj|j|�}yt||�WqZtk
r�}z/t	|�j
t�r�|j|kr�wZ�WYdd}~XqZXqZW|S)z�Figure out what __import__ should return.

    The import_ parameter is a callable which takes the name of module to
    import. It is required to decouple the function from assuming importlib's
    import implementation is desired.

    r��*�__all__z{}.{}N)
rr��remove�extendr�r7rrIrVr�rP�_ERR_MSG_PREFIXr)rb�fromlistr��x�	from_name�excr
r
r�_handle_fromlist�s"


r�cCsH|jd�}|dkrD|d}d|krD|jd�d}|S)z�Calculate what __package__ should be.

    __package__ is not guaranteed to be defined or could be set to None
    to represent that its proper value is unknown.

    r�Nrr�r�r$)r.r�)�globalsr�r
r
r�_calc___package__s
r�c	Cs�|dkrt|�}n6|dk	r-|ni}t|�}t|||�}|s�|dkrzt|jd�d�S|s�|St|�t|jd�d�}tj|jdt|j�|�Snt||t�SdS)a�Import a module.

    The 'globals' argument is used to infer where the import is occurring from
    to handle relative imports. The 'locals' argument is ignored. The
    'fromlist' argument specifies what should exist as attributes on the module
    being imported (e.g. ``from module import <fromlist>``).  The 'level'
    argument represents the package location to import from in a relative
    import (e.g. ``from ..pkg import mod`` would have a 'level' of 2).

    r$Nr�)r�r��	partitionr�rrrr�)	rr��localsr�r�rb�globals_r��cut_offr
r
r�
__import__s#(r�cCs5tj|�}|dkr+td|��t|�S)Nzno built-in module named )r�r�rVr�)rrar
r
r�_builtin_from_name5sr�cCsJ|a|att�}x{tjj�D]j\}}t||�r(|tjkr[t}ntj|�r(t	}nq(t
||�}t||�q(Wtjt}xIdD]A}|tjkr�t
|�}	n
tj|}	t|||	�q�Wyt
d�}
Wntk
rd}
YnXt|d|
�t
d�}t|d|�dS)z�Setup importlib by importing needed built-in modules and injecting them
    into the global namespace.

    As sys is needed for sys.modules access and _imp is needed to load built-in
    modules, those two modules must be explicitly passed in.

    r�r%NrD)r�)r>rrr�itemsr�rUr�r[r�r�r�rr�rrV)�
sys_module�_imp_module�module_typerrbrlra�self_module�builtin_name�builtin_module�
thread_module�weakref_moduler
r
r�_setup<s2			



r�cCsWt||�tjjt�tjjt�ddl}|a|jtj	t
�dS)z2Install importlib as the implementation of import.r$N)r�rr�rzr�r��_frozen_importlib_externalr��_installrr)r�r�r�r
r
rr�ks
r�)3rr�rrrrAr-r5r"r#r:r;r=rFrIrTrZr]rcrnrorsr^�object�	_POPULATEr�r�r�rjr_r�r�r`r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
r�<module>s`D$e	-<IM
		(
 #/