File "_bootstrap_external.cpython-36.opt-1.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python36/lib64/python3.6/importlib/__pycache__/_bootstrap_external.cpython-36.opt-1.pyc
File size: 37.83 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit

3

 f@sdZd[Zd\ZeeZddZddZdd	Zd
dZdd
ZddZ	ddZ
ddZddZd]ddZ
ee
jZdjdddZejedZdZdZdgZd gZeZZd^d!d"d#d$Zd%d&Zd'd(Zd)d*Zd+d,Z d-d.Z!d/d0Z"d_d1d2Z#d`d3d4Z$dad6d7Z%d8d9Z&e'Z(dbd!e(d:d;d<Z)Gd=d>d>Z*Gd?d@d@Z+GdAdBdBe+Z,GdCdDdDZ-GdEdFdFe-e,Z.GdGdHdHe-e+Z/gZ0GdIdJdJe-e+Z1GdKdLdLZ2GdMdNdNZ3GdOdPdPZ4GdQdRdRZ5dcdSdTZ6dUdVZ7dWdXZ8dYdZZ9d!S)da^Core implementation of path-based 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.

wincygwindarwincs<tjjtr0tjjtrdndfdd}ndd}|S)NPYTHONCASEOKsPYTHONCASEOKcs
tjkS)z5True if filenames must be checked case-insensitively.)_osenviron)keyrB/opt/alt/python36/lib64/python3.6/importlib/_bootstrap_external.py_relax_case%sz%_make_relax_case.<locals>._relax_casecSsdS)z5True if filenames must be checked case-insensitively.Frrrrr	r
)s)sysplatform
startswith_CASE_INSENSITIVE_PLATFORMS#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)r
r)rr	_make_relax_casesrcCst|d@jddS)z*Convert a 32-bit integer to little-endian.llittle)intto_bytes)xrrr	_w_long/srcCstj|dS)z/Convert 4 bytes in little-endian to an integer.r)r
from_bytes)	int_bytesrrr	_r_long4srcGstjdd|DS)zReplacement for os.path.join().cSsg|]}|r|jtqSr)rstrippath_separators).0partrrr	
<listcomp>;sz_path_join.<locals>.<listcomp>)path_sepjoin)
path_partsrrr	
_path_join9s
r"cCs`ttdkr$|jt\}}}||fSx2t|D]&}|tkr.|j|dd\}}||fSq.Wd|fS)z Replacement for os.path.split().)maxsplit)lenr
rpartitionrreversedrsplit)pathfront_tailrrrr	_path_split?sr.cCs
tj|S)z~Stat the path.

    Made a separate function to make it easier to override in experiments
    (e.g. cache stat results).

    )rstat)r*rrr	
_path_statKsr0cCs0yt|}Wntk
r dSX|jd@|kS)z1Test whether the path is the specified mode type.Fi)r0OSErrorst_mode)r*mode	stat_inforrr	_path_is_mode_typeUs
r5cCs
t|dS)zReplacement for os.path.isfile.i)r5)r*rrr	_path_isfile^sr6cCs|stj}t|dS)zReplacement for os.path.isdir.i@)rgetcwdr5)r*rrr	_path_isdircsr8cCsdj|t|}tj|tjtjBtjB|d@}y2tj|d}|j	|WdQRXtj
||Wn:tk
rytj|Wntk
rYnXYnXdS)zBest-effort function to write data to a path atomically.
    Be prepared to handle a FileExistsError if concurrent writing of the
    temporary file is attempted.z{}.{}iwbN)
