o ?Og_)@sdZddlmZmZmZmZmZmZmZm Z m Z zddlm Z Wn e y+dZ Ynwddl mZmZmZmZddlmZddlmZddlmZddlZddlZddlZddlZddlZddlZejd ed d dZd Zd Z d Z!dZ"dZ#dZ$dZ%dZ&dZ'ddZ(ddZ)ddZ*d8ddZ+ddZ,ddZ-Gd d!d!Z.Gd"d#d#Z/Gd$d%d%e/ej0Z1d8d&d'Z2Gd(d)d)e/eZ3d8d*d+Z4d,d-Z5d.d/Z6d8d0d1Z7d2d3Z8d4d5Z9e rd8d6d7Z:dSdZ:dS)9zThis module provides the components needed to build your own __import__ function. Undocumented functions are obsolete. In most cases it is preferred you consider using the importlib module's functionality over this module. ) lock_held acquire_lock release_lockget_frozen_objectis_frozen_package init_frozen is_builtin is_frozen_fix_co_filename)create_dynamicN)_ERR_MSG_exec_load_builtin_from_name)SourcelessFileLoader) machinery)utilzthe imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses) stacklevel cC t|S)z_**DEPRECATED** Create a new module. The module is not entered into sys.modules. )types ModuleTypenamer"*/opt/alt/python310/lib64/python3.10/imp.py new_module1 r$cCstjS)z@**DEPRECATED** Return the magic number for .pyc files. )r MAGIC_NUMBERr"r"r"r# get_magic<sr'cCstjjS)z$Return the magic tag for .pyc files.)sysimplementation cache_tagr"r"r"r#get_tagDsr+cCsBttdt||WdS1swYdS)a**DEPRECATED** 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. If debug_override is not None, then it must be a boolean and is used in place of sys.flags.optimize. If sys.implementation.cache_tag is None then NotImplementedError is raised. ignoreN)warningscatch_warnings simplefilterrcache_from_source)pathdebug_overrider"r"r#r0Is   $r0cCr)a~**DEPRECATED** Given 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 format, ValueError will be raised. If sys.implementation.cache_tag is None then NotImplementedError is raised. )rsource_from_cacher1r"r"r#r3\s r3cCs<ddtjD}ddtjD}ddtjD}|||S)**DEPRECATED**cSg|]}|dtfqSrb) C_EXTENSION.0sr"r"r# lz get_suffixes..cSr6)r) PY_SOURCEr:r"r"r#r=mr>cSr6r7) PY_COMPILEDr:r"r"r#r=nr>)rEXTENSION_SUFFIXESSOURCE_SUFFIXESBYTECODE_SUFFIXES) extensionssourcebytecoder"r"r# get_suffixesjs rHc@s eZdZdZddZddZdS) NullImporterz-**DEPRECATED** Null import object. cCs0|dkr tdddtj|rtd|ddS)Nzempty pathnamer4zexisting directory) ImportErrorosr1isdir)selfr1r"r"r#__init__{s    zNullImporter.__init__cCsdS)zAlways returns None.Nr")rNfullnamer"r"r# find_moduleszNullImporter.find_moduleN)__name__ __module__ __qualname____doc__rOrQr"r"r"r#rIss rIcs.eZdZdZdfdd ZfddZZS)_HackedGetDatazMCompatibility support for 'file' arguments of various load_*() functions.Ncst||||_dSN)superrOfile)rNrPr1rY __class__r"r#rOs z_HackedGetData.__init__cs|jr=||jkr=|jjs|j}d|jvr||jjr%t|jd|_}| |WdS1s6wYdSt|S)z;Gross hack to contort loader to deal w/ load_*()'s bad API.br8N) rYr1closedmodecloseopenreadrXget_data)rNr1rYrZr"r#rbs $ z_HackedGetData.get_datarW)rRrSrTrUrOrb __classcell__r"r"rZr#rVsrVc@eZdZdZdS)_LoadSourceCompatibilityz5Compatibility support for implementing load_source().NrRrSrTrUr"r"r"r#rerecCs\t|||}tj|||d}|tjvrt|tj|}nt|}t|||_ |j |j _ |S)Nloader) rerspec_from_file_locationr(modulesr rrSourceFileLoader __loader____spec__rir!pathnamerYrispecmoduler"r"r# load_sources   rsc@rd)_LoadCompiledCompatibilityz7Compatibility support for implementing load_compiled().Nrfr"r"r"r#rtrgrtcCsZt|||}tj|||d}|tjvrt|tj|}nt|}t|||_|j|j _ |S)r5rh) rtrrjr(rkr rrrmrnriror"r"r# load_compileds    rucCstj|r3tjddtjdd}|D]}tj|d|}tj|r+|}nqtd |t j ||gd}|t j vrHt|t j |St|S)r5NrOz{!r} is not a package)submodule_search_locations)rLr1rMrrCrDjoinexists ValueErrorformatrrjr(rkr r)r!r1rE extensionZ init_pathrqr"r"r# load_packages"     r|c Cs$|\}}}|r|drd|vrtd||dur*|tthvr*d|}t||tkr4t|||S|tkr>t|||S|tkrmtdurm|durgt |d}t|||WdS1s`wYdSt|||S|t krvt ||S|t kr~t |S|tkrt|Sd||}t||d) z**DEPRECATED** Load a module, given information returned by find_module(). The module name must include the full package name, if any. )r?U+zinvalid file open mode {!r}Nz.file object required for import (type code {})r8z*Don't know how to import {} (type code {})r ) startswithryrzr@rArsrur9 load_dynamicr` PKG_DIRECTORYr| C_BUILTIN init_builtin PY_FROZENrrK) r!rYfilenameZdetailssuffixr^type_msgZ opened_filer"r"r# load_modules0      $    rc Cst|tstdt|t|tdtfs tdt||dur?t|r0ddddtffSt |rs   rcCs0ddl}|j||}|jj|||d}t|S)z:**DEPRECATED** Load an extension module. rN)r!riorigin)importlib.machineryrExtensionFileLoader ModuleSpecr)r!r1rYrrirqr"r"r#rKs rrW);rU_imprrrrrrrr r r rKZimportlib._bootstrapr r rrZimportlib._bootstrap_externalrrrrrLr(rrr-warnDeprecationWarningZ SEARCH_ERRORr@rAr9Z PY_RESOURCErrrZPY_CODERESOURCEZIMP_HOOKr$r'r+r0r3rHrIrVrlrersrtrur|rrQrrrr"r"r"r#sd,          #4