U &Ì.eœã@sdZddladdlZddladdlZddlZtjdkZerLddlZ ddl Z nddl Z erbddgZ ndgZ e dd„e Dƒƒs~t‚e dZee ƒZd e ¡Z d d „e DƒZd Zd ZeeZd d„Zdd„Zdd„Zdd„Zerädd„Zndd„Zdd„Zdd„Zdd„Zdd„Zd d!„Z e�r$d"d#„Z!nd$d#„Z!d‚d&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/Z0dƒdd0œd1d2„Z1d3d4„Z2d5d6„Z3d7d8„Z4d9d:„Z5d;d<„Z6d=d>„Z7d?d@„Z8dAdB„Z9dCdD„Z:d„dEdF„Z;d…dGdH„Ze?ƒZ@d‡de@dNœdOdP„ZAGdQdR„dRƒZBGdSdT„dTƒZCGdUdV„dVeCƒZDGdWdX„dXƒZEGdYdZ„dZeEeDƒZFGd[d\„d\eEeCƒZGgZHGd]d^„d^eEeCƒZIGd_d`„d`ƒZJGdadb„dbƒZKGdcdd„ddƒZLGdedf„dfƒZMdˆdgdh„ZNdidj„ZOdkdl„ZPdmdn„ZQdodpdqdrdsdtdudvdwdxdydzd{d|d}d~dœZRd€d�„ZSdS)‰a^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|ƒdkVqdS©éN©Úlen©Ú.0Úsep©r ú5/usr/lib64/python3.8/importlib/_bootstrap_external.pyÚ +sr ÚcCsh|]}d|›�’qS©ú:r ©r Úsr r r Ú /sr)Úwin)ÚcygwinÚdarwincs<tj t¡r0tj t¡rd‰nd‰‡fdd„}ndd„}|S)NÚ PYTHONCASEOKs PYTHONCASEOKcs ˆtjkS)ú5True if filenames must be checked case-insensitively.)Ú_osÚenvironr ©Úkeyr r Ú _relax_case@sz%_make_relax_case.._relax_casecSsdS)rFr r r r r rDs)ÚsysÚplatformÚ startswithÚ_CASE_INSENSITIVE_PLATFORMSÚ#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)rr rr Ú_make_relax_case9s  r#cCst|ƒd@ dd¡S)z*Convert a 32-bit integer to little-endian.ìÿÿéÚlittle)ÚintÚto_bytes)Úxr r r Ú _pack_uint32Jsr*cCst|ƒdkst‚t |d¡S)z/Convert 4 bytes in little-endian to an integer.r%r&©rÚAssertionErrorr'Ú from_bytes©Údatar r r Ú_unpack_uint32Osr0cCst|ƒdkst‚t |d¡S)z/Convert 2 bytes in little-endian to an integer.ér&r+r.r r r Ú_unpack_uint16Tsr2cGsä|sdSt|ƒdkr|dSd}g}ttj|ƒD]z\}}| t¡sL| t¡rf| t¡pX|}t |g}q0| d¡r˜|  ¡|  ¡krŒ|}|g}qª|  |¡q0|pž|}|  |¡q0dd„|Dƒ}t|ƒdkrÖ|dsÖ|t S|t   |¡S)úReplacement for os.path.join().rrrrcSsg|]}|r| t¡‘qSr ©ÚrstripÚpath_separators©r Úpr r r Ú rsú_path_join..) rÚmaprÚ_path_splitrootr Úpath_sep_tupleÚendswithr5r6Úpath_sepÚcasefoldÚappendÚjoin)Ú path_partsÚrootÚpathZnew_rootÚtailr r r Ú _path_join[s*     rGcGst dd„|Dƒ¡S)r3cSsg|]}|r| t¡‘qSr r4)r Úpartr r r r9{sÿr:)r?rB)rCr r r rGys ÿcsBt‡fdd„tDƒƒ}|dkr&dˆfSˆd|…ˆ|dd…fS)z Replacement for os.path.split().c3s|]}ˆ |¡VqdS©N)Úrfindr7©rEr r r �sz_path_split..rrNr)Úmaxr6)rEÚir rKr Ú _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). )rÚstatrKr r r Ú _path_stat‡srPcCs2z t|ƒ}Wntk r"YdSX|jd@|kS)z1Test whether the path is the specified mode type.Fið)rPÚOSErrorÚst_mode)rEÚmodeÚ stat_infor r r Ú_path_is_mode_type‘s  rUcCs t|dƒS)zReplacement for os.path.isfile.i€)rUrKr r r Ú _path_isfilešsrVcCs|s t ¡}t|dƒS)zReplacement for os.path.isdir.i@)rÚgetcwdrUrKr r r Ú _path_isdirŸsrXcCs>|sdSt |¡d dd¡}t|ƒdko<| d¡p<| d¡S)úReplacement for os.path.isabs.Frrrrz\\)rr<Úreplacerr r>)rErDr r r Ú _path_isabs§sr[cCs | t¡S)rY)r r6rKr r r r[¯sé¶c Cs¢d |t|ƒ¡}t |tjtjBtjB|d@¡}z2t |d¡�}|  |¡W5QRXt  ||¡Wn:t k rœzt  |¡Wnt k r”YnX‚YnXdS)z¢Best-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) ÚformatÚidrÚopenÚO_EXCLÚO_CREATÚO_WRONLYÚ_ioÚFileIOÚwriterZrQÚunlink)rEr/rSÚpath_tmpÚfdÚfiler r r Ú _write_atomic´sÿrliU r1r&s Ú __pycache__zopt-z.pyz.pyc)Ú optimizationc CsX|dk r4t dt¡|dk r(d}t|ƒ‚|r0dnd}t |¡}t|ƒ\}}| d¡\}}}tj j } | dkrrt dƒ‚d  |r~|n||| g¡} |dkr¬tj jdkr¤d}ntj j}t|ƒ}|dkrà| ¡sÒtd  |¡ƒ‚d  | t|¡} | td} tjdk �rLt|ƒ�stt ¡|ƒ}|dd k�r8|dtk�r8|d d…}ttj| t¡| ƒSt|t| ƒS) aþGiven 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)Ú _warningsÚwarnÚDeprecationWarningÚ TypeErrorrÚfspathrNÚ rpartitionrÚimplementationÚ cache_tagÚNotImplementedErrorrBÚflagsÚoptimizeÚstrÚisalnumÚ ValueErrorr_Ú_OPTÚBYTECODE_SUFFIXESÚpycache_prefixr[rGrWr6ÚlstripÚ_PYCACHE) rEÚdebug_overridernÚmessageÚheadrFÚbaser ÚrestÚtagÚalmost_filenameÚfilenamer r r Úcache_from_sourcebsHÿ       ýrŒc Cs.tjjdkrtdƒ‚t |¡}t|ƒ\}}d}tjdk rftj t ¡}|  |t ¡rf|t |ƒd…}d}|s�t|ƒ\}}|t kr�tt ›d|›�ƒ‚| d¡}|dkr²td|›�ƒ‚n\|d k�r| dd ¡d }|  t¡sätd t›�ƒ‚|t tƒd…}| ¡�std |›d�ƒ‚| d¡d} 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. NrpFTz not bottom-level directory in ro>r1ézexpected only 2 or 3 dots in r�r1éþÿÿÿz5optimization portion of filename does not start with zoptimization level z is not an alphanumeric valuer)rrwrxryrrurNr�r5r6r r?rrƒr~ÚcountÚrsplitrr}Ú partitionrGÚSOURCE_SUFFIXES) rEr†Úpycache_filenameÚfound_in_pycache_prefixÚ stripped_pathÚpycacheÚ dot_countrnÚ opt_levelÚ base_filenamer r r Úsource_from_cache©s4          ršc Cs~t|ƒdkrdS| d¡\}}}|r8| ¡dd…dkr<|Sz t|ƒ}Wn$ttfk rl|dd…}YnXt|ƒrz|S|S)z¼Convert a bytecode file path to a source path (if possible). This function exists purely for backwards-compatibility for PyImport_ExecCodeModuleWithFilenames() in the C API. rNroéýÿÿÿéÿÿÿÿÚpy)rrvÚlowerršryr~rV)Ú bytecode_pathrˆÚ_Ú extensionÚ source_pathr r r Ú_get_sourcefileÑs  r£cCsJ| ttƒ¡r0z t|ƒWStk r,YqFXn| ttƒ¡rB|SdSdSrI)r>Útupler’rŒryr€)r‹r r r Ú _get_cachedäs r¥cCs4zt|ƒj}Wntk r&d}YnX|dO}|S)z3Calculate the mode permissions for a bytecode file.r\é€)rPrRrQ)rErSr r r Ú _calc_modeðs  r§csDd‡fdd„ }z tj}Wntk r4dd„}YnX||ˆƒ|S)züDecorator 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)r©Ú ImportError)Úselfr©ÚargsÚkwargs©Úmethodr r Ú_check_name_wrappers ÿÿz(_check_name.._check_name_wrappercSs8dD] }t||ƒrt||t||ƒƒq|j |j¡dS)N)Ú __module__Ú__name__Ú __qualname__Ú__doc__)ÚhasattrÚsetattrÚgetattrÚ__dict__Úupdate)ÚnewÚoldrZr r r Ú_wraps z_check_name.._wrap)N)Ú _bootstrapr¼Ú NameError)r¯r°r¼r r®r Ú _check_nameüs  r¿cCs<| |¡\}}|dkr8t|ƒr8d}t | |d¡t¡|S)z›Try 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)r«ÚfullnameÚloaderÚportionsÚmsgr r r Ú_find_module_shims rÆcCsž|dd…}|tkrB}| t|ƒ¡t|ƒdks2t‚| |¡| t |¡¡|S)z&Produce the data for a hash-based pyc.rrÉ)ràrËrár*rr,rØrâ)rÞrÕÚcheckedr/rzr r r Ú_code_to_hash_pyc•s  ræcCs>ddl}t |¡j}| |¡}t dd¡}| | |d¡¡S)zyDecode bytes representing source code and return the string. Universal newline support is used in the decoding. rNT)ÚtokenizereÚBytesIOÚreadlineÚdetect_encodingÚIncrementalNewlineDecoderÚdecode)Ú source_bytesrçÚsource_bytes_readlineÚencodingÚnewline_decoderr r r Ú decode_source s    rñ©rÃÚsubmodule_search_locationsc Cs|dkrÚ get_filename©ÚoriginTÚ is_packager)rµrôrªrrur½Ú ModuleSpecÚ _set_fileattrÚ_get_supported_file_loadersr>r¤rÃÚ _POPULATEr÷rórNrA) r©ÚlocationrÃróÚspecÚ loader_classÚsuffixesr÷Údirnamer r r Úspec_from_file_location±s>        rc@sPeZdZdZdZdZdZedd„ƒZedd„ƒZ edd d „ƒZ edd d „ƒZ d 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}\DebugFcCs8zt tj|¡WStk r2t tj|¡YSXdSrI)Ú_winregÚOpenKeyÚHKEY_CURRENT_USERrQÚHKEY_LOCAL_MACHINE)Úclsrr r r Ú_open_registrysz$WindowsRegistryFinder._open_registryc Csr|jr|j}n|j}|j|dtjdd…d�}z&| |¡�}t |d¡}W5QRXWnt k rlYdSX|S)Nz%d.%dr1)rÂÚ sys_versionr) Ú DEBUG_BUILDÚREGISTRY_KEY_DEBUGÚ REGISTRY_KEYr_rÚ version_inforrÚ QueryValuerQ)rrÂÚ registry_keyrÚhkeyÚfilepathr r r Ú_search_registrysÿ z&WindowsRegistryFinder._search_registryNcCsz| |¡}|dkrdSz t|ƒWntk r8YdSXtƒD]4\}}| t|ƒ¡r@tj||||ƒ|d�}|Sq@dS)Nrõ)rrPrQrúr>r¤r½Úspec_from_loader)rrÂrEÚtargetrrÃrÿrýr r r Ú find_specs  þzWindowsRegistryFinder.find_speccCs"| ||¡}|dk r|jSdSdS)zlFind module named in the registry. This method is deprecated. Use exec_module() instead. N©rrérrÂrErýr r r Ú find_module's z!WindowsRegistryFinder.find_module)NN)N) r²r±r³r´r r r Ú classmethodrrrrr r r r rõsÿÿ   rc@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd S) Ú _LoaderBasicszSBase class of common code needed by both SourceLoader and SourcelessFileLoader.cCs@t| |¡ƒd}| dd¡d}| d¡d}|dko>|dkS)z�Concrete implementation of InspectLoader.is_package by checking if the path returned by get_filename has a filename of '__init__.py'.rrorr1Ú__init__)rNrôr�rv)r«rÂr‹Ú filename_baseÚ tail_namer r r r÷:sz_LoaderBasics.is_packagecCsdS©z*Use default semantics for module creation.Nr ©r«rýr r r Ú create_moduleBsz_LoaderBasics.create_modulecCs8| |j¡}|dkr$td |j¡ƒ‚t t||j¡dS)zExecute the module.Nz4cannot load module {!r} when get_code() returns None)Úget_coder²rªr_r½Ú_call_with_frames_removedÚexecr¸)r«ÚmodulerÞr r r Ú exec_moduleEs  ÿz_LoaderBasics.exec_modulecCs t ||¡S)zThis module is deprecated.)r½Ú_load_module_shim©r«rÂr r r Ú load_moduleMsz_LoaderBasics.load_moduleN)r²r±r³r´r÷r r%r(r r r r r5s rc@sJeZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d œd d„Zdd„Z dS)Ú SourceLoadercCst‚dS)z¥Optional method that returns the modification time (an int) for the specified path (a str). Raises OSError when the path cannot be handled. N)rQ©r«rEr r r Ú path_mtimeTszSourceLoader.path_mtimecCsd| |¡iS)ažOptional 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*r r r Ú path_stats\s zSourceLoader.path_statscCs | ||¡S)zäOptional 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)r«r¢Ú cache_pathr/r r r Ú_cache_bytecodejszSourceLoader._cache_bytecodecCsdS)z–Optional method which writes data (bytes) to a file path (a str). Implementing this method allows for the writing of bytecode files. Nr )r«rEr/r r r 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()r¨N)rôÚget_datarQrªrñ)r«rÂrEríÚexcr r r Ú get_source{s ÿÿzSourceLoader.get_sourcerœ)Ú _optimizecCstjt||dd|d�S)z‚Return the code object compiled from source. The 'data' argument can be any object type that compile() supports. r#T)Ú dont_inheritr{)r½r"Úcompile)r«r/rEr3r r r Úsource_to_code…s ÿzSourceLoader.source_to_codec Cs"| |¡}d}d}d}d}d}z t|ƒ}Wntk rDd}Y�n0Xz| |¡} Wntk rjY�n Xt| dƒ}z| |¡} Wntk ršYnÚX||dœ} z”t| || ƒ} t| ƒdd…} | d@dk}|�r$| d @dk}t j d k�r8|sþt j d k�r8| |¡}t   t |¡}t | ||| ƒnt| || d || ƒWnttfk �rTYn Xt d ||¡t| |||d�S|dk�rˆ| |¡}| ||¡}t d|¡tj�s|dk �r|dk �r|�rä|dk�rÖt   |¡}t|||ƒ} nt||t|ƒƒ} z| ||| ¡Wntk �rYnX|S)z¾Concrete implementation of InspectLoader.get_code. Reading of bytecode requires path_stats to be implemented. To write bytecode, set_data must also be implemented. NFTrãr×rÈrrr1ÚneverÚalwaysÚsizez {} matches {})r©rŸr¢zcode object from {})rôrŒryr,rQr'r0rÐÚ memoryviewrÜÚcheck_hash_based_pycsrÕÚ_RAW_MAGIC_NUMBERrÖrÔrªrÍr½rÌrßr6rÚdont_write_bytecoderærärr/)r«rÂr¢rÒrírÕÚ hash_basedÚ check_sourcerŸÚstr/rÎrzÚ bytes_dataÚ code_objectr r r r!�s˜    þ    ÿþ þÿûÿþ    ÿ  ÿzSourceLoader.get_codeN) r²r±r³r+r,r/r-r2r6r!r r r r r)Rs  r)cs|eZdZdZdd„Zdd„Zdd„Ze‡fdd „ƒZed d „ƒZ d d „Z edd„ƒZ dd„Z dd„Z dd„Zdd„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.Nr×)r«rÂrEr r r rçszFileLoader.__init__cCs|j|jko|j|jkSrI©Ú __class__r¸©r«Úotherr r r Ú__eq__ís  ÿzFileLoader.__eq__cCst|jƒt|jƒASrI©Úhashr©rE©r«r r r Ú__hash__ñszFileLoader.__hash__cstt|ƒ |¡S)zdLoad a module from a file. This method is deprecated. Use exec_module() instead. )ÚsuperrCr(r'©rEr r r(ôs zFileLoader.load_modulecCs|jS©z:Return the path to the source file as found by the finder.rKr'r r r rôszFileLoader.get_filenamec Csft|ttfƒr:t t|ƒ¡�}| ¡W5QR£SQRXn(t |d¡�}| ¡W5QR£SQRXdS)z'Return the data from path as raw bytes.ÚrN)rÚr)ÚExtensionFileLoaderreÚ open_coder|Úreadrf)r«rErkr r r r0s zFileLoader.get_datacCs| |¡r|SdSrI)r÷©r«r$r r r Úget_resource_readers zFileLoader.get_resource_readercCs tt|jƒd|ƒ}t |d¡S)NrrP)rGrNrErerf©r«ÚresourcerEr r r Ú open_resourceszFileLoader.open_resourcecCs&| |¡st‚tt|jƒd|ƒ}|S©Nr)Ú is_resourceÚFileNotFoundErrorrGrNrErVr r r Ú resource_paths zFileLoader.resource_pathcCs(t|kr dStt|jƒd|ƒ}t|ƒS)NFr)r?rGrNrErV©r«r©rEr r r rZ szFileLoader.is_resourcecCstt t|jƒd¡ƒSrY)ÚiterrÚlistdirrNrErKr r r Úcontents&szFileLoader.contents)r²r±r³r´rrHrLr¿r(rôr0rUrXr\rZr`Ú __classcell__r r rNr rCâs    rCc@s.eZdZdZdd„Zdd„Zddœdd „Zd S) ÚSourceFileLoaderz>Concrete implementation of SourceLoader using the file system.cCst|ƒ}|j|jdœS)z!Return the metadata for the path.)rãr9)rPÚst_mtimeÚst_size)r«rEr@r r r r,.szSourceFileLoader.path_statscCst|ƒ}|j|||d�S)N©Ú_mode)r§r-)r«r¢rŸr/rSr r r r/3sz SourceFileLoader._cache_bytecoder\rec Csüt|ƒ\}}g}|r4t|ƒs4t|ƒ\}}| |¡qt|ƒD]l}t||ƒ}zt |¡Wq<tk rpYq.)rNrEÚanyÚEXTENSION_SUFFIXESr'r rpr r÷šs ÿzExtensionFileLoader.is_packagecCsdS)z?Return None as an extension module cannot create a code object.Nr r'r r r r! szExtensionFileLoader.get_codecCsdS)z5Return None as extension modules have no source code.Nr r'r r r r2¤szExtensionFileLoader.get_sourcecCs|jSrOrKr'r r r rô¨sz ExtensionFileLoader.get_filenameN)r²r±r³r´rrHrLr r%r÷r!r2r¿rôr r r r rQts rQc@sheZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„ZdS)Ú_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_finder©r«r©rEÚ path_finderr r r rµsz_NamespacePath.__init__cCs&|j d¡\}}}|dkrdS|dfS)z>Returns a tuple of (parent-module-name, parent-path-attr-name)ror)rrEÚ__path__)rurv)r«rjÚdotÚmer r r Ú_find_parent_path_names»sz&_NamespacePath._find_parent_path_namescCs| ¡\}}ttj||ƒSrI)rr·rÚmodules)r«Úparent_module_nameÚpath_attr_namer r r rwÅs z_NamespacePath._get_parent_pathcCsPt| ¡ƒ}||jkrJ| |j|¡}|dk rD|jdkrD|jrD|j|_||_|jSrI)r¤rwrxryrurÃrórv)r«Ú parent_pathrýr r r Ú _recalculateÉs  z_NamespacePath._recalculatecCs t| ¡ƒSrI)r^r„rKr r r Ú__iter__Ösz_NamespacePath.__iter__cCs | ¡|SrI©r„)r«Úindexr r r Ú __getitem__Ùsz_NamespacePath.__getitem__cCs||j|<dSrI)rv)r«r‡rEr r r Ú __setitem__Üsz_NamespacePath.__setitem__cCs t| ¡ƒSrI)rr„rKr r r Ú__len__ßsz_NamespacePath.__len__cCs d |j¡S)Nz_NamespacePath({!r}))r_rvrKr r r Ú__repr__âsz_NamespacePath.__repr__cCs || ¡kSrIr†©r«Úitemr r r Ú __contains__åsz_NamespacePath.__contains__cCs|j |¡dSrI)rvrArŒr r r rAèsz_NamespacePath.appendN)r²r±r³r´rrrwr„r…rˆr‰rŠr‹rŽrAr r r r rt®s  rtc@sPeZdZdd„Zedd„ƒZdd„Zdd„Zd d „Zd d „Z d d„Z dd„Z dS)Ú_NamespaceLoadercCst|||ƒ|_dSrI)rtrvrzr r r rîsz_NamespaceLoader.__init__cCs d |j¡S)zsReturn repr for the module. The method is deprecated. The import machinery does the job itself. z)r_r²)rr$r r r Ú module_reprñsz_NamespaceLoader.module_reprcCsdS)NTr r'r r r r÷úsz_NamespaceLoader.is_packagecCsdS)Nrr r'r r r r2ýsz_NamespaceLoader.get_sourcecCstddddd�S)Nrzr#T)r4)r5r'r r r r!sz_NamespaceLoader.get_codecCsdSrr rr r r r sz_NamespaceLoader.create_modulecCsdSrIr rTr r r r%sz_NamespaceLoader.exec_modulecCst d|j¡t ||¡S)zbLoad a namespace module. This method is deprecated. Use exec_module() instead. z&namespace module loaded with path {!r})r½rÌrvr&r'r r r r( sÿz_NamespaceLoader.load_moduleN) r²r±r³rrr�r÷r2r!r r%r(r r r r r�ís r�c@sveZdZdZedd„ƒZedd„ƒZedd„ƒZedd „ƒZedd d „ƒZ edd d„ƒZ eddd„ƒZ edd„ƒZ d S)Ú PathFinderz>Meta path finder for sys.path and package __path__ attributes.cCs@ttj ¡ƒD],\}}|dkr(tj|=qt|dƒr| ¡qdS)z}Call the invalidate_caches() method on all path entry finders stored in sys.path_importer_caches (where implemented).NÚinvalidate_caches)ÚlistrÚpath_importer_cacheÚitemsrµr’)rr©Úfinderr r r r’s   zPathFinder.invalidate_cachesc CsTtjdk rtjst dt¡tjD],}z||ƒWStk rLYq"Yq"Xq"dS)z.Search sys.path_hooks for a finder for 'path'.Nzsys.path_hooks is empty)rÚ path_hooksrqrrrÁrª)rrEÚhookr r r Ú _path_hooks%s   zPathFinder._path_hookscCsh|dkr,z t ¡}Wntk r*YdSXztj|}Wn(tk rb| |¡}|tj|<YnX|S)zÒGet 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[rr”ÚKeyErrorr™)rrEr–r r r Ú_path_importer_cache2s  zPathFinder._path_importer_cachecCsRt|dƒr| |¡\}}n| |¡}g}|dk r.rorœN) ráÚ_loadersrEr[rGrrWÚ _path_mtimeÚsetÚ _path_cacheÚ_relaxed_path_cache)r«rEÚloader_detailsÚloadersrÿr r¥r r³s   zFileFinder.__init__cCs d|_dS)zInvalidate the directory mtime.rœN)r§rKr r r r’ÃszFileFinder.invalidate_cachescCs*| |¡}|dkrdgfS|j|jp&gfS)zÅTry 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)rrÃró)r«rÂrýr r r rÀÉs zFileFinder.find_loadercCs|||ƒ}t||||d�S)Nrò)r)r«rþrÂrEÚsmslrrÃr r r r Õs ÿzFileFinder._get_specNc Cs‚d}| d¡d}zt|jp"t ¡ƒj}Wntk rBd}YnX||jkr\| ¡||_t ƒrr|j }|  ¡}n |j }|}||krÚt |j|ƒ}|jD]:\} } d| } t || ƒ} t| ƒr–| | || |g|¡Sq–t|ƒ}|jD]r\} } zt |j|| ƒ} Wntk �rYdSXtjd| dd�|| |kràt| ƒrà| | || d|¡Sqà|�r~t d |¡t |d¡} |g| _| SdS) zoTry to find a spec for the specified module. Returns the matching spec, or None if not found. Fror1rœrNz trying {})Ú verbosityzpossible namespace for {})rvrPrErrWrcrQr§Ú _fill_cacherrªržr©rGr¦rVr rXr~r½rÌrøró)r«rÂrÚ is_namespaceÚ tail_modulerãÚcacheÚ cache_moduleÚ base_pathrorþÚ init_filenameÚ full_pathrýr r r rÚsP        ÿ   zFileFinder.find_specc Cs¾|j}zt |pt ¡¡}Wntttfk r:g}YnXtj  d¡sTt |ƒ|_ nJt ƒ}|D]8}|  d¡\}}}|rˆd  || ¡¡}n|}| |¡q^||_ tj  t¡rºdd„|Dƒ|_dS)zDFill the cache of potential modules and packages for this directory.rror]cSsh|] }| ¡’qSr )rž)r Úfnr r r r*sz)FileFinder._fill_cache..N)rErr_rWr[ÚPermissionErrorÚNotADirectoryErrorrrr r¨r©r‘r_ržÚaddr!rª) r«rEr`Úlower_suffix_contentsr�r©r}roÚnew_namer r r r¯ s"     zFileFinder._fill_cachecs‡‡fdd„}|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�‚ˆ|fˆžŽS)z-Path hook for importlib.machinery.FileFinder.zonly directories are supportedrK)rXrªrK©rr«r r Úpath_hook_for_FileFinder6s z6FileFinder.path_hook..path_hook_for_FileFinderr )rr«r¾r r½r Ú path_hook,s zFileFinder.path_hookcCs d |j¡S)NzFileFinder({!r}))r_rErKr r r r‹>szFileFinder.__repr__)N)r²r±r³r´rr’rÆrrÀr rr¯rr¿r‹r r r r r¤ªs  3 r¤cCs’| d¡}| d¡}|sB|r$|j}n||kr8t||ƒ}n t||ƒ}|sTt|||d�}z$||d<||d<||d<||d<Wntk rŒYnXdS)NÚ __loader__Ú__spec__r¥Ú__file__Ú __cached__)ÚgetrÃrkrbrÚ Exception)Únsr©ÚpathnameÚ cpathnamerÃrýr r r Ú_fix_up_moduleDs"     rÉcCs*ttt ¡ƒf}ttf}ttf}|||gS)z_Returns a list of file-based module loaders. Each item is a tuple (loader, suffixes). )rQÚ_alternative_architecturesrÜÚextension_suffixesrbr’rkr€)Ú extensionsÚsourceÚbytecoder r r rú[srúc Cs¶|atjatjatjt}dD]0}|tjkr8t |¡}n tj|}t|||ƒqddgfdddgff}|D]n\}}tdd„|Dƒƒsˆt‚|d}|tjkrªtj|}qâqjzt |¡}WqâWqjt k rÖYqjYqjXqjt d ƒ‚t|d |ƒt|d |ƒt|d d   |¡ƒt|ddd„|Dƒƒt d¡} t|d| ƒt d¡} t|d| ƒ|dk�rnt d¡} t|d| ƒt|dt ƒƒt   tt ¡ƒ¡|dk�r²t d¡dt k�r²dt_dS)zÍSetup 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. )rerqÚbuiltinsrØÚposixrÚntrcss|]}t|ƒdkVqdSrrrr r r r sz_setup..rzimportlib requires posix or ntrr?r6rÚ_pathseps_with_coloncSsh|]}d|›�’qSrr rr r r r�sz_setup..Ú_threadÚ_weakrefÚwinregrrz.pywz_d.pydTN)r½rrÜr€r²Ú_builtin_from_namer¶Úallr,rªrBr#rsrárÊrËr’rArr ) Ú_bootstrap_moduleÚ self_moduleÚ builtin_nameÚbuiltin_moduleÚ os_detailsÚ builtin_osr6r?Ú os_moduleÚ thread_moduleÚweakref_moduleÚ winreg_moduler r r Ú_setupfsN                      râcCs2t|ƒtƒ}tj tj|Žg¡tj t ¡dS)z)Install the path-based import components.N) rârúrr—rár¤r¿Ú meta_pathrAr‘)rØÚsupported_loadersr r r Ú_install§sråú-arm-linux-gnueabihf.ú-armeb-linux-gnueabihf.ú-mips64-linux-gnuabi64.ú-mips64el-linux-gnuabi64.ú-powerpc-linux-gnu.ú-powerpc-linux-gnuspe.ú-powerpc64-linux-gnu.ú-powerpc64le-linux-gnu.ú-arm-linux-gnueabi.ú-armeb-linux-gnueabi.ú-mips64-linux-gnu.ú-mips64el-linux-gnu.ú-ppc-linux-gnu.ú-ppc-linux-gnuspe.ú-ppc64-linux-gnu.ú-ppc64le-linux-gnu.)rîrïrðrñròrórôrõrærçrèrérêrërìrícCsF|D]<}t ¡D].\}}||kr| | ||¡¡|Sqq|S)z®Add a suffix with an alternative architecture name to the list of suffixes so an extension built with the default (upstream) setting is loadable with our Pythons )Ú _ARCH_MAPr•rArZ)rÿroÚoriginalÚ alternativer r r rÊÄs rÊ)r\)N)NNN)rr)T)N)N)Tr´rÜrerrqrØrÚ _MS_WINDOWSrÑrrÕrÐr6r×r,r?r¤r=rBrÒr"Ú%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYr!r#r*r0r2rGrNrPrUrVrXr[rlÚtypeÚ__code__rÛr(rËr'r-r<rƒrr’r€ÚDEBUG_BYTECODE_SUFFIXESÚOPTIMIZED_BYTECODE_SUFFIXESrŒršr£r¥r§r¿rÆrÐrÔrÖrßrärærñÚobjectrûrrrr)rCrbrkrsrQrtr�r‘r¤rÉrúrârårörÊr r r r ÚsÎ    ÿ        G(  ! ÿ D@H-:?*  A ï