formatidropenO_EXCLO_CREATO_WRONLY_ioFileIOwritereplacer1unlink)r*datar3path_tmpfdfilerrr	
_write_atomicjsrJi3
rs
__pycache__zopt-z.pyz.pycN)optimizationcCs|dk	r4tjdt|dk	r(d}t||r0dnd}tj|}t|\}}|jd\}}}tj	j
}	|	dkrrtddj|r~|n|||	g}
|dkrtj
jdkrd}ntj
j}t|}|dkr|jstd	j|d
j|
t|}
t|t|
tdS)aGiven the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    The 'optimization' parameter controls the presumed optimization level of
    the bytecode file. If 'optimization' is not None, the string representation
    of the argument is taken and verified to be alphanumeric (else ValueError
    is raised).

    The debug_override parameter is deprecated. If debug_override is not None,
    a True value is the same as setting 'optimization' to the empty string
    while a False value is equivalent to setting 'optimization' to '1'.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    NzFthe debug_override parameter is deprecated; use 'optimization' insteadz2debug_override or optimization must be set to Noner%r#.z$sys.implementation.cache_tag is Nonez{!r} is not alphanumericz{}.{}{})	_warningswarnDeprecationWarning	TypeErrorrfspathr.r'rimplementation	cache_tagNotImplementedErrorr flagsoptimizestrisalnum
ValueErrorr;_OPTr"_PYCACHEBYTECODE_SUFFIXES)r*debug_overriderMmessageheadr-basesepresttagalmost_filenamerrr	cache_from_sources0
rhcCstjjdkrtdtj|}t|\}}t|\}}|tkrNtdj	t||j
d}|dkrptdj	|nV|dkr|jddd}|jt
stdj	t
|tt
d}|jstd	j	||jdd
}t||td
S)
anGiven the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147/488 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    Nz$sys.implementation.cache_tag is Nonez%{} not bottom-level directory in {!r}rNrKz!expected only 2 or 3 dots in {!r}z9optimization portion of filename does not start with {!r}z4optimization level {!r} is not an alphanumeric valuerO>rKri)rrUrVrWrrTr.r^r\r;countr)r
r]r&r[	partitionr"SOURCE_SUFFIXES)r*rbpycache_filenamepycache	dot_countrM	opt_level
base_filenamerrr	source_from_cache4s.	




rscCst|dkrdS|jd\}}}|s:|jdddkr>|Syt|}Wn$ttfk
rn|dd	}YnXt|r||S|S)
zConvert a bytecode file path to a source path (if possible).

    This function exists purely for backwards-compatibility for
    PyImport_ExecCodeModuleWithFilenames() in the C API.

    rONrNrir#pyrv)r&r'lowerrsrWr\r6)
bytecode_pathrer,	extensionsource_pathrrr	_get_sourcefileVsr{cCsH|jttr.yt|Stk
r*YqDXn|jttr@|SdSdS)N)endswithtuplermrhrWr_)filenamerrr	_get_cachedisrcCs4yt|j}Wntk
r&d}YnX|dO}|S)z3Calculate the mode permissions for a bytecode file.i)r0r2r1)r*r3rrr	
_calc_modeus
rcsDdfdd	}y
tj}Wntk
r4dd}YnX|||S)zDecorator to verify that the module being requested matches the one the
    loader can handle.

    The first argument (self) must define _name which the second argument is
    compared against. If the comparison fails then ImportError is raised.

    NcsB|dkr|j}n |j|kr0td|j|f|d||f||S)Nzloader for %s cannot handle %s)name)rImportError)selfrargskwargs)methodrr	_check_name_wrappers
z(_check_name.<locals>._check_name_wrappercSs<x(dD] }t||rt||t||qW|jj|jdS)N
__module____name____qualname____doc__)rrrr)hasattrsetattrgetattr__dict__update)newoldrDrrr	_wraps

z_check_name.<locals>._wrap)N)
_bootstrapr	NameError)rrrr)rr	_check_names

rcCs<|j|\}}|dkr8t|r8d}tj|j|dt|S)zTry to find a loader for the specified module by delegating to
    self.find_loader().

    This method is deprecated in favor of finder.find_spec().

    Nz,Not importing directory {}: missing __init__rO)find_loaderr&rPrQr;
ImportWarning)rfullnameloaderportionsmsgrrr	_find_module_shims

