U e5d()@sddlmZmZmZmZmZmZmZmZm Z zddlm Z Wne k rTdZ YnXddl m Z mZmZmZddlmZddlmZddlmZddlZddlZddlZddlZddlZddlZejded d dZd Zd Zd Z d Z!dZ"dZ#dZ$dZ%dZ&ddZ'ddZ(ddZ)d7ddZ*ddZ+ddZ,Gdd d Z-Gd!d"d"Z.Gd#d$d$e.ej/Z0d8d%d&Z1Gd'd(d(e.eZ2d9d)d*Z3d+d,Z4d-d.Z5d:d/d0Z6d1d2Z7d3d4Z8e rd;d5d6Z9ndZ9dS)<) 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)utilzhthe imp module is deprecated in favour of importlib; see the module's documentation for alternative uses) stacklevel cCs t|SN)types ModuleTypenamer"/usr/lib64/python3.8/imp.py new_module0sr$cCstjSr)r MAGIC_NUMBERr"r"r"r# get_magic;sr&cCstjjSr)sysimplementation cache_tagr"r"r"r#get_tagCsr*c Cs6t$tdt||W5QRSQRXdS)Nignore)warningscatch_warnings simplefilterrcache_from_source)pathdebug_overrider"r"r#r/Hs  r/cCs t|Sr)rsource_from_cacher0r"r"r#r2[s r2cCs<ddtjD}ddtjD}ddtjD}|||S)NcSsg|]}|dtfqSrb) C_EXTENSION.0sr"r"r# ksz get_suffixes..cSsg|]}|dtfqS)r) PY_SOURCEr7r"r"r#r:lscSsg|]}|dtfqSr4) PY_COMPILEDr7r"r"r#r:ms)rEXTENSION_SUFFIXESSOURCE_SUFFIXESBYTECODE_SUFFIXES) extensionssourcebytecoder"r"r# get_suffixesisrDc@seZdZddZddZdS) NullImportercCs2|dkrtdddntj|r.td|ddS)Nzempty pathnamer3zexisting directory) ImportErrorosr0isdir)selfr0r"r"r#__init__zs zNullImporter.__init__cCsdSrr")rJfullnamer"r"r# find_moduleszNullImporter.find_moduleN)__name__ __module__ __qualname__rKrMr"r"r"r#rErsrEcs*eZdZdfdd ZfddZZS)_HackedGetDataNcst||||_dSr)superrKfile)rJrLr0rS __class__r"r#rKsz_HackedGetData.__init__c s||jrl||jkrl|jjs0|j}d|jkr0||jjrJt|jd|_}||W5QRSQRXn t|SdS)Nbr5) rSr0closedmodecloseopenreadrRget_data)rJr0rSrTr"r#r\s z_HackedGetData.get_data)N)rNrOrPrKr\ __classcell__r"r"rTr#rQsrQc@s eZdZdS)_LoadSourceCompatibilityNrNrOrPr"r"r"r#r^sr^cCs\t|||}tj|||d}|tjkr8t|tj|}nt|}t|||_ |j |j _ |SN)loader) r^rspec_from_file_locationr'modulesr rrSourceFileLoader __loader____spec__rar!pathnamerSraspecmoduler"r"r# load_sources   rkc@s eZdZdS)_LoadCompiledCompatibilityNr_r"r"r"r#rlsrlcCsZt|||}tj|||d}|tjkr8t|tj|}nt|}t|||_|j|j _ |Sr`) rlrrbr'rcr rrrerfrargr"r"r# load_compileds    rmcCstj|rftjddtjdd}|D]*}tj|d|}tj|r,|}qfq,td |t j ||gd}|t j krt|t j |St|SdS)NrKz{!r} is not a package)submodule_search_locations)rHr0rIrr?r@joinexists ValueErrorformatrrbr'rcr r)r!r0rA extensionZ init_pathrir"r"r# load_packages      rtc Cs$|\}}}|r0|dr d|kr0td|n|dkrX|tthkrXd|}t|n|tkrlt|||S|tkrt|||S|tkrtdk r|dkrt |d}t|||W5QRSQRXn t|||SnN|t krt ||S|t krt |S|tkrt|Sd||}t||ddS)N)r;U+zinvalid file open mode {!r}z.file object required for import (type code {})r5z*Don't know how to import {} (type code {})r ) startswithrqrrr<r=rkrmr6 load_dynamicrZ PKG_DIRECTORYrt C_BUILTIN init_builtin PY_FROZENrrG) r!rSfilenameZdetailssuffixrXtype_msgZ opened_filer"r"r# load_modules.           rc Cst|tstdt|n$t|tdtfsBtdt||dkrt|rbddddtffSt |rzddddt ffSt j }|D]}t j ||}dtjdfD]>}d|}t j ||}t j |rd|ddtffSqtD]2\}}}||} t j || }t j |rq qqq:qtt||dd} d|krnt|d } t| jd} W5QRXt||| d } | ||||ffS) Nz'name' must be a str, not {}z%'path' must be None or a list, not {}rFz.pyrrKr rVr5)encoding) isinstancestr TypeErrorrrtypelist RuntimeErrorrrzr r|r'r0rHrorr@isfileryrDrGr rZtokenizedetect_encodingreadline) r!r0entryZpackage_directoryr~Zpackage_file_nameZ file_pathrXr file_namerrSr"r"r#rMsB     rMcCs t|Sr) importlibreload)rjr"r"r#r2srcCs&z t|WStk r YdSXdSr)rrGr r"r"r#r{=s r{cCs0ddl}|j||}|jj|||d}t|S)Nr)r!raorigin)importlib.machineryrExtensionFileLoader ModuleSpecr)r!r0rSrrarir"r"r#rxJsrx)N)N)N)N)N):_imprrrrrrrr r r rGZimportlib._bootstrapr r rrZimportlib._bootstrap_externalrrrrrHr'rrr,warnDeprecationWarningZ SEARCH_ERRORr<r=r6Z PY_RESOURCEryrzr|ZPY_CODERESOURCEZIMP_HOOKr$r&r*r/r2rDrErQrdr^rkrlrmrtrrMrr{rxr"r"r"r# s`,         # 4