File "_bootstrap_external.cpython-38.pyc"

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

U

if@sdZddladdlZddladdlZddlZtjdkZerLddlZ	ddl
Z
nddlZ	erbddgZndgZe
ddeDs~tedZeeZdeZd	d
eDZdZdZeeZd
dZddZddZddZerddZnddZddZddZddZddZd d!Z er$d"d#Z!nd$d#Z!dod&d'Z"e#e"j$Z%d(&d)d*d+Z'e()e'd*Z*d,Z+d-Z,d.gZ-d/gZ.e.Z/Z0dpdd0d1d2Z1d3d4Z2d5d6Z3d7d8Z4d9d:Z5d;d<Z6d=d>Z7d?d@Z8dAdBZ9dCdDZ:dqdEdFZ;drdGdHZ<dsdJdKZ=dLdMZ>e?Z@dtde@dNdOdPZAGdQdRdRZBGdSdTdTZCGdUdVdVeCZDGdWdXdXZEGdYdZdZeEeDZFGd[d\d\eEeCZGgZHGd]d^d^eEeCZIGd_d`d`ZJGdadbdbZKGdcddddZLGdedfdfZMdudgdhZNdidjZOdkdlZPdmdnZQdS)va^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.

NZwin32\/ccs|]}t|dkVqdSNlen.0seprB/opt/alt/python38/lib64/python3.8/importlib/_bootstrap_external.py	<genexpr>+sr
cCsh|]}d|qS:rr	srrr	<setcomp>/sr)win)cygwindarwincs<tjtr0tjtrdndfdd}ndd}|S)NPYTHONCASEOKsPYTHONCASEOKcs
tjkS)5True if filenames must be checked case-insensitively.)_osenvironrkeyrr_relax_case@sz%_make_relax_case.<locals>._relax_casecSsdS)rFrrrrrrDs)sysplatform
startswith_CASE_INSENSITIVE_PLATFORMS#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)rrrr_make_relax_case9sr#cCst|d@ddS)z*Convert a 32-bit integer to little-endian.little)intto_bytes)xrrr_pack_uint32Jsr*cCst|dkstt|dS)z/Convert 4 bytes in little-endian to an integer.r%r&rAssertionErrorr'
from_bytesdatarrr_unpack_uint32Osr0cCst|dkstt|dS)z/Convert 2 bytes in little-endian to an integer.r&r+r.rrr_unpack_uint16Tsr2cGs|sdSt|dkr|dSd}g}ttj|D]z\}}|tsL|trf|tpX|}t	|g}q0|dr|
|
kr|}|g}q||q0|p|}||q0dd|D}t|dkr|ds|t	S|t	|S)Replacement for os.path.join().rrrrcSsg|]}|r|tqSrrstrippath_separatorsr	prrr
<listcomp>rs_path_join.<locals>.<listcomp>)
rmapr_path_splitrootr path_sep_tupleendswithr5r6path_sepcasefoldappendjoin)
path_partsrootpathZnew_roottailrrr
_path_join[s*
rGcGstdd|DS)r3cSsg|]}|r|tqSrr4)r	partrrrr9{sr:)r?rB)rCrrrrGys
csBtfddtD}|dkr&dfSd||ddfS)z Replacement for os.path.split().c3s|]}|VqdSN)rfindr7rErrr
sz_path_split.<locals>.<genexpr>rrNr)maxr6)rEirrKr_path_splitsrNcCs
t|S)z~Stat the path.

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

    )rstatrKrrr