rcCsi}|dk	r||d<nd}|dk	r*||d<|dd}|dd}|dd}|tkr|dj||}tjd	|t|f|nVt|dkrd
j|}tjd	|t|n*t|dkrdj|}tjd	|t||dk	r|yt|d}	Wntk
rYn2Xt	||	kr4d
j|}tjd	|t|f|y|dd@}
Wntk
rZYn"Xt	||
kr|td
j|f||ddS)azValidate the header of the passed-in bytecode against source_stats (if
    given) and returning the bytecode that can be compiled by compile().

    All other arguments are used to enhance error reporting.

    ImportError is raised when the magic number is incorrect or the bytecode is
    found to be stale. EOFError is raised when the data is found to be
    truncated.

    Nrz
<bytecode>r*rzbad magic number in {!r}: {!r}z{}z+reached EOF while reading timestamp in {!r}z0reached EOF while reading size of source in {!r}mtimezbytecode is stale for {!r}sizel)
MAGIC_NUMBERr;r_verbose_messagerr&EOFErrorrKeyErrorr)rFsource_statsrr*exc_detailsmagic
raw_timestampraw_sizerasource_mtimesource_sizerrr	_validate_bytecode_headersL





rcCsPtj|}t|tr8tjd||dk	r4tj|||Stdj	|||ddS)z<Compile bytecode as returned by _validate_bytecode_header().zcode object from {!r}NzNon-code object in {!r})rr*)
marshalloads
isinstance
_code_typerr_imp_fix_co_filenamerr;)rFrrxrzcoderrr	_compile_bytecodes


rrOcCs8tt}|jt||jt||jtj||S)zPCompile a code object into bytecode for writing out to a byte-compiled
    file.)	bytearrayrextendrrdumps)rrrrFrrr	_code_to_bytecodes
rcCs>ddl}tj|j}|j|}tjdd}|j|j|dS)zyDecode bytes representing source code and return the string.

    Universal newline support is used in the decoding.
    rONT)tokenizerABytesIOreadlinedetect_encodingIncrementalNewlineDecoderdecode)source_bytesrsource_bytes_readlineencodingnewline_decoderrrr	
decode_sources

r)rsubmodule_search_locationsc	Cs|dkr<d}t|drFy|j|}WqFtk
r8YqFXn
tj|}tj|||d}d|_|dkrx6tD](\}}|j	t
|rl|||}||_PqlWdS|tkrt|dry|j
|}Wntk
rYqX|rg|_n||_|jgkr|rt|d}|jj||S)a=Return a module spec based on a file location.

    To indicate that the module is a package, set
    submodule_search_locations to a list of directory paths.  An
    empty list is sufficient, though its not otherwise useful to the
    import system.

    The loader must take a spec as its only __init__() arg.

    Nz	<unknown>get_filename)originT
is_packagerO)rrrrrTr
ModuleSpec
_set_fileattr_get_supported_file_loadersr|r}r	_POPULATErrr.append)	rlocationrrspecloader_classsuffixesrdirnamerrr	spec_from_file_locations>



rc@sPeZdZdZdZdZdZeddZeddZ	edd
dZ
eddd
Zd	S)WindowsRegistryFinderz>Meta path finder for modules declared in the Windows registry.z;Software\Python\PythonCore\{sys_version}\Modules\{fullname}zASoftware\Python\PythonCore\{sys_version}\Modules\{fullname}\DebugFcCs2ytjtj|Stk
r,tjtj|SXdS)N)_winregOpenKeyHKEY_CURRENT_USERr1HKEY_LOCAL_MACHINE)clsrrrr	_open_registry\sz$WindowsRegistryFinder._open_registrycCsp|jr|j}n|j}|j|dtjddd}y&|j|}tj|d}WdQRXWnt	k
rjdSX|S)Nz%d.%drK)rsys_versionr%)
DEBUG_BUILDREGISTRY_KEY_DEBUGREGISTRY_KEYr;rversion_inforr
QueryValuer1)rrregistry_keyrhkeyfilepathrrr	_search_registrycsz&WindowsRegistryFinder._search_registryNcCsx|j|}|dkrdSyt|Wntk
r6dSXx:tD]0\}}|jt|r@tj|||||d}|Sq@WdS)N)r)rr0r1rr|r}rspec_from_loader)rrr*targetrrrrrrr		find_specrs
zWindowsRegistryFinder.find_speccCs"|j||}|dk	r|jSdSdS)zlFind module named in the registry.

        This method is deprecated.  Use exec_module() instead.

        N)rr)rrr*rrrr	find_modulesz!WindowsRegistryFinder.find_module)NN)N)rrrrrrrclassmethodrrrrrrrr	rPsrc@s0eZdZdZddZddZddZdd	Zd
