Your IP : 3.147.58.216


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

3


 \���@s�dZdadd�Zdd�ZiZiZGdd�de�ZGdd	�d	�ZGd
d�d�Z	Gdd
�d
�Z
dd�Zdd�Zdd�Z
dd�dd�Zdd�Zdd�Zdd�Zdd�ZGd d!�d!�ZGd"d#�d#�Zddd$�d%d&�Zd]d'd(�Zd)d*�d+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�ZGd9d:�d:�ZGd;d<�d<�ZGd=d>�d>�Z d?d@�Z!dAdB�Z"d^dCdD�Z#dEdF�Z$dGZ%e%dHZ&dIdJ�Z'e(�Z)dKdL�Z*d_dNdO�Z+d)dP�dQdR�Z,dSdT�Z-ddfdMfdUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1dS)`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<x(dD] }t||�rt||t||��qW|jj|j�dS)z/Simple substitute for functools.update_wrapper.�
__module__�__name__�__qualname__�__doc__N)rrrr)�hasattr�setattr�getattr�__dict__�update)�new�old�replace�r
�"/usr/lib64/python3.6/_bootstrap.py�_wraps

rcCstt�|�S)N)�type�sys)�namer
r
r�_new_module#src@seZdZdS)�_DeadlockErrorN)rrrr
r
r
rr0src@s8eZdZdZdd�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).
    cCs0tj�|_tj�|_||_d|_d|_d|_dS)N�)�_thread�
allocate_lock�lock�wakeupr�owner�count�waiters)�selfrr
r
r�__init__:s