_path_statsrPcCs2zt|}Wntk
r"YdSX|jd@|kS)z1Test whether the path is the specified mode type.Fi)rPOSErrorst_mode)rEmode	stat_inforrr_path_is_mode_types
rUcCs
t|dS)zReplacement for os.path.isfile.i)rUrKrrr_path_isfilesrVcCs|st}t|dS)zReplacement for os.path.isdir.i@)rgetcwdrUrKrrr_path_isdirsrXcCs>|sdSt|ddd}t|dko<|dp<|dS)Replacement for os.path.isabs.Frrrrz\\)rr<replacerr r>)rErDrrr_path_isabssr[cCs
|tS)rY)r r6rKrrrr[scCsd|t|}t|tjtjBtjB|d@}z2t|d}|	|W5QRXt
||Wn:tk
rzt|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.{}.{}r\wbN)
formatidropenO_EXCLO_CREATO_WRONLY_ioFileIOwriterZrQunlink)rEr/rSpath_tmpfdfilerrr
_write_atomicsrliU
r1r&s
__pycache__zopt-z.pyz.pyc)optimizationcCsX|dk	r4tdt|dk	r(d}t||r0dnd}t|}t|\}}|d\}}}tj	j
}	|	dkrrtdd|r~|n|||	g}
|dkrtj
jdkrd}ntj
j}t|}|dkr|std	|d
|
t|}
|
td}tjdk	rLt|stt|}|ddkr8|dtkr8|dd}ttj|t|St|t|S)
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 Nonerr.$sys.implementation.cache_tag is Nonerz{!r} is not alphanumericz{}.{}{}rr1)	_warningswarnDeprecationWarning	TypeErrorrfspathrN
rpartitionrimplementation	cache_tagNotImplementedErrorrBflagsoptimizestrisalnum
ValueErrorr__OPTBYTECODE_SUFFIXESpycache_prefixr[rGrWr6lstrip_PYCACHE)rEdebug_overridernmessageheadrFbaser
resttagalmost_filenamefilenamerrrcache_from_sourcebsH
	
rc
Cs.tjjdkrtdt|}t|\}}d}tjdk	rftjt	}|
|trf|t|d}d}|st|\}}|t
krtt
d||d}|dkrtd|n\|d	kr|dd
d}|
tstdt|ttd}|std
|d|dd}	t||	tdS)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.

    NrpFTz not bottom-level directory in ro>r1zexpected only 2 or 3 dots in rr1z5optimization portion of filename does not start with zoptimization level z is not an alphanumeric valuer)rrwrxryrrurNrr5r6r r?rrr~countrsplitrr}	partitionrGSOURCE_SUFFIXES)
rErpycache_filenamefound_in_pycache_prefix
stripped_pathpycache	dot_countrn	opt_level
base_filenamerrrsource_from_caches4	





rc	Cs~t|dkrdS|d\}}}|r8|dddkr<|Szt|}Wn$ttfk
rl|dd}YnXt|rz|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.

    rNropy)rrvlowerrryr~rV)
bytecode_pathr_	extensionsource_pathrrr_get_sourcefilesrcCsJ|ttr0z
t|WStk
r,YqFXn|ttrB|SdSdSrI)r>tuplerrryr)rrrr_get_cacheds
rcCs4zt|j}Wntk
r&d}YnX|dO}|S)z3Calculate the mode permissions for a bytecode file.r\)rPrRrQ)rErSrrr
_calc_modes
rcsDdfdd	}z
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 %sname)rImportError)selfrargskwargsmethodrr_check_name_wrappers
z(_check_name.<locals>._check_name_wrappercSs8dD] }t||rt||t||q|j|jdS)N)
__module____name____qualname____doc__)hasattrsetattrgetattr__dict__update)newoldrZrrr_wraps
z_check_name.<locals>._wrap)N)
_bootstrapr	NameError)rrrrrr_check_names

rcCs<||\}}|dkr8t|r8d}t||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__r)find_loaderrrqrrr_
ImportWarning)rfullnameloaderportionsmsgrrr_find_module_shims

rcCs|dd}|tkr<d|d|}td|t|f|t|dkrfd|}td|t|t|dd}|d	@rd
|d|}t|f||S)aTPerform basic validity checking of a pyc header and return the flags field,
    which determines how the pyc should be further validated against the source.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required, though.)

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    ImportError is raised when the magic number is incorrect or when the flags
    field is invalid. EOFError is raised when the data is found to be truncated.

    Nr%zbad magic number in z: {}z(reached EOF while reading pyc header of zinvalid flags z in )MAGIC_NUMBERr_verbose_messagerrEOFErrorr0)r/rexc_detailsmagicrrzrrr
_classify_pyc)s
rcCspt|dd|d@kr:d|}td|t|f||dk	rlt|dd|d@krltd|f|dS)aValidate a pyc against the source last-modified time.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_mtime* is the last modified timestamp of the source file.

    *source_size* is None or the size of the source file in bytes.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    rr$zbytecode is stale for rNr)r0rrr)r/source_mtimesource_sizerrrrrr_validate_timestamp_pycJs