S)
_LoaderBasicszSBase class of common code needed by both SourceLoader and
    SourcelessFileLoader.cCs@t|j|d}|jddd}|jdd}|dko>|dkS)zConcrete implementation of InspectLoader.is_package by checking if
        the path returned by get_filename has a filename of '__init__.py'.r#rNrOrK__init__)r.rr)r')rrr~
filename_base	tail_namerrr	rsz_LoaderBasics.is_packagecCsdS)z*Use default semantics for module creation.Nr)rrrrr	
create_modulesz_LoaderBasics.create_modulecCs8|j|j}|dkr$tdj|jtjt||jdS)zExecute the module.Nz4cannot load module {!r} when get_code() returns None)get_coderrr;r_call_with_frames_removedexecr)rmodulerrrr	exec_modules

z_LoaderBasics.exec_modulecCstj||S)zThis module is deprecated.)r_load_module_shim)rrrrr	load_modulesz_LoaderBasics.load_moduleN)rrrrrrrrrrrr	rs
rc@sJeZdZddZddZddZddZd	d
Zddd
dZddZ	dS)SourceLoadercCstdS)zOptional method that returns the modification time (an int) for the
        specified path, where path is a str.

        Raises IOError when the path cannot be handled.
        N)IOError)rr*rrr	
path_mtimeszSourceLoader.path_mtimecCsd|j|iS)aOptional method returning a metadata dict for the specified path
        to by the path (str).
        Possible keys:
        - 'mtime' (mandatory) is the numeric timestamp of last source
          code modification;
        - 'size' (optional) is the size in bytes of the source code.

        Implementing this method allows the loader to read bytecode files.
        Raises IOError when the path cannot be handled.
        r)r)rr*rrr	
path_statsszSourceLoader.path_statscCs|j||S)zOptional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.

        The source path is needed in order to correctly transfer permissions
        )set_data)rrz
cache_pathrFrrr	_cache_bytecodeszSourceLoader._cache_bytecodecCsdS)zOptional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.
        Nr)rr*rFrrr	rszSourceLoader.set_datacCsR|j|}y|j|}Wn0tk
rH}ztd|d|WYdd}~XnXt|S)z4Concrete implementation of InspectLoader.get_source.z'source not available through get_data())rN)rget_datar1rr)rrr*rexcrrr	
get_sources
zSourceLoader.get_sourcer#)	_optimizecCstjt||dd|dS)zReturn the code object compiled from source.

        The 'data' argument can be any object type that compile() supports.
        rT)dont_inheritrY)rrcompile)rrFr*rrrr	source_to_codeszSourceLoader.source_to_codec
+Cs^|j|}d}yt|}Wntk
r2d}YnXy|j|}Wntk
rVYn~Xt|d}y|j|}Wntk
rYnNXyt||||d}Wnt	t
fk
rYn Xtjd||t
||||dS|j|}|j||}	tjd|tjrZ|dk	rZ|dk	rZt|	|t|}y|j|||tjd|Wntk
rXYnX|	S)zConcrete implementation of InspectLoader.get_code.

        Reading of bytecode requires path_stats to be implemented. To write
        bytecode, set_data must also be implemented.

        Nr)rrr*z
{} matches {})rrxrzzcode object from {}z
wrote {!r})rrhrWrrrrr1rrrrrrrrdont_write_bytecoderr&r)
rrrzrrxstrF
bytes_datarcode_objectrrr	rsN