z_ModuleLock.__init__cCs@tj�}|j}x,tj|�}|dkr&dS|j}||krdSqWdS)NFT)r�	get_identr�_blocking_on�get)r�me�tidrr
r
r�has_deadlockBs
z_ModuleLock.has_deadlockcCs�tj�}|t|<z�x�|j�`|jdks0|j|krH||_|jd7_dS|j�r\td|��|jj	d�rv|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)rr r!rrrr%rr�acquirer�release)rr$r
r
rr'Ns 
z_ModuleLock.acquirec
Csltj�}|j�T|j|kr"td��|jd8_|jdkr^d|_|jr^|jd8_|jj�WdQRXdS)Nzcannot release un-acquired lockr&r)	rr rr�RuntimeErrorrrrr()rr$r
r
rr(gs

z_ModuleLock.releasecCsdj|jt|��S)Nz_ModuleLock({!r}) at {})�formatr�id)rr
r
r�__repr__tsz_ModuleLock.__repr__N)	rrrrrr%r'r(r,r
r
r
rr4s
rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_DummyModuleLockzVA simple _ModuleLock equivalent for Python builds without
    multi-threading support.cCs||_d|_dS)Nr)rr)rrr
r
rr|sz_DummyModuleLock.__init__cCs|jd7_dS)Nr&T)r)rr
r
rr'�sz_DummyModuleLock.acquirecCs$|jdkrtd��|jd8_dS)Nrzcannot release un-acquired lockr&)rr))rr
r
rr(�s
z_DummyModuleLock.releasecCsdj|jt|��S)Nz_DummyModuleLock({!r}) at {})r*rr+)rr
r
rr,�sz_DummyModuleLock.__repr__N)rrrrrr'r(r,r
r
r
rr-xs
r-c@s$eZdZdd�Zdd�Zdd�ZdS)�_ModuleLockManagercCs||_d|_dS)N)�_name�_lock)rrr
r
rr�sz_ModuleLockManager.__init__cCst|j�|_|jj�dS)N)�_get_module_lockr/r0r')rr
r
r�	__enter__�sz_ModuleLockManager.__enter__cOs|jj�dS)N)r0r()r�args�kwargsr
r
r�__exit__�sz_ModuleLockManager.__exit__N)rrrrr2r5r
r
r
rr.�sr.cCs�tj�zjyt|�}Wntk
r0d}YnX|dkrptdkrLt|�}nt|�}|fdd�}tj||�t|<Wdtj	�X|S)z�Get or create the module lock for a given module name.

    Acquire/release internally the global import lock to protect
    _module_locks.Nc
Ss0tj�ztj|�|krt|=Wdtj�XdS)N)�_imp�acquire_lock�
_module_locksr"�release_lock)�refrr
r
r�cb�s

z_get_module_lock.<locals>.cb)
r6r7r8�KeyErrorrr-r�_weakrefr:r9)rrr;r
r
rr1�s


r1cCs6t|�}y|j�Wntk
r(Yn
X|j�dS)z�Acquires then releases 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.
    N)r1r'rr()rrr
r
r�_lock_unlock_module�sr>cOs
|||�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
)�fr3�kwdsr
r
r�_call_with_frames_removed�srAr&)�	verbositycGs6tjj|kr2|jd�sd|}t|j|�tjd�dS)z=Print the message to stderr if -v/PYTHONVERBOSE is turned on.�#�import z# )�fileN)rCrD)r�flags�verbose�
startswith�printr*�stderr)�messagerBr3r
r
r�_verbose_message�s
rLcs�fdd�}t|��|S)z1Decorator to verify the named module is built-in.cs&|tjkrtdj|�|d���||�S)Nz{!r} is not a built-in module)r)r�builtin_module_names�ImportErrorr*)r�fullname)�fxnr
r�_requires_builtin_wrapper�s

z4_requires_builtin.<locals>._requires_builtin_wrapper)r)rPrQr
)rPr�_requires_builtin�s
rRcs�fdd�}t|��|S)z/Decorator to verify the named module is frozen.cs&tj|�stdj|�|d���||�S)Nz{!r} is not a frozen module)r)r6�	is_frozenrNr*)rrO)rPr
r�_requires_frozen_wrapper�s

z2_requires_frozen.<locals>._requires_frozen_wrapper)r)rPrTr
)rPr�_requires_frozen�s
rUcCs>t||�}|tjkr2tj|}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_loaderr�modules�_exec�_load)rrO�spec�moduler
r
r�_load_module_shim�s




r\c#Cs�t|dd�}t|d�r6y
|j|�Stk
r4YnXy
|j}Wntk
rTYnX|dk	rft|�Sy
|j}Wntk
r�d}YnXy
|j}Wn2tk
r�|dkr�dj	|�Sdj	||�SYnXdj	||�SdS)N�
__loader__�module_repr�?z
<module {!r}>z<module {!r} ({!r})>z<module {!r} from {!r}>)
rrr^�	Exception�__spec__�AttributeError�_module_repr_from_specr�__file__r*)r[�loaderrZr�filenamer
r
r�_module_repr
s.






rgc@s$eZdZdd�Zdd�Zdd�ZdS)�_installed_safelycCs||_|j|_dS)N)�_modulera�_spec)rr[r
r
rr3sz_installed_safely.__init__cCsd|j_|jtj|jj<dS)NT)rj�
_initializingrirrWr)rr
r
rr27sz_installed_safely.__enter__cGsbzR|j}tdd�|D��r@ytj|j=WqPtk
r<YqPXntd|j|j�Wdd|j_XdS)Ncss|]}|dk	VqdS)Nr
)�.0�argr
r
r�	<genexpr>Asz-_installed_safely.__exit__.<locals>.<genexpr>zimport {!r} # {!r}F)	rj�anyrrWrr<rLrerk)rr3rZr
r
rr5>sz_installed_safely.__exit__N)rrrrr2r5r
r
r
rrh1srhc@sreZdZdZdddd�dd�Zdd�Zdd	�Zed
d��Zej	dd��Zed
d��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.

    N)�origin�loader_state�
is_packagecCs6||_||_||_||_|r gnd|_d|_d|_dS)NF)rrerqrr�submodule_search_locations�
_set_fileattr�_cached)rrrerqrrrsr
r
rrqszModuleSpec.__init__cCsfdj|j�dj|j�g}|jdk	r4|jdj|j��|jdk	rP|jdj|j��dj|jjdj|��S)Nz	name={!r}zloader={!r}zorigin={!r}zsubmodule_search_locations={}z{}({})z, )	r*rrerq�appendrt�	__class__r�join)rr3r
r
rr,}s



zModuleSpec.__repr__cCsf|j}yF|j|jkoL|j|jkoL|j|jkoL||jkoL|j|jkoL|j|jkStk
r`dSXdS)NF)rtrrerq�cached�has_locationrb)r�other�smslr
r
r�__eq__�s
zModuleSpec.__eq__cCs:|jdkr4|jdk	r4|jr4tdkr&t�tj|j�|_|jS)N)rvrqru�_bootstrap_external�NotImplementedError�_get_cached)rr
r
rrz�s
zModuleSpec.cachedcCs
||_dS)N)rv)rrzr
r
rrz�scCs$|jdkr|jjd�dS|jSdS)z The name of the module's parent.N�.r)rtr�
rpartition)rr
r
r�parent�s
zModuleSpec.parentcCs|jS)N)ru)rr
r
rr{�szModuleSpec.has_locationcCst|�|_dS)N)�boolru)r�valuer
r
rr{�s)rrrrrr,r~�propertyrz�setterr�r{r
r
r
rrpLs#
	rp)rqrscCs�t|d�rJtdkrt�tj}|dkr0|||d�S|r8gnd}||||d�S|dkr�t|d�r�y|j|�}Wq�tk