rcCs&|dd|kr"td|f|dS)aValidate a hash-based pyc by checking the real source hash against the one in
    the pyc header.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_hash* is the importlib.util.source_hash() of the source file.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    rrz.hash in bytecode doesn't match hash of source N)r)r/source_hashrrrrr_validate_hash_pycfsrcCsPt|}t|tr8td||dk	r4t|||Std	|||ddS)z#Compile bytecode as found in a pyc.zcode object from {!r}NzNon-code object in {!r}rrE)
marshalloads
isinstance
_code_typerr_imp_fix_co_filenamerr_)r/rrrcoderrr_compile_bytecode~s


rcCsFtt}|td|t||t||t||S)z+Produce the data for a timestamp-based pyc.r)	bytearrayrextendr*rdumps)rmtimerr/rrr_code_to_timestamp_pycsrTcCsPtt}d|d>B}|t|t|dks2t|||t||S)z&Produce the data for a hash-based pyc.rr)rrrr*rr,rr)rrcheckedr/rzrrr_code_to_hash_pycs
rcCs>ddl}t|j}||}tdd}|||dS)zyDecode bytes representing source code and return the string.

    Universal newline support is used in the decoding.
    rNT)tokenizereBytesIOreadlinedetect_encodingIncrementalNewlineDecoderdecode)source_bytesrsource_bytes_readlineencodingnewline_decoderrrr
decode_sources

rrsubmodule_search_locationsc	Cs|dkr<d}t|drFz||}WqFtk
r8YqFXn
t|}tj|||d}d|_|dkrtD]*\}}|	t
|rj|||}||_qqjdS|tkrt|drz|
|}Wntk
rYqX|rg|_n||_|jgkr|rt|d}|j||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_filenameoriginT
is_packager)rrrrrur
ModuleSpec
_set_fileattr_get_supported_file_loadersr>rr	_POPULATErrrNrA)	rlocationrrspecloader_classsuffixesrdirnamerrrspec_from_file_locations>



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}\DebugFcCs8zttj|WStk
r2ttj|YSXdSrI)_winregOpenKeyHKEY_CURRENT_USERrQHKEY_LOCAL_MACHINE)clsrrrr_open_registrysz$WindowsRegistryFinder._open_registryc	Csr|jr|j}n|j}|j|dtjddd}z&||}t|d}W5QRXWnt	k
rlYdSX|S)Nz%d.%dr1)rsys_versionr)
DEBUG_BUILDREGISTRY_KEY_DEBUGREGISTRY_KEYr_rversion_inforr
QueryValuerQ)rrregistry_keyrhkeyfilepathrrr_search_registrysz&WindowsRegistryFinder._search_registryNcCsz||}|dkrdSzt|Wntk
r8YdSXtD]4\}}|t|r@tj|||||d}|Sq@dS)Nr)rrPrQrr>rrspec_from_loader)rrrEtargetrrrrrrr	find_specs
zWindowsRegistryFinder.find_speccCs"|||}|dk	r|jSdSdS)zlFind module named in the registry.

        This method is deprecated.  Use exec_module() instead.

        NrrrrrErrrrfind_module'sz!WindowsRegistryFinder.find_module)NN)N)rrrrrrr
classmethodrrrrrrrrrs

rc@s0eZdZdZddZddZddZdd	Zd
S)
_LoaderBasicszSBase class of common code needed by both SourceLoader and
    SourcelessFileLoader.cCs@t||d}|ddd}|dd}|dko>|dkS)zConcrete implementation of InspectLoader.is_package by checking if
        the path returned by get_filename has a filename of '__init__.py'.rrorr1__init__)rNrrrv)rrr