zSourceLoader.get_codeNrv)
rrrrrrrrrrrrrr	rs


rcsPeZdZdZddZddZddZefdd	Zed
dZ	dd
Z
ZS)
FileLoaderzgBase file loader class which implements the loader protocol methods that
    require file system usage.cCs||_||_dS)zKCache the module name and the path to the file found by the
        finder.N)rr*)rrr*rrr	r szFileLoader.__init__cCs|j|jko|j|jkS)N)	__class__r)rotherrrr	__eq__&szFileLoader.__eq__cCst|jt|jAS)N)hashrr*)rrrr	__hash__*szFileLoader.__hash__cstt|j|S)zdLoad a module from a file.

        This method is deprecated.  Use exec_module() instead.

        )superr	r)rr)r
rr	r-s
zFileLoader.load_modulecCs|jS)z:Return the path to the source file as found by the finder.)r*)rrrrr	r9szFileLoader.get_filenamec	Cs tj|d
}|jSQRXdS)z'Return the data from path as raw bytes.rN)rArBread)rr*rIrrr	r>szFileLoader.get_data)rrrrrrrrrrr
__classcell__rr)r
r	r	sr	c@s.eZdZdZddZddZdddd	Zd
S)SourceFileLoaderz>Concrete implementation of SourceLoader using the file system.cCst|}|j|jdS)z!Return the metadata for the path.)rr)r0st_mtimest_size)rr*rrrr	rHszSourceFileLoader.path_statscCst|}|j|||dS)N)_mode)rr)rrzrxrFr3rrr	rMsz SourceFileLoader._cache_bytecodei)rc	Cst|\}}g}x(|r8t|r8t|\}}|j|qWxlt|D]`}t||}ytj|WqDtk
rvwDYqDtk
r}zt	j
d||dSd}~XqDXqDWyt|||t	j
d|Wn0tk
r}zt	j
d||WYdd}~XnXdS)zWrite bytes data to a file.zcould not create {!r}: {!r}Nzcreated {!r})r.r8rr(r"rmkdirFileExistsErrorr1rrrJ)	rr*rFrparentr~r!rrrrr	rRs*
zSourceFileLoader.set_dataN)rrrrrrrrrrr	rDsrc@s eZdZdZddZddZdS)SourcelessFileLoaderz-Loader which handles sourceless file imports.cCs0|j|}|j|}t|||d}t|||dS)N)rr*)rrx)rrrr)rrr*rFrrrr	rus

zSourcelessFileLoader.get_codecCsdS)z'Return None as there is no source code.Nr)rrrrr	r{szSourcelessFileLoader.get_sourceN)rrrrrrrrrr	rqsrc@s\eZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZeddZ
dS)ExtensionFileLoaderz]Loader for extension modules.

    The constructor is designed to work with FileFinder.

    cCs||_||_dS)N)rr*)rrr*rrr	rszExtensionFileLoader.__init__cCs|j|jko|j|jkS)N)r
r)rrrrr	rszExtensionFileLoader.__eq__cCst|jt|jAS)N)r
rr*)rrrr	rszExtensionFileLoader.__hash__cCs$tjtj|}tjd|j|j|S)z&Create an unitialized extension modulez&extension module {!r} loaded from {!r})rrrcreate_dynamicrrr*)rrrrrr	rs

z!ExtensionFileLoader.create_modulecCs$tjtj|tjd|j|jdS)zInitialize an extension modulez(extension module {!r} executed from {!r}N)rrrexec_dynamicrrr*)rrrrr	rszExtensionFileLoader.exec_modulecs$t|jdtfddtDS)z1Return True if the extension module is a package.r#c3s|]}d|kVqdS)rNr)rsuffix)	file_namerr		<genexpr>sz1ExtensionFileLoader.is_package.<locals>.<genexpr>)r.r*anyEXTENSION_SUFFIXES)rrr)rr	rszExtensionFileLoader.is_packagecCsdS)z?Return None as an extension module cannot create a code object.Nr)rrrrr	rszExtensionFileLoader.get_codecCsdS)z5Return None as extension modules have no source code.Nr)rrrrr	rszExtensionFileLoader.get_sourcecCs|jS)z:Return the path to the source file as found by the finder.)r*)rrrrr	rsz ExtensionFileLoader.get_filenameN)rrrrrrrrrrrrrrrrrr	rsrc@s`eZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
dS)_NamespacePatha&Represents a namespace package's path.  It uses the module name
    to find its parent module, and from there it looks up the parent's
    __path__.  When this changes, the module's own path is recomputed,
    using path_finder.  For top-level modules, the parent module's path
    is sys.path.cCs$||_||_t|j|_||_dS)N)_name_pathr}_get_parent_path_last_parent_path_path_finder)rrr*path_finderrrr	rsz_NamespacePath.__init__cCs&|jjd\}}}|dkrdS|dfS)z>Returns a tuple of (parent-module-name, parent-path-attr-name)rNr%rr*__path__)rr*)r$r')rrdotmerrr	_find_parent_path_namessz&_NamespacePath._find_parent_path_namescCs|j\}}ttj||S)N)r-rrmodules)rparent_module_namepath_attr_namerrr	r&sz_NamespacePath._get_parent_pathcCsPt|j}||jkrJ|j|j|}|dk	rD|jdkrD|jrD|j|_||_|jS)N)r}r&r'r(r$rrr%)rparent_pathrrrr	_recalculates
