Your IP : 3.147.73.117


Current Path : /opt/alt/python35/lib64/python3.5/importlib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/importlib/__pycache__/_bootstrap.cpython-35.opt-1.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�l|j|kr1td��|jd8_|jdkr}d|_|jr}|jd8_|jj�WdQRXdS)Nzcannot release un-acquired lockr2r$)	r%r,r'r)�RuntimeErrorr*r+r(r4)rr0r
r
rr4ws
		z_ModuleLock.releasecCsdj|jt|��S)Nz_ModuleLock({!r}) at {})�formatr�id)rr
r
r�__repr__�sz_ModuleLock.__repr__N)	rrrrrr1r3r4r8r
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 {})r6rr7)rr
r
rr8�sz_DummyModuleLock.__repr__N)rrrrrr3r4r8r
r
r
rr9�s
r9c@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)r@rr%r9r#�_weakref�ref)rr'rBr
)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

rEcOs
|||�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�srH�	verbosityr2cGsKtjj|krG|jd�s+d|}t|j|�dtj�dS)z=Print the message to stderr if -v/PYTHONVERBOSE is turned on.�#�import z# �fileN)rJrK)r�flags�verbose�
startswith�printr6�stderr)�messagerIr r
r
r�_verbose_message�s
rScs#�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�ImportErrorr6)r�fullname)�fxnr
r�_requires_builtin_wrapper�s	z4_requires_builtin.<locals>._requires_builtin_wrapper)r)rWrXr
)rWr�_requires_builtin�s
rYcs#�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_frozenrUr6)rrV)rWr
r�_requires_frozen_wrapper�s	z2_requires_frozen.<locals>._requires_frozen_wrapper)r)rWr[r
)rWr�_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)rrV�spec�moduler
r
r�_load_module_shims

rbc#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}>)
rrrd�	Exception�__spec__�AttributeError�_module_repr_from_specr�__file__r6)ra�loaderr`r�filenamer
r
r�_module_reprs.








rmc@s4eZdZdd�Zdd�Zdd�ZdS)�_installed_safelycCs||_|j|_dS)N)�_modulerg�_spec)rrar
r
rr6s	z_installed_safely.__init__cCs&d|j_|jtj|jj<dS)NT)rp�
_initializingrorrr)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)	rprrrrrrSrkrq)rr r`r
r
rr!As	
z_installed_safely.__exit__N)rrrrrr!r
r
r
rrn4srnc@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)rrkrsrt�submodule_search_locations�
_set_fileattr�_cached)rrrkrsrtrur
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, )	r6rrkrs�appendrv�	__class__r�join)rr r
r
rr8�s
zModuleSpec.__repr__cCs�|j}yk|j|jkor|j|jkor|j|jkor||jkor|j|jkor|j|jkSWntk
r�dSYnXdS)NF)rvrrkrs�cached�has_locationrh)r�other�smslr
r
r�__eq__�s	
zModuleSpec.__eq__cCsU|jdkrN|jdk	rN|jrNtdkr9t�tj|j�|_|jS)N)rxrsrw�_bootstrap_external�NotImplementedError�_get_cached)rr
r
rr|�szModuleSpec.cachedcCs
||_dS)N)rx)rr|r
r
rr|�scCs.|jdkr#|jjd�dS|jSdS)z The name of the module's parent.N�.r$)rvr�
rpartition)rr
r
r�parent�szModuleSpec.parentcCs|jS)N)rw)rr
r
rr}�szModuleSpec.has_locationcCst|�|_dS)N)�boolrw)r�valuer
r
rr}�s)rrrrrr8r��propertyr|�setterr�r}r
r
r
rrrOs#
	rrrsrucCs�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_filenameNrkrvruFrs)rr�r��spec_from_file_locationrurUrr)rrkrsrur��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)NrsFT)