filename_base	tail_namerrrr:sz_LoaderBasics.is_packagecCsdSz*Use default semantics for module creation.Nrrrrrr
create_moduleBsz_LoaderBasics.create_modulecCs8||j}|dkr$td|jtt||jdS)zExecute the module.Nz4cannot load module {!r} when get_code() returns None)get_coderrr_r_call_with_frames_removedexecr)rmodulerrrrexec_moduleEsz_LoaderBasics.exec_modulecCst||S)zThis module is deprecated.)r_load_module_shimrrrrrload_moduleMsz_LoaderBasics.load_moduleN)rrrrrr r%r(rrrrr5s
rc@sJeZdZddZddZddZddZd	d
Zddd
dZddZ	dS)SourceLoadercCstdS)zOptional method that returns the modification time (an int) for the
        specified path (a str).

        Raises OSError when the path cannot be handled.
        N)rQrrErrr
path_mtimeTszSourceLoader.path_mtimecCsd||iS)aOptional method returning a metadata dict for the specified
        path (a 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 OSError when the path cannot be handled.
        r)r+r*rrr
path_stats\szSourceLoader.path_statscCs|||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)rr
cache_pathr/rrr_cache_bytecodejszSourceLoader._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)rrEr/rrrr-tszSourceLoader.set_datac
CsR||}z||}Wn0tk
rH}ztd|d|W5d}~XYnXt|S)z4Concrete implementation of InspectLoader.get_source.z'source not available through get_data()rN)rget_datarQrr)rrrErexcrrr
get_source{s
zSourceLoader.get_sourcer)	_optimizecCstjt||dd|dS)zReturn the code object compiled from source.

        The 'data' argument can be any object type that compile() supports.
        r#T)dont_inheritr{)rr"compile)rr/rEr3rrrsource_to_codeszSourceLoader.source_to_codec	Cs"||}d}d}d}d}d}zt|}Wntk
rDd}Yn0Xz||}	Wntk
rjYn
Xt|	d}z||}
Wntk
rYnX||d}zt|
||}t|
dd}
|d@dk}|r$|d	@dk}t	j
d
kr8|st	j
dkr8||}t	t|}t
|
|||nt|
||	d||Wnttfk
rTYn Xtd
||t|
|||dS|dkr||}|||}td|tjs|dk	r|dk	r|r|dkrt	|}t|||}
nt||t|}
z||||
Wntk
rYnX|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.

        NFTrrrrrr1neveralwayssizez
{} matches {})rrrzcode object from {})rrryr,rQr'r0r
memoryviewrcheck_hash_based_pycsr_RAW_MAGIC_NUMBERrrrrrrrr6rdont_write_bytecoderrrr/)rrrrrr
hash_basedcheck_sourcerstr/rrz
bytes_datacode_objectrrrr!s





zSourceLoader.get_codeN)
rrrr+r,r/r-r2r6r!rrrrr)Rs