z_NamespacePath._recalculatecCst|jS)N)iterr2)rrrr	__iter__sz_NamespacePath.__iter__cCs||j|<dS)N)r%)rindexr*rrr	__setitem__sz_NamespacePath.__setitem__cCst|jS)N)r&r2)rrrr	__len__sz_NamespacePath.__len__cCsdj|jS)Nz_NamespacePath({!r}))r;r%)rrrr	__repr__sz_NamespacePath.__repr__cCs||jkS)N)r2)ritemrrr	__contains__sz_NamespacePath.__contains__cCs|jj|dS)N)r%r)rr9rrr	rsz_NamespacePath.appendN)rrrrrr-r&r2r4r6r7r8r:rrrrr	r#s

r#c@sPeZdZddZeddZddZddZd	d
ZddZ	d
dZ
ddZdS)_NamespaceLoadercCst||||_dS)N)r#r%)rrr*r)rrr	rsz_NamespaceLoader.__init__cCsdj|jS)zsReturn repr for the module.

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

        z<module {!r} (namespace)>)r;r)rrrrr	module_reprsz_NamespaceLoader.module_reprcCsdS)NTr)rrrrr	rsz_NamespaceLoader.is_packagecCsdS)Nr%r)rrrrr	rsz_NamespaceLoader.get_sourcecCstdddddS)Nr%z<string>rT)r)r)rrrrr	rsz_NamespaceLoader.get_codecCsdS)z*Use default semantics for module creation.Nr)rrrrr	rsz_NamespaceLoader.create_modulecCsdS)Nr)rrrrr	rsz_NamespaceLoader.exec_modulecCstjd|jtj||S)zbLoad a namespace module.

        This method is deprecated.  Use exec_module() instead.

        z&namespace module loaded with path {!r})rrr%r)rrrrr	rsz_NamespaceLoader.load_moduleN)rrrrrr<rrrrrrrrrr	r;s	r;c@sjeZdZdZeddZeddZeddZedd	ZedddZ	edd
dZ
edddZd
S)
PathFinderz>Meta path finder for sys.path and package __path__ attributes.cCs*x$tjjD]}t|dr|jqWdS)z}Call the invalidate_caches() method on all path entry finders
        stored in sys.path_importer_caches (where implemented).invalidate_cachesN)rpath_importer_cachevaluesrr>)rfinderrrr	r>#s