r�d}Yq�Xnd}t||||d�S)z5Return a module spec based on various loader methods.�get_filenameN)re)rertrsF)rqrs)rrr��spec_from_file_locationrsrNrp)rrerqrsr��searchr
r
rrV�s"

rVc5Cs8y
|j}Wntk
rYnX|dk	r,|S|j}|dkrZy
|j}Wntk
rXYnXy
|j}Wntk
r|d}YnX|dkr�|dkr�y
|j}Wq�tk
r�d}Yq�Xn|}y
|j}Wntk
r�d}YnXyt|j�}Wntk
�rd}YnXt	|||d�}|dk�r"dnd|_
||_||_|S)N)rqFT)
rarbrr]rd�_ORIGIN�
__cached__�list�__path__rprurzrt)r[rerqrZr�locationrzrtr
r
r�_spec_from_module�sH







r�F)�overridec;Cs�|st|dd�dkr6y|j|_Wntk
r4YnX|sJt|dd�dkr�|j}|dkr�|jdk	r�tdkrnt�tj}|j	|�}|j|_
y
||_Wntk
r�YnX|s�t|dd�dkr�y|j|_
Wntk
r�YnXy
||_Wntk
r�YnX|�st|dd�dk�rD|jdk	�rDy|j|_Wntk
�rBYnX|j�r�|�sdt|dd�dk�r�y|j|_Wntk
�r�YnX|�s�t|dd�dk�r�|jdk	�r�y|j|_Wntk
�r�YnX|S)Nrr]�__package__r�rdr�)rrrrbrertrr��_NamespaceLoader�__new__�_pathr]r�r�rar�r{rqrdrzr�)rZr[r�rer�r
r
r�_init_module_attrs�s\



r�cCsRd}t|jd�r|jj|�}nt|jd�r2td��|dkrDt|j�}t||�|S)z+Create a module based on the provided spec.N�
create_module�exec_modulezBloaders that define exec_module() must also define create_module())rrer�rNrrr�)rZr[r
r
r�module_from_spec4s

r�cCsj|jdkrdn|j}|jdkrB|jdkr2dj|�Sdj||j�Sn$|jrVdj||j�Sdj|j|j�SdS)z&Return the repr to use for the module.Nr_z
<module {!r}>z<module {!r} ({!r})>z<module {!r} from {!r}>z<module {!r} ({})>)rrqrer*r{)rZrr
r
rrcEs


rccCs�|j}t|���tjj|�|k	r6dj|�}t||d��|jdkrj|jdkrXtd|jd��t	||dd�|St	||dd�t
|jd�s�|jj|�n|jj|�WdQRXtj|S)zFExecute the spec's specified module in an existing module's namespace.zmodule {!r} not in sys.modules)rNzmissing loaderT)r�r�)
rr.rrWr"r*rNrertr�r�load_moduler�)rZr[r�msgr
r
rrXVs