r)cs|eZdZdZddZddZddZefdd	Zed
dZ	dd
Z
eddZddZddZ
ddZddZZS)
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.Nr)rrrErrrrszFileLoader.__init__cCs|j|jko|j|jkSrI	__class__rrotherrrr__eq__s
zFileLoader.__eq__cCst|jt|jASrIhashrrErrrr__hash__szFileLoader.__hash__cstt||S)zdLoad a module from a file.

        This method is deprecated.  Use exec_module() instead.

        )superrCr(r'rErrr(s
zFileLoader.load_modulecCs|jSz:Return the path to the source file as found by the finder.rKr'rrrrszFileLoader.get_filenamec
Csft|ttfr:tt|}|W5QRSQRXn(t|d}|W5QRSQRXdS)z'Return the data from path as raw bytes.rN)rr)ExtensionFileLoaderre	open_coder|readrf)rrErkrrrr0s
zFileLoader.get_datacCs||r|SdSrI)rrr$rrrget_resource_readers
zFileLoader.get_resource_readercCs tt|jd|}t|dS)NrrP)rGrNrErerfrresourcerErrr
open_resourceszFileLoader.open_resourcecCs&||sttt|jd|}|SNr)is_resourceFileNotFoundErrorrGrNrErVrrr
resource_paths
zFileLoader.resource_pathcCs(t|krdStt|jd|}t|S)NFr)r?rGrNrErVrrrErrrrZ szFileLoader.is_resourcecCsttt|jdSrY)iterrlistdirrNrErKrrrcontents&szFileLoader.contents)rrrrrrHrLrr(rr0rUrXr\rZr`
__classcell__rrrNrrCs

rCc@s.eZdZdZddZddZdddd	Zd
S)SourceFileLoaderz>Concrete implementation of SourceLoader using the file system.cCst|}|j|jdS)z!Return the metadata for the path.)rr9)rPst_mtimest_size)rrEr@rrrr,.szSourceFileLoader.path_statscCst|}|j|||dS)N_mode)rr-)rrrr/rSrrrr/3sz SourceFileLoader._cache_bytecoder\rec	Cst|\}}g}|r4t|s4t|\}}||qt|D]l}t||}zt|Wq<tk
rpYq<Yq<tk
r}zt	
d||WYdSd}~XYq<Xq<zt|||t	
d|Wn0tk
r}zt	
d||W5d}~XYnXdS)zWrite bytes data to a file.zcould not create {!r}: {!r}Nzcreated {!r})rNrXrAreversedrGrmkdirFileExistsErrorrQrrrl)	rrEr/rfparentrrCrHr1rrrr-8s0
zSourceFileLoader.set_dataN)rrrrr,r/r-rrrrrb*srbc@s eZdZdZddZddZdS)SourcelessFileLoaderz-Loader which handles sourceless file imports.cCsD||}||}||d}t|||tt|dd||dS)Nrr)rr)rr0rrr:)rrrEr/rrrrr![s

zSourcelessFileLoader.get_codecCsdS)z'Return None as there is no source code.Nrr'rrrr2kszSourcelessFileLoader.get_sourceN)rrrrr!r2rrrrrkWsrkc@s\eZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZeddZ
dS)rQz]Loader for extension modules.

    The constructor is designed to work with FileFinder.

    cCs@||_t|s6ztt|}Wntk
r4YnX||_dSrI)rr[rGrrWrQrEr]rrrr|szExtensionFileLoader.__init__cCs|j|jko|j|jkSrIrDrFrrrrHs
zExtensionFileLoader.__eq__cCst|jt|jASrIrIrKrrrrLszExtensionFileLoader.__hash__cCs$ttj|}td|j|j|S)z&Create an unitialized extension modulez&extension module {!r} loaded from {!r})rr"rcreate_dynamicrrrE)rrr$rrrr sz!ExtensionFileLoader.create_modulecCs$ttj|td|j|jdS)zInitialize an extension modulez(extension module {!r} executed from {!r}N)rr"rexec_dynamicrrrErTrrrr%s
zExtensionFileLoader.exec_modulecs$t|jdtfddtDS)z1Return True if the extension module is a package.rc3s|]}d|kVqdS)rNrr	suffix	file_namerrr
sz1ExtensionFileLoader.is_package.<locals>.<genexpr>)rNrEanyEXTENSION_SUFFIXESr'rrprrszExtensionFileLoader.is_packagecCsdS)z?Return None as an extension module cannot create a code object.Nrr'rrrr!szExtensionFileLoader.get_codecCsdS)z5Return None as extension modules have no source code.Nrr'rrrr2szExtensionFileLoader.get_sourcecCs|jSrOrKr'rrrrsz ExtensionFileLoader.get_filenameN)rrrrrrHrLr r%rr!r2rrrrrrrQts	rQc@sheZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZdS)_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||_||_dSrI)_name_pathr_get_parent_path_last_parent_path_path_finderrrrEpath_finderrrrrsz_NamespacePath.__init__cCs&|jd\}}}|dkrdS|dfS)z>Returns a tuple of (parent-module-name, parent-path-attr-name)ror)rrE__path__)rurv)rrjdotmerrr_find_parent_path_namessz&_NamespacePath._find_parent_path_namescCs|\}}ttj||SrI)rrrmodules)rparent_module_namepath_attr_namerrrrwsz_NamespacePath._get_parent_pathcCsPt|}||jkrJ||j|}|dk	rD|jdkrD|jrD|j|_||_|jSrI)rrwrxryrurrrv)rparent_pathrrrr_recalculates
z_NamespacePath._recalculatecCst|SrI)r^rrKrrr__iter__sz_NamespacePath.__iter__cCs||SrIr)rindexrrr__getitem__sz_NamespacePath.__getitem__cCs||j|<dSrI)rv)rrrErrr__setitem__sz_NamespacePath.__setitem__cCst|SrI)rrrKrrr__len__sz_NamespacePath.__len__cCsd|jS)Nz_NamespacePath({!r}))r_rvrKrrr__repr__sz_NamespacePath.__repr__cCs||kSrIrritemrrr__contains__sz_NamespacePath.__contains__cCs|j|dSrI)rvrArrrrrAsz_NamespacePath.appendN)rrrrrrrwrrrrrrrrArrrrrts

rtc@sPeZdZddZeddZddZddZd	d
ZddZ	d
dZ
ddZdS)_NamespaceLoadercCst||||_dSrI)rtrvrzrrrrsz_NamespaceLoader.__init__cCsd|jS)zsReturn repr for the module.

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

        z<module {!r} (namespace)>)r_r)rr$rrrmodule_reprsz_NamespaceLoader.module_reprcCsdS)NTrr'rrrrsz_NamespaceLoader.is_packagecCsdS)Nrrr'rrrr2sz_NamespaceLoader.get_sourcecCstdddddS)Nrz<string>r#T)r4)r5r'rrrr!sz_NamespaceLoader.get_codecCsdSrrrrrrr sz_NamespaceLoader.create_modulecCsdSrIrrTrrrr%sz_NamespaceLoader.exec_modulecCstd|jt||S)zbLoad a namespace module.

        This method is deprecated.  Use exec_module() instead.

        z&namespace module loaded with path {!r})rrrvr&r'rrrr(	sz_NamespaceLoader.load_moduleN)rrrrrrrr2r!r r%r(rrrrrs
rc@sveZdZdZeddZeddZeddZedd	ZedddZ	edd
dZ
edddZeddZd
S)
PathFinderz>Meta path finder for sys.path and package __path__ attributes.cCs@ttjD],\}}|dkr(tj|=qt|dr|qdS)z}Call the invalidate_caches() method on all path entry finders
        stored in sys.path_importer_caches (where implemented).Ninvalidate_caches)listrpath_importer_cacheitemsrr)rrfinderrrrrs


zPathFinder.invalidate_cachesc	CsTtjdk	rtjstdttjD],}z||WStk
rLYq"Yq"Xq"dS)z.Search sys.path_hooks for a finder for 'path'.Nzsys.path_hooks is empty)r
path_hooksrqrrrr)rrEhookrrr_path_hooks%s
zPathFinder._path_hookscCsh|dkr,zt}Wntk
r*YdSXztj|}Wn(tk
rb||}|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.

        rN)rrWr[rrKeyErrorr)rrErrrr_path_importer_cache2s
zPathFinder._path_importer_cachecCsRt|dr||\}}n||}g}|dk	r<t||St|d}||_|S)Nr)rrrrrrr)rrrrrrrrr_legacy_get_specHs

zPathFinder._legacy_get_specNc	Csg}|D]}t|ttfsq||}|dk	rt|drF|||}n|||}|dkr\q|jdk	rn|S|j}|dkrt	d|
|qt|d}||_|S)z?Find the loader or namespace_path for this module/package name.Nrzspec missing loader)
rr|bytesrrrrrrrrrr)	rrrErnamespace_pathentryrrrrrr	_get_specWs(


zPathFinder._get_speccCsd|dkrtj}||||}|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)rrErrrrrt)rrrErrrrrrrws
zPathFinder.find_speccCs|||}|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.

        NrrrrrrszPathFinder.find_modulecOsddlm}|j||S)a 
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching ``context.name``
        (or all names if ``None`` indicated) along the paths in the list
        of directories ``context.path``.
        r)MetadataPathFinder)importlib.metadatarfind_distributions)rrrrrrrrs
zPathFinder.find_distributions)N)NN)N)
rrrrrrrrrrrrrrrrrrs"
	


rc@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.

    cspg}|D] \}|fdd|Dq||_|p6d|_t|jsVtt|j|_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|]}|fVqdSrIrrnrrrr
sz&FileFinder.__init__.<locals>.<genexpr>rorN)r_loadersrEr[rGrrW_path_mtimeset_path_cache_relaxed_path_cache)rrEloader_detailsloadersrrrrrs

zFileFinder.__init__cCs
d|_dS)zInvalidate the directory mtime.rN)rrKrrrrszFileFinder.invalidate_cachescCs*||}|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)Nr)r)rrrrEsmslrrrrrrs
zFileFinder._get_specNc	Csd}|dd}zt|jp"tj}Wntk
rBd}YnX||jkr\|||_t	rr|j
}|}n
|j}|}||krt
|j|}|jD]:\}	}
d|	}t
||}t|r||
|||g|Sqt|}|jD]r\}	}
zt
|j||	}Wntk
rYdSXtjd|dd||	|krt|r||
||d|Sq|r~td	|t|d}
|g|
_|
SdS)
zoTry to find a spec for the specified module.

        Returns the matching spec, or None if not found.
        Fror1rrNz	trying {})	verbosityzpossible namespace for {})rvrPrErrWrcrQr_fill_cacherrrrrGrrVrrXr~rrrr)rrris_namespacetail_modulercachecache_module	base_pathror
init_filename	full_pathrrrrrsP






zFileFinder.find_specc	
Cs|j}zt|pt}Wntttfk
r:g}YnXtj	dsTt
||_nJt
}|D]8}|d\}}}|rd
||}n|}||q^||_tj	trdd|D|_dS)zDFill the cache of potential modules and packages for this directory.rror]cSsh|]}|qSr)r)r	fnrrrr*sz)FileFinder._fill_cache.<locals>.<setcomp>N)rErr_rWr[PermissionErrorNotADirectoryErrorrrr rrrr_raddr!r)	rrEr`lower_suffix_contentsrrr}ronew_namerrrr
s"
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 supportedrK)rXrrKrrrrpath_hook_for_FileFinder6sz6FileFinder.path_hook.<locals>.path_hook_for_FileFinderr)rrrrrr	path_hook,s
zFileFinder.path_hookcCsd|jS)NzFileFinder({!r}))r_rErKrrrr>szFileFinder.__repr__)N)rrrrrrrrrrrrrrrrrrrrs
3
rcCs|d}|d}|sB|r$|j}n||kr8t||}n
t||}|sTt|||d}z$||d<||d<||d<||d<Wntk
rYnXdS)N
__loader____spec__r__file__
__cached__)getrrkrbr	Exception)nsrpathname	cpathnamerrrrr_fix_up_moduleDs"

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

    Each item is a tuple (loader, suffixes).
    )rQrextension_suffixesrbrrkr)