zPathFinder.invalidate_cachescCsVtjdk	rtjrtjdtx2tjD]$}y||Stk
rHw&Yq&Xq&WdSdS)z.Search sys.path_hooks for a finder for 'path'.Nzsys.path_hooks is empty)r
path_hooksrPrQrr)rr*hookrrr	_path_hooks+szPathFinder._path_hookscCsf|dkr*ytj}Wntk
r(dSXytj|}Wn(tk
r`|j|}|tj|<YnX|S)zGet the finder for the path entry from sys.path_importer_cache.

        If the path entry is not in the cache, find the appropriate finder
        and cache it. If no finder is available, store None.

        r%N)rr7FileNotFoundErrorrr?rrD)rr*rArrr	_path_importer_cache8s
zPathFinder._path_importer_cachecCsRt|dr|j|\}}n|j|}g}|dk	r<tj||Stj|d}||_|S)Nr)rrrrrrr)rrrArrrrrr	_legacy_get_specNs

zPathFinder._legacy_get_specNc	Csg}x|D]}t|ttfsq
|j|}|dk	r
t|drH|j||}n|j||}|dkr^q
|jdk	rl|S|j}|dkrt	d|j
|q
Wtj|d}||_|SdS)z?Find the loader or namespace_path for this module/package name.Nrzspec missing loader)
rrZbytesrFrrrGrrrrrr)	rrr*rnamespace_pathentryrArrrrr		_get_spec]s(



zPathFinder._get_speccCsd|dkrtj}|j|||}|dkr(dS|jdkr\|j}|rVd|_t|||j|_|SdSn|SdS)zTry to find a spec for 'fullname' on sys.path or 'path'.

        The search is based on sys.path_hooks and sys.path_importer_cache.
        N	namespace)rr*rKrrrr#)rrr*rrrIrrr	r}s
zPathFinder.find_speccCs|j||}|dkrdS|jS)zfind the module on sys.path or 'path' based on sys.path_hooks and
        sys.path_importer_cache.

        This method is deprecated.  Use find_spec() instead.

        N)rr)rrr*rrrr	rszPathFinder.find_module)N)NN)N)rrrrrr>rDrFrGrKrrrrrr	r=s
r=c@sZeZdZdZddZddZeZddZdd	Z	dddZ
d
dZeddZ
ddZd
S)
FileFinderzFile-based finder.

    Interactions with the file system are cached for performance, being
    refreshed when the directory the finder is handling has been modified.

    csXg}x(|D] \}|jfdd|Dq
W||_|p:d|_d|_t|_t|_dS)zInitialize with the path to search on and a variable number of
        2-tuples containing the loader and the file suffixes the loader
        recognizes.c3s|]}|fVqdS)Nr)rr)rrr	r sz&FileFinder.__init__.<locals>.<genexpr>rNr#Nrv)r_loadersr*_path_mtimeset_path_cache_relaxed_path_cache)rr*loader_detailsloadersrr)rr	rs
zFileFinder.__init__cCs
d|_dS)zInvalidate the directory mtime.r#Nrv)rO)rrrr	r>szFileFinder.invalidate_cachescCs*|j|}|dkrdgfS|j|jp&gfS)zTry to find a loader for the specified module, or the namespace
        package portions. Returns (loader, list-of-portions).

        This method is deprecated.  Use find_spec() instead.

        N)rrr)rrrrrr	rs
zFileFinder.find_loadercCs|||}t||||dS)N)rr)r)rrrr*smslrrrrr	rKs
zFileFinder._get_specNcCsbd}|jdd}yt|jp"tjj}Wntk
rBd
}YnX||jkr\|j||_t	rr|j
}|j}n
|j}|}||krt
|j|}xH|jD]6\}	}
d|	}t
||}t|r|j|
|||g|SqWt|}xX|jD]N\}	}
t
|j||	}tjd|dd||	|krt|r|j|
||d|SqW|r^tjd	|tj|d}
|g|
_|
SdS)zoTry to find a spec for the specified module.

        Returns the matching spec, or None if not found.
        FrNrKr#rz	trying {})	verbosityNzpossible namespace for {}rv)r'r0r*rr7rr1rO_fill_cacher
rRrwrQr"rNr6rKr8rrrr)rrris_namespacetail_modulercachecache_module	base_pathrr
init_filename	full_pathrrrr	rsF




zFileFinder.find_specc	
Cs|j}ytj|ptj}Wntttfk
r:g}YnXtjj	dsTt
||_nNt
}x@|D]8}|jd\}}}|rdj
||j}n|}|j|q`W||_tjj	trdd|D|_dS)zDFill the cache of potential modules and packages for this directory.rrNz{}.{}cSsh|]}|jqSr)rw)rfnrrr		<setcomp>sz)FileFinder._fill_cache.<locals>.<setcomp>N)r*rlistdirr7rEPermissionErrorNotADirectoryErrorrrr
rPrQrlr;rwaddrrR)	rr*contentslower_suffix_contentsr9rr+rnew_namerrr	rWs"