rXcCs�|jj|j�tj|j}t|dd�dkrLy|j|_Wntk
rJYnXt|dd�dkr�y(|j|_	t
|d�s�|jjd�d|_	Wntk
r�YnXt|dd�dkr�y
||_Wntk
r�YnX|S)Nr]r�r�r�rra)
rer�rrrWrr]rbrr�rr�ra)rZr[r
r
r�_load_backward_compatiblens(

r�cCsv|jdk	rt|jd�st|�St|�}t|��6|jdkrT|jdkr`td|jd��n|jj|�WdQRXt	j
|jS)Nr�zmissing loader)r)rerr�r�rhrtrNrr�rrW)rZr[r
r
r�_load_unlocked�s



r�c	Cst|j��
t|�SQRXdS)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.rr�)rZr
r
rrY�s	rYc@s�eZdZdZedd��Zeddd��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.

    cCsdj|j�S)zsReturn repr for the module.

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

        z<module {!r} (built-in)>)r*r)r[r
r
rr^�szBuiltinImporter.module_reprNcCs,|dk	rdStj|�r$t||dd�SdSdS)Nzbuilt-in)rq)r6�
is_builtinrV)�clsrO�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�re)r�rOr�rZr
r
r�find_module�s	zBuiltinImporter.find_modulecCs.|jtjkr"tdj|j�|jd��ttj|�S)zCreate a built-in modulez{!r} is not a built-in module)r)rrrMrNr*rAr6�create_builtin)rrZr
r
rr��s
zBuiltinImporter.create_modulecCsttj|�dS)zExec a built-in moduleN)rAr6�exec_builtin)rr[r
r
rr��szBuiltinImporter.exec_modulecCsdS)z9Return None as built-in modules do not have code objects.Nr
)r�rOr
r
r�get_code�szBuiltinImporter.get_codecCsdS)z8Return None as built-in modules do not have source code.Nr
)r�rOr
r
r�
get_source�szBuiltinImporter.get_sourcecCsdS)z4Return False as built-in modules are never packages.Fr
)r�rOr
r
rrs�szBuiltinImporter.is_package)NN)N)rrrr�staticmethodr^�classmethodr�r�r�r�rRr�r�rsr\r�r
r
r
rr��s	r�c@s�eZdZdZedd��Zeddd��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.

    cCsdj|j�S)zsReturn repr for the module.

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

        z<module {!r} (frozen)>)r*r)�mr
r
rr^szFrozenImporter.module_reprNcCs tj|�rt||dd�SdSdS)N�frozen)rq)r6rSrV)r�rOr�r�r
r
rr�s
zFrozenImporter.find_speccCstj|�r|SdS)z]Find a frozen module.

        This method is deprecated.  Use find_spec() instead.

        N)r6rS)r�rOr�r
r
rr�szFrozenImporter.find_modulecCsdS)z*Use default semantics for module creation.Nr
)r�rZr
r
rr�szFrozenImporter.create_modulecCs@|jj}tj|�s$tdj|�|d��ttj|�}t||j	�dS)Nz{!r} is not a frozen module)r)
rarr6rSrNr*rA�get_frozen_object�execr)r[r�coder
r
rr� s

zFrozenImporter.exec_modulecCs
t||�S)z_Load a frozen module.

        This method is deprecated.  Use exec_module() instead.

        )r\)r�rOr
r
rr�)szFrozenImporter.load_modulecCs
tj|�S)z-Return the code object for the frozen module.)r6r�)r�rOr
r
rr�2szFrozenImporter.get_codecCsdS)z6Return None as frozen modules do not have source code.Nr
)r�rOr
r
rr�8szFrozenImporter.get_sourcecCs
tj|�S)z.Return True if the frozen module is a package.)r6�is_frozen_package)r�rOr
r
rrs>szFrozenImporter.is_package)NN)N)rrrrr�r^r�r�r�r�r�r�rUr�r�rsr
r
r
rr��s			r�c@s eZdZdZdd�Zdd�ZdS)�_ImportLockContextz$Context manager for the import lock.cCstj�dS)zAcquire the import lock.N)r6r7)rr
r
rr2Ksz_ImportLockContext.__enter__cCstj�dS)z<Release the import lock regardless of any raised exceptions.N)r6r9)r�exc_type�	exc_value�
exc_tracebackr
r
rr5Osz_ImportLockContext.__exit__N)rrrrr2r5r
r
r
rr�Gsr�cCs@|jd|d�}t|�|kr$td��|d}|r<dj||�S|S)z2Resolve a relative module name to an absolute one.r�r&z2attempted relative import beyond top-level packagerz{}.{})�rsplit�len�
ValueErrorr*)r�package�level�bits�baser
r
r�
_resolve_nameTs
r�cCs"|j||�}|dkrdSt||�S)N)r�rV)�finderrr�rer
r
r�_find_spec_legacy]sr�c
Cs�tj}|dkrtd��|s&tjdt�|tjk}x�|D]�}t��Hy
|j}Wn*t	k
rvt
|||�}|dkrrw6YnX||||�}WdQRX|dk	r6|r�|tjkr�tj|}y
|j}	Wnt	k
r�|SX|	dkr�|S|	Sq6|Sq6WdSdS)zFind a module's spec.Nz5sys.meta_path is None, Python is likely shutting downzsys.meta_path is empty)r�	meta_pathrN�	_warnings�warn�
ImportWarningrWr�r�rbr�ra)
rr�r�r��	is_reloadr�r�rZr[rar
r
r�
_find_specfs6




r�cCsnt|t�stdjt|����|dkr,td��|dkrTt|t�sHtd��n|sTtd��|rj|dkrjtd��dS)zVerify arguments are "sane".zmodule name must be str, not {}rzlevel must be >= 0z__package__ not set to a stringz6attempted relative import with no known parent packagezEmpty module nameN)�
isinstance�str�	TypeErrorr*rr�rN)rr�r�r
r
r�
_sanity_check�s


r�zNo module named z{!r}cCs�d}|jd�d}|r�|tjkr*t||�|tjkr>tj|Stj|}y
|j}Wn2tk
r�tdj||�}t||d�d�YnXt	||�}|dkr�ttj|�|d��nt
|�}|r�tj|}t||jd�d|�|S)Nr�rz; {!r} is not a package)r�)r�rrWrAr�rb�_ERR_MSGr*�ModuleNotFoundErrorr�r�r)r�import_r�r��
parent_moduler�rZr[r
r
r�_find_and_load_unlocked�s*







r�cCs^t|��&tjj|t�}|tkr*t||�SWdQRX|dkrRdj|�}t||d��t|�|S)zFind and load the module.Nz(import of {} halted; None in sys.modules)r)	r.rrWr"�_NEEDS_LOADINGr�r*r�r>)rr�r[rKr
r
r�_find_and_load�s
r�rcCs*t|||�|dkr t|||�}t|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)r�r�r��_gcd_import)rr�r�r
r
rr��s	r�)�	recursivecCs�t|d�r�x�|D]�}t|t�sN|r.|jd}nd}td|�dt|�j����q|dkrz|r�t|d�r�t||j|dd	�qt||�sd
j|j|�}yt	||�Wqt
k
r�}z&|j|kr�tj
j|t�dk	r�w�WYdd}~XqXqW|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�z.__all__z
``from list''zItem in z must be str, not �*�__all__T)r�z{}.{}N)rr�r�rr�r�_handle_fromlistr�r*rAr�rrrWr"r�)r[�fromlistr�r��x�where�	from_name�excr
r
rr��s*







r�cCs�|jd�}|jd�}|dk	rR|dk	rN||jkrNtjd|�d|j�d�tdd�|S|dk	r`|jStjd	tdd�|d
}d|kr�|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�raNz __package__ != __spec__.parent (z != �)�)�
stacklevelzYcan't resolve package from __spec__ or __package__, falling back on __name__ and __path__rr�r�r)r"r�r�r�r�r�)�globalsr�rZr
r
r�_calc___package__s