extensionssourcebytecoderrrr[src	Cs|atjatjatjt}dD]0}|tjkr8t|}n
tj|}t|||qddgfdddgff}|D]n\}}tdd|Dst|d}|tjkrtj|}qqjzt|}WqWqjt	k
rYqjYqjXqjt	d	t|d
|t|d|t|dd
|t|ddd|Dtd}	t|d|	td}
t|d|
|dkrntd}t|d|t|dtt
t|dkrtddt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.

    )rerqbuiltinsrposixrntrcss|]}t|dkVqdSrrrrrrr
sz_setup.<locals>.<genexpr>rzimportlib requires posix or ntrr?r6r_pathseps_with_coloncSsh|]}d|qSrrrrrrrsz_setup.<locals>.<setcomp>_thread_weakrefwinregrrz.pywz_d.pydTN)rrrrr_builtin_from_namerallr,rrBr#rsrrrrArr
)_bootstrap_moduleself_modulebuiltin_namebuiltin_module
os_details
builtin_osr6r?	os_module
thread_moduleweakref_module
winreg_modulerrr_setupfsN













rcCs2t|t}tjtj|gtjt	dS)z)Install the path-based import components.N)
rrrrrrr	meta_pathrAr)rsupported_loadersrrr_installsr)r\)N)NNN)rr)T)N)N)Rrrrerrqrr_MS_WINDOWSrrrrr6rr,r?rr=rBrr"%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYr!r#r*r0r2rGrNrPrUrVrXr[rltype__code__rr(rr'r-r<rrrrDEBUG_BYTECODE_SUFFIXESOPTIMIZED_BYTECODE_SUFFIXESrrrrrrrrrrrrrrobjectrrrrr)rCrbrkrsrQrtrrrrrrrrrrr<module>s





	



G(!



D@H-:?*
A