zFileFinder._fill_cachecsfdd}|S)aA class method which returns a closure to use on sys.path_hook
        which will return an instance using the specified loaders and the path
        called on the closure.

        If the path called on the closure is not a directory, ImportError is
        raised.

        cs"t|std|d|fS)z-Path hook for importlib.machinery.FileFinder.zonly directories are supported)r*)r8r)r*)rrSrr	path_hook_for_FileFinder*sz6FileFinder.path_hook.<locals>.path_hook_for_FileFinderr)rrSrhr)rrSr		path_hook s
zFileFinder.path_hookcCsdj|jS)NzFileFinder({!r}))r;r*)rrrr	r82szFileFinder.__repr__)N)rrrrrr>rrrrKrrWrrir8rrrr	rMs
0rMcCs|jd}|jd}|sB|r$|j}n||kr8t||}n
t||}|sTt|||d}y$||d<||d<||d<||d<Wntk
rYnXdS)N
__loader____spec__)r__file__
__cached__)getrrrr	Exception)nsrpathname	cpathnamerrrrr	_fix_up_module8s"


rscCs&ttjf}ttf}ttf}|||gS)z_Returns a list of file-based module loaders.

    Each item is a tuple (loader, suffixes).
    )rrextension_suffixesrrmrr_)
extensionssourcebytecoderrr	rOsrcCs|atjatjatjt}x8dD]0}|tjkr:tj|}n
tj|}t|||q Wddgfdddgff}x`|D]P\}}|d	}|tjkrtj|}Pqpytj|}PWqptk
rwpYqpXqpWtd
t|d|t|d|t|d
dj|ytjd}	Wntk
rd}	YnXt|d|	tjd}
t|d|
|dkrbtjd}t|d|t|dt	t
jtj|dkrt
jddt
krdt_dS)zSetup the path-based importers for importlib by importing needed
    built-in modules and injecting them into the global namespace.

    Other components are extracted from the core bootstrap module.

    rArPbuiltinsrposix/nt\rOzimportlib requires posix or ntrrrr%_threadN_weakrefwinregrr
z.pywz_d.pydT)rArPrxr)rrrr.r_builtin_from_namerrr rr"rrtrmrrr)_bootstrap_moduleself_modulebuiltin_namebuiltin_module
os_details
builtin_osrr	os_module
thread_moduleweakref_module
winreg_modulerrr	_setupZsP













rcCs2t|t}tjjtj|gtjjt	dS)z)Install the path-based import components.N)
rrrrBrrMri	meta_pathrr=)rsupported_loadersrrr	_installsr)r)rr)r9)N)NNN)NNN)rOrO)N)N):rr%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYrrrrr"r.r0r5r6r8rJtype__code__rrrrr_RAW_MAGIC_NUMBERr^r]rmr_DEBUG_BYTECODE_SUFFIXESOPTIMIZED_BYTECODE_SUFFIXESrhrsr{rrrrrrrrobjectrrrrrr	rrr"rr#r;r=rMrsrrrrrrr	<module>sl
	

{-"
7


C@n)-5<*
D