r�c	Cs�|dkrt|�}n$|dk	r|ni}t|�}t|||�}|s�|dkrTt|jd�d�S|s\|St|�t|jd�d�}tj|jdt|j�|�Snt||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).

    rNr�)r�r��	partitionr�rrWrr�)	rr��localsr�r�r[�globals_r��cut_offr
r
r�
__import__&s
 r�cCs&tj|�}|dkrtd|��t|�S)Nzno built-in module named )r�r�rNr�)rrZr
r
r�_builtin_from_nameIs
r�cCs�|a|att�}xVtjj�D]H\}}t||�r|tjkr>t}ntj|�rt	}nqt
||�}t||�qWtjt}x6dD].}|tjkr�t
|�}	n
tj|}	t|||	�qxWyt
d�}
Wntk
r�d}
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�rNr=)r�)r6rrrW�itemsr�rMr�rSr�r�r�rr�rrN)�
sys_module�_imp_module�module_typerr[rerZ�self_module�builtin_name�builtin_module�
thread_module�weakref_moduler
r
r�_setupPs2	









r�cCsBt||�tjjt�tjjt�ddl}|a|jtj	t
�dS)z2Install importlib as the implementation of import.rN)r�rr�rwr�r��_frozen_importlib_externalr�_installrWr)r�r�r�r
r
rr�s
r�)NN)N)Nr)2rrrrr8r!r)rrr-r.r1r>rArLrRrUr\rgrhrprVr�r�r�rcrXr�r�rYr�r�r�r�r�r�r��_ERR_MSG_PREFIXr�r��objectr�r�r�r�r�r�r�r�r�r
r
r
r�<module>s^D%$e
-<IM
		
/
&#/