rgrhrrcrj�_ORIGIN�
__cached__�list�__path__rrrwr|rv)rarkrsr`r�locationr|rvr
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)Nrrc�__package__r�rjr�)rrrrhrkrvr�r��_NamespaceLoader�__new__�_pathrcr�r�rgr�r}rsrjr|r�)r`rar�rkr�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�)	rrkr��	_warnings�warn�DeprecationWarningrrr�)r`rar
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.Nrez
<module {!r}>z<module {!r} ({!r})>z<module {!r} from {!r}>z<module {!r} ({})>)rrsrkr6r})r`rr
r
rriLs
	ric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.r6rUrkrvr�r�load_moduler�)r`rar�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)Nrcr�r�r�r$rg)
rkr�rrrrrcrhrr�rr�rg)r`rar
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)rkrr�r�rnrvrUrr�rr)r`rar
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�)r`r
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)>)r6r)rar
r
rrd�szBuiltinImporter.module_reprNcCs:|dk	rdStj|�r2t||dd�SdSdS)Nrszbuilt-in)r=�
is_builtinr])�clsrV�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�rk)r�rVr�r`r
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)rrrTrUr6rHr=�create_builtin)rr`r
r
rr��szBuiltinImporter.create_modulecCsttj|�dS)zExec a built-in moduleN)rHr=�exec_builtin)rrar
r
rr��szBuiltinImporter.exec_modulecCsdS)z9Return None as built-in modules do not have code objects.Nr
)r�rVr
r
r�get_code�szBuiltinImporter.get_codecCsdS)z8Return None as built-in modules do not have source code.Nr
)r�rVr
r
r�
get_source�szBuiltinImporter.get_sourcecCsdS)z4Return False as built-in modules are never packages.Fr
)r�rVr
r
rru�szBuiltinImporter.is_package)rrrr�staticmethodrd�classmethodr�r�r�r�rYr�r�rurbr�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)>)r6r)�mr
r
rrdszFrozenImporter.module_reprNcCs*tj|�r"t||dd�SdSdS)Nrs�frozen)r=rZr])r�rVr�r�r
r
rr�szFrozenImporter.find_speccCstj|�r|SdS)z]Find a frozen module.

        This method is deprecated.  Use find_spec() instead.

        N)r=rZ)r�rVr�r
r
rr�szFrozenImporter.find_modulecCsdS)z*Use default semantics for module creation.Nr
)r�r`r
r
rr�%szFrozenImporter.create_modulecCs\|jj}tj|�s6tdj|�d|��ttj|�}t||j	�dS)Nz{!r} is not a frozen moduler)
rgrr=rZrUr6rH�get_frozen_object�execr)rar�coder
r
rr�)s	zFrozenImporter.exec_modulecCs
t||�S)z_Load a frozen module.

        This method is deprecated.  Use exec_module() instead.

        )rb)r�rVr
r
rr�2szFrozenImporter.load_modulecCs
tj|�S)z-Return the code object for the frozen module.)r=r�)r�rVr
r
rr�;szFrozenImporter.get_codecCsdS)z6Return None as frozen modules do not have source code.Nr
)r�rVr
r
rr�AszFrozenImporter.get_sourcecCs
tj|�S)z.Return True if the frozen module is a package.)r=�is_frozen_package)r�rVr
r
rruGszFrozenImporter.is_package)rrrrr�rdr�r�r�r�r�r�r\r�r�rur
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�
ValueErrorr6)r�package�level�bits�baser
r
r�
_resolve_name]s

r�cCs/|j||�}|dkr"dSt||�S)N)r�r])�finderrr�rkr
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�rhr�rg)	rr�r��	is_reloadr�r�r`rargr
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�	TypeErrorr6rr�rU)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�rrrHr�rh�_ERR_MSGr6rUr�r�r)r�import_r�r��
parent_moduler�r`rar
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>r6rUrE)rr�r�rarRr
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�r6rrHrUr�rO�_ERR_MSG_PREFIXr)ra�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�ra�globals_r��cut_offr
r
r�
__import__s#(r�cCs5tj|�}|dkr+td|��t|�S)Nzno built-in module named )r�r�rUr�)rr`r
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%NrC)r�)r=rrr�itemsr�rTr�rZr�r�r�rr�rrU)�
sys_module�_imp_module�module_typerrarkr`�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�ryr�r��_frozen_importlib_externalr��_installrr)r�r�r�r
r
rr�ks
r�)3rr�rrrr@r-r5r"r#r9r:r<rErHrSrYr\rbrmrnrrr]�object�	_POPULATEr�r�r�rir^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
		(
 #/

?>