U &.e@sdZddladdlZddladdlZddlZtjdkZerLddlZ ddl Z nddl Z erbddgZ ndgZ e dde Ds~te dZee Zde Z d d e DZd Zd ZeeZd dZddZddZddZerddZnddZddZddZddZddZd d!Z er$d"d#Z!nd$d#Z!dd&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/Z0ddd0d1d2Z1d3d4Z2d5d6Z3d7d8Z4d9d:Z5d;d<Z6d=d>Z7d?d@Z8dAdBZ9dCdDZ:ddEdFZ;ddGdHZe?Z@dde@dNdOdPZAGdQdRdRZBGdSdTdTZCGdUdVdVeCZDGdWdXdXZEGdYdZdZeEeDZFGd[d\d\eEeCZGgZHGd]d^d^eEeCZIGd_d`d`ZJGdadbdbZKGdcddddZLGdedfdfZMddgdhZNdidjZOdkdlZPdmdnZQdodpdqdrdsdtdudvdwdxdydzd{d|d}d~dZRddZSdS)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|dkVqdSNlen.0sepr 5/usr/lib64/python3.8/importlib/_bootstrap_external.py +sr cCsh|]}d|qS:r r sr r r /sr)win)cygwindarwincs<tjtr0tjtrdndfdd}ndd}|S)N PYTHONCASEOKs PYTHONCASEOKcs tjkS)5True if filenames must be checked case-insensitively.)_osenvironr keyr r _relax_case@sz%_make_relax_case.._relax_casecSsdS)rFr r r r r rDs)sysplatform startswith_CASE_INSENSITIVE_PLATFORMS#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)rr rr _make_relax_case9s  r#cCst|d@ddS)z*Convert a 32-bit integer to little-endian.little)intto_bytes)xr r r _pack_uint32Jsr*cCst|dkstt|dS)z/Convert 4 bytes in little-endian to an integer.r%r&rAssertionErrorr' from_bytesdatar r r _unpack_uint32Osr0cCst|dkstt|dS)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\}}|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|tqSr rstrippath_separatorsr pr r r rs_path_join..) rmapr_path_splitrootr path_sep_tupleendswithr5r6path_sepcasefoldappendjoin) path_partsrootpathZnew_roottailr r r _path_join[s*     rGcGstdd|DS)r3cSsg|]}|r|tqSr r4)r partr r r r9{sr:)r?rB)rCr r r rGys csBtfddtD}|dkr&dfSd||ddfS)z Replacement for os.path.split().c3s|]}|VqdSN)rfindr7rEr r r sz_path_split..rrNr)maxr6)rEir 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). )rstatrKr r r _path_statsrPcCs2z t|}Wntk r"YdSX|jd@|kS)z1Test whether the path is the specified mode type.Fi)rPOSErrorst_mode)rEmode stat_infor r r _path_is_mode_types  rUcCs t|dS)zReplacement for os.path.isfile.i)rUrKr r r _path_isfilesrVcCs|s t}t|dS)zReplacement for os.path.isdir.i@)rgetcwdrUrKr r r _path_isdirsrXcCs>|sdSt|ddd}t|dko<|dp<|dS)Replacement for os.path.isabs.Frrrrz\\)rr<replacerr r>)rErDr r r _path_isabssr[cCs |tS)rY)r r6rKr r r r[sc Csd|t|}t|tjtjBtjB|d@}z2t|d}| |W5QRXt ||Wn:t k rzt |Wnt k 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_tmpfdfiler r r _write_atomicsrliU r1r&s __pycache__zopt-z.pyz.pyc) optimizationc CsX|dk r4tdt|dk r(d}t||r0dnd}t|}t|\}}|d\}}}tj j } | dkrrt dd |r~|n||| g} |dkrtj jdkrd}ntj j}t|}|dkr|std |d | t|} | td} tjdk rLt|stt|}|dd kr8|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_filenamefilenamer r r cache_from_sourcebsH       rc Cs.tjjdkrtdt|}t|\}}d}tjdk rftjt }| |t rf|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_filenamer r r 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_ extension source_pathr r r _get_sourcefiles  rcCsJ|ttr0z t|WStk r,YqFXn|ttrB|SdSdSrI)r>tuplerrryr)rr r r _get_cacheds rcCs4zt|j}Wntk r&d}YnX|dO}|S)z3Calculate the mode permissions for a bytecode file.r\)rPrRrQ)rErSr r r _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)r ImportError)selfrargskwargsmethodr r _check_name_wrappers z(_check_name.._check_name_wrappercSs8dD] }t||rt||t||q|j|jdS)N) __module____name__ __qualname____doc__)hasattrsetattrgetattr__dict__update)newoldrZr r r _wraps z_check_name.._wrap)N) _bootstrapr NameError)rrrr rr _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)rfullnameloaderportionsmsgr r r _find_module_shims rcCs|dd}|tkrB}|t|t|dks2t|||t||S)z&Produce the data for a hash-based pyc.rr)rrrr*rr,rr)rrcheckedr/rzr r r _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_decoderr r r decode_sources    rrsubmodule_search_locationsc Cs|dkr get_filenameoriginT is_packager)rrrrrur ModuleSpec _set_fileattr_get_supported_file_loadersr>rr _POPULATErrrNrA) rlocationrrspec loader_classsuffixesrdirnamer r r spec_from_file_locations>        rc@sPeZdZdZdZdZdZeddZeddZ 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}\DebugFcCs8zttj|WStk r2ttj|YSXdSrI)_winregOpenKeyHKEY_CURRENT_USERrQHKEY_LOCAL_MACHINE)clsrr r r _open_registrysz$WindowsRegistryFinder._open_registryc Csr|jr|j}n|j}|j|dtjddd}z&||}t|d}W5QRXWnt k rlYdSX|S)Nz%d.%dr1)r sys_versionr) DEBUG_BUILDREGISTRY_KEY_DEBUG REGISTRY_KEYr_r version_inforr QueryValuerQ)rr registry_keyrhkeyfilepathr r r _search_registrys z&WindowsRegistryFinder._search_registryNcCsz||}|dkrdSz t|Wntk r8YdSXtD]4\}}|t|r@tj|||||d}|Sq@dS)Nr)rrPrQrr>rrspec_from_loader)rrrEtargetrrrrr r r find_specs  zWindowsRegistryFinder.find_speccCs"|||}|dk r|jSdSdS)zlFind module named in the registry. This method is deprecated. Use exec_module() instead. NrrrrrErr r r find_module's z!WindowsRegistryFinder.find_module)NN)N) rrrrr r r  classmethodrrrrr r r r 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_namer r r r:sz_LoaderBasics.is_packagecCsdSz*Use default semantics for module creation.Nr rrr r r 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)rmodulerr r r exec_moduleEs  z_LoaderBasics.exec_modulecCs t||S)zThis module is deprecated.)r_load_module_shimrrr r r load_moduleMsz_LoaderBasics.load_moduleN)rrrrrr r%r(r r r r r5s rc@sJeZdZddZddZddZddZd d Zd d 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)rQrrEr r r 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*r r r 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/r r r _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/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()rN)rget_datarQrr)rrrErexcr r r 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/rEr3r r r 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 d kr8||}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_data code_objectr r r r!s               zSourceLoader.get_codeN) rrrr+r,r/r-r2r6r!r r r r r)Rs  r)cs|eZdZdZddZddZddZefdd Zed d Z d d Z eddZ ddZ 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)rrrEr r r rszFileLoader.__init__cCs|j|jko|j|jkSrI __class__rrotherr r r __eq__s  zFileLoader.__eq__cCst|jt|jASrIhashrrErr 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|jSz:Return the path to the source file as found by the finder.rKr'r r r 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)rrErkr r r r0s zFileLoader.get_datacCs||r|SdSrI)rrr$r r r get_resource_readers zFileLoader.get_resource_readercCs tt|jd|}t|dS)NrrP)rGrNrErerfrresourcerEr r r open_resourceszFileLoader.open_resourcecCs&||sttt|jd|}|SNr) is_resourceFileNotFoundErrorrGrNrErVr r r resource_paths zFileLoader.resource_pathcCs(t|kr dStt|jd|}t|S)NFr)r?rGrNrErVrrrEr r r rZ szFileLoader.is_resourcecCsttt|jdSrY)iterrlistdirrNrErKr r r contents&szFileLoader.contents)rrrrrrHrLrr(rr0rUrXr\rZr` __classcell__r r rNr 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@r r r r,.szSourceFileLoader.path_statscCst|}|j|||dS)N_mode)rr-)rrrr/rSr r r r/3sz SourceFileLoader._cache_bytecoder\rec Cst|\}}g}|r4t|s4t|\}}||qt|D]l}t||}zt|Wq<tk rpYq.)rNrEanyEXTENSION_SUFFIXESr'r rpr rs 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 r2szExtensionFileLoader.get_sourcecCs|jSrOrKr'r r r rsz ExtensionFileLoader.get_filenameN)rrrrrrHrLr r%rr!r2rrr r r r rQts rQc@sheZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ 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_finderrrrE path_finderr r r rsz_NamespacePath.__init__cCs&|jd\}}}|dkrdS|dfS)z>Returns a tuple of (parent-module-name, parent-path-attr-name)ror)rrE__path__)rurv)rrjdotmer r r _find_parent_path_namessz&_NamespacePath._find_parent_path_namescCs|\}}ttj||SrI)rrrmodules)rparent_module_namepath_attr_namer r r rws z_NamespacePath._get_parent_pathcCsPt|}||jkrJ||j|}|dk rD|jdkrD|jrD|j|_||_|jSrI)rrwrxryrurrrv)r parent_pathrr r r _recalculates  z_NamespacePath._recalculatecCs t|SrI)r^rrKr r r __iter__sz_NamespacePath.__iter__cCs ||SrIr)rindexr r r __getitem__sz_NamespacePath.__getitem__cCs||j|<dSrI)rv)rrrEr r r __setitem__sz_NamespacePath.__setitem__cCs t|SrI)rrrKr r r __len__sz_NamespacePath.__len__cCs d|jS)Nz_NamespacePath({!r}))r_rvrKr r r __repr__sz_NamespacePath.__repr__cCs ||kSrIrritemr r r __contains__sz_NamespacePath.__contains__cCs|j|dSrI)rvrArr r r rAsz_NamespacePath.appendN)rrrrrrrwrrrrrrrrAr r r r rts  rtc@sPeZdZddZeddZddZddZd d Zd d Z d dZ ddZ dS)_NamespaceLoadercCst||||_dSrI)rtrvrzr r r rsz_NamespaceLoader.__init__cCs d|jS)zsReturn repr for the module. The method is deprecated. The import machinery does the job itself. z)r_r)rr$r r r module_reprsz_NamespaceLoader.module_reprcCsdS)NTr r'r r r rsz_NamespaceLoader.is_packagecCsdS)Nrr r'r r r r2sz_NamespaceLoader.get_sourcecCstdddddS)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_modulecCstd|jt||S)zbLoad a namespace module. This method is deprecated. Use exec_module() instead. z&namespace module loaded with path {!r})rrrvr&r'r r r r( sz_NamespaceLoader.load_moduleN) rrrrrrrr2r!r r%r(r r r r rs rc@sveZdZdZeddZeddZeddZedd Zedd d Z edd dZ edddZ eddZ 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)rrfinderr r r 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)rrEhookr r r _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)rrErr r r _path_importer_cache2s  zPathFinder._path_importer_cachecCsRt|dr||\}}n||}g}|dk r.rorN) r_loadersrEr[rGrrW _path_mtimeset _path_cache_relaxed_path_cache)rrEloader_detailsloadersrr rr rs   zFileFinder.__init__cCs d|_dS)zInvalidate the directory mtime.rN)rrKr r r 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)rrrr r r rs zFileFinder.find_loadercCs|||}t||||dS)Nr)r)rrrrEsmslrrr r r 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_namespace tail_modulercache cache_module base_pathror init_filename full_pathrr r r 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 fnr r r r*sz)FileFinder._fill_cache..N)rErr_rWr[PermissionErrorNotADirectoryErrorrrr rrrr_raddr!r) rrEr`lower_suffix_contentsrrr}ronew_namer r r 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)rXrrKrrr r path_hook_for_FileFinder6s z6FileFinder.path_hook..path_hook_for_FileFinderr )rrrr rr path_hook,s zFileFinder.path_hookcCs d|jS)NzFileFinder({!r}))r_rErKr r r r>szFileFinder.__repr__)N)rrrrrrrrrrrrrrrr r r r 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 cpathnamerrr r r _fix_up_moduleDs"     rcCs*tttf}ttf}ttf}|||gS)z_Returns a list of file-based module loaders. Each item is a tuple (loader, suffixes). )rQ_alternative_architecturesrextension_suffixesrbrrkr) extensionssourcebytecoder r r r[src 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|dt t tt|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|dkVqdSrrrr r r r sz_setup..rzimportlib requires posix or ntrr?r6r_pathseps_with_coloncSsh|]}d|qSrr rr r r rsz_setup.._thread_weakrefwinregrrz.pywz_d.pydTN)rrrrr_builtin_from_namerallr,rrBr#rsrrrrrArr ) _bootstrap_module self_module builtin_namebuiltin_module os_details builtin_osr6r? os_module thread_moduleweakref_module winreg_moduler r r _setupfsN                      rcCs2t|t}tjtj|gtjt dS)z)Install the path-based import components.N) rrrrrrr meta_pathrAr)rsupported_loadersr r r _installsr-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.)rrrrrrrrrrrrrrrrcCsF|D]<}tD].\}}||kr|||||Sqq|S)zAdd 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_MAPrrArZ)rrooriginal alternativer r r rs r)r\)N)NNN)rr)T)N)N)Trrrerrqrr _MS_WINDOWSrrrrr6rr,r?rr=rBrr"%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYr!r#r*r0r2rGrNrPrUrVrXr[rltype__code__rr(rr'r-r<rrrrDEBUG_BYTECODE_SUFFIXESOPTIMIZED_BYTECODE_SUFFIXESrrrrrrrrrrrrrrobjectrrrrr)rCrbrkrsrQrtrrrrrrrrrr r r r s            G(  !  D@H-:?*  A