U e5dܚ@sdaddZddZiZiZGdddeZGdddZGd d d ZGd d d Z d dZ ddZ ddZ ddddZ ddZddZddZddZGdd d Zddd!d"d#Zd]d$d%Zd&d'd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5ZGd6d7d7ZGd8d9d9ZGd:d;d;Zdd?Z d^d@dAZ!dBdCZ"dDZ#e#dEZ$dFdGZ%e&Z'dHdIZ(d_dKdLZ)d&dMdNdOZ*dPdQZ+d`dSdTZ,dUdVZ-dWdXZ.dYdZZ/d[d\Z0dS)aNcCs8dD] }t||rt||t||q|j|jdS)N) __module____name__ __qualname____doc__)hasattrsetattrgetattr__dict__update)newoldreplacer ,/usr/lib64/python3.8/importlib/_bootstrap.py_wraps rcCs tt|SN)typesysnamer r r _new_module#src@s eZdZdS)_DeadlockErrorN)rrrr r r rr0src@s4eZdZddZddZddZddZd d Zd S) _ModuleLockcCs0t|_t|_||_d|_d|_d|_dSN)_thread allocate_locklockwakeuprownercountwaitersselfrr r r__init__:s   z_ModuleLock.__init__cCs<t}|j}t|}|dkr$dS|j}||krdSqdS)NFT)r get_identr _blocking_onget)r"metidrr r r has_deadlockBs z_ModuleLock.has_deadlockc Cst}|t|<z|jn|jdks.|j|krT||_|jd7_W5QRWVdS|rhtd||j dr|j d7_ W5QRX|j |j qW5t|=XdS)NrTzdeadlock detected by %rF) rr$r%rrrr)rracquirer releaser"r(r r rr+Ns   z_ModuleLock.acquirec Cslt}|jT|j|kr"td|jd8_|jdkr^d|_|jr^|jd8_|jW5QRXdS)Ncannot release un-acquired lockr*r) rr$rr RuntimeErrorrr rr,r-r r rr,gs  z_ModuleLock.releasecCsd|jt|S)Nz_ModuleLock({!r}) at {}formatridr"r r r__repr__tsz_ModuleLock.__repr__N)rrrr#r)r+r,r4r r r rr4s   rc@s,eZdZddZddZddZddZd S) _DummyModuleLockcCs||_d|_dSr)rrr!r r rr#|sz_DummyModuleLock.__init__cCs|jd7_dS)Nr*T)rr3r r rr+sz_DummyModuleLock.acquirecCs$|jdkrtd|jd8_dS)Nrr.r*)rr/r3r r rr,s z_DummyModuleLock.releasecCsd|jt|S)Nz_DummyModuleLock({!r}) at {}r0r3r r rr4sz_DummyModuleLock.__repr__N)rrrr#r+r,r4r r r rr5xsr5c@s$eZdZddZddZddZdS)_ModuleLockManagercCs||_d|_dSr)_name_lockr!r r rr#sz_ModuleLockManager.__init__cCst|j|_|jdSr)_get_module_lockr7r8r+r3r r r __enter__s z_ModuleLockManager.__enter__cOs|jdSr)r8r,)r"argskwargsr r r__exit__sz_ModuleLockManager.__exit__N)rrrr#r:r=r r r rr6sr6cCstzjzt|}Wntk r0d}YnX|dkrptdkrLt|}nt|}|fdd}t ||t|<W5tX|S)NcSs0tzt||krt|=W5tXdSr)_imp acquire_lock release_lock _module_locksr&)refrr r rcbs  z_get_module_lock..cb) r>r?r@rAKeyErrorrr5r_weakrefrB)rrrCr r rr9s    r9cCs6t|}z |Wntk r(Yn X|dSr)r9r+rr,)rrr r r_lock_unlock_modules  rFcOs |||Srr )fr;kwdsr r r_call_with_frames_removedsrIr*) verbositycGs6tjj|kr2|dsd|}t|j|tjddS)N)#zimport z# )file)rflagsverbose startswithprintr1stderr)messagerJr;r r r_verbose_messages  rScsfdd}t||S)Ncs&|tjkrtd||d||SNz{!r} is not a built-in moduler)rbuiltin_module_names ImportErrorr1r"fullnamefxnr r_requires_builtin_wrappers   z4_requires_builtin.._requires_builtin_wrapperr)rZr[r rYr_requires_builtins  r]csfdd}t||S)Ncs&t|std||d||SNz{!r} is not a frozen moduler)r> is_frozenrVr1rWrYr r_requires_frozen_wrappers   z2_requires_frozen.._requires_frozen_wrapperr\)rZr`r rYr_requires_frozens  racCs>t||}|tjkr2tj|}t||tj|St|SdSr)spec_from_loaderrmodules_exec_load)r"rXspecmoduler r r_load_module_shims      rhcCst|dd}t|dr8z ||WStk r6YnXz |j}Wntk rVYnX|dk rht|Sz |j}Wntk rd}YnXz |j}Wn:tk r|dkrd |YSd ||YSYnXd ||SdS)N __loader__ module_repr? ) rrrj Exception__spec__AttributeError_module_repr_from_specr__file__r1)rgloaderrfrfilenamer r r _module_repr s.       rvc@sneZdZddddddZddZddZed d Zejd d Zed d Z eddZ e jddZ dS) ModuleSpecN)origin loader_state is_packagecCs6||_||_||_||_|r gnd|_d|_d|_dSNF)rrtrxrysubmodule_search_locations _set_fileattr_cached)r"rrtrxryrzr r rr#VszModuleSpec.__init__cCsfd|jd|jg}|jdk r4|d|j|jdk rP|d|jd|jjd|S)Nz name={!r}z loader={!r}z origin={!r}zsubmodule_search_locations={}z{}({})z, ) r1rrtrxappendr| __class__rjoin)r"r;r r rr4bs    zModuleSpec.__repr__cCsj|j}zH|j|jkoL|j|jkoL|j|jkoL||jkoL|j|jkoL|j|jkWStk rdYdSXdSr{)r|rrtrxcached has_locationrq)r"othersmslr r r__eq__ls     zModuleSpec.__eq__cCs:|jdkr4|jdk r4|jr4tdkr&tt|j|_|jSr)r~rxr}_bootstrap_externalNotImplementedError _get_cachedr3r r rrxs  zModuleSpec.cachedcCs ||_dSr)r~)r"rr r rrscCs$|jdkr|jddS|jSdS)N.r)r|r rpartitionr3r r rparents zModuleSpec.parentcCs|jSr)r}r3r r rrszModuleSpec.has_locationcCst||_dSr)boolr})r"valuer r rrs) rrrr#r4rpropertyrsetterrrr r r rrw1s%       rwrxrzcCst|drJtdkrttj}|dkr0|||dS|r8gnd}||||dS|dkrt|drz||}Wqtk rd}YqXnd}t||||dS)N get_filename)rt)rtr|rzFr)rrrspec_from_file_locationrzrVrw)rrtrxrzrsearchr r rrbs$     rbcCs8z |j}Wntk rYnX|dk r,|S|j}|dkrZz |j}Wntk rXYnXz |j}Wntk r|d}YnX|dkr|dkrz |j}Wqtk rd}YqXn|}z |j}Wntk rd}YnXzt|j}Wntk rd}YnXt |||d}|dkr"dnd|_ ||_ ||_ |S)NrxFT) rprqrrirs_ORIGIN __cached__list__path__rwr}rr|)rgrtrxrfrlocationrr|r r r_spec_from_modulesH         rFoverridecCs|st|dddkr6z |j|_Wntk r4YnX|sJt|dddkr|j}|dkr|jdk rtdkrnttj}| |}|j|_ ||_d|_ z ||_ Wntk rYnX|st|dddkrz |j |_Wntk rYnXz ||_Wntk rYnX|s"t|dddkrR|jdk rRz |j|_Wntk rPYnX|jr|srt|dddkrz |j|_ Wntk rYnX|st|dddkr|jdk rz |j|_Wntk rYnX|S)Nrri __package__rrsr)rrrrqrtr|rr_NamespaceLoader__new___pathrsrirrrprrrxrr)rfrgrrtrr r r_init_module_attrss`            rcCsRd}t|jdr|j|}nt|jdr2td|dkrDt|j}t|||S)N create_module exec_modulezBloaders that define exec_module() must also define create_module())rrtrrVrrrrfrgr r rmodule_from_spec%s    rcCsj|jdkrdn|j}|jdkrB|jdkr2d|Sd||jSn$|jrVd||jSd|j|jSdS)Nrkrlrmrn)rrxrtr1r)rfrr r rrr6s   rrc Cs|j}t|tj||k r6d|}t||dzj|jdkrj|j dkrZtd|jdt ||ddn4t ||ddt |jds|j |n |j |W5tj|j}|tj|j<XW5QRX|S)Nzmodule {!r} not in sys.modulesrmissing loaderTrr)rr6rrcr&r1rVpoprtr|rr load_moduler)rfrgrmsgr r rrdGs"      rdcCsz|j|jWn4|jtjkr@tj|j}|tj|j<YnXtj|j}|tj|j<t|dddkrz |j|_Wntk rYnXt|dddkrz(|j |_ t |ds|j dd|_ Wntk rYnXt|dddkrz ||_ Wntk rYnX|S)Nrirrrrrp)rtrrrrcrrrirqrrrrrprr r r_load_backward_compatiblees6      rc Cs|jdk rt|jdst|St|}d|_z|tj|j<z4|jdkr`|jdkrlt d|jdn |j |Wn2ztj|j=Wnt k rYnXYnXtj |j}|tj|j<t d|j|jW5d|_X|S)NrTFrrzimport {!r} # {!r})rtrrr _initializingrrcrr|rVrrDrrSrr r r_load_unlockeds.      rc Cs*t|jt|W5QRSQRXdSr)r6rr)rfr r rres rec@seZdZeddZedddZedddZedd Zed d Z ee d d Z ee ddZ ee ddZ eeZdS)BuiltinImportercCs d|jS)Nz)r1r)rgr r rrjszBuiltinImporter.module_reprNcCs,|dk r dSt|r$t||ddSdSdS)Nzbuilt-inr)r> is_builtinrbclsrXpathtargetr r r find_specs  zBuiltinImporter.find_speccCs|||}|dk r|jSdSr)rrt)rrXrrfr r r find_modules zBuiltinImporter.find_modulecCs.|jtjkr"td|j|jdttj|SrT)rrrUrVr1rIr>create_builtin)r"rfr r rrs   zBuiltinImporter.create_modulecCsttj|dSr)rIr> exec_builtin)r"rgr r rrszBuiltinImporter.exec_modulecCsdSrr rrXr r rget_codeszBuiltinImporter.get_codecCsdSrr rr r r get_sourceszBuiltinImporter.get_sourcecCsdSr{r rr r rrzszBuiltinImporter.is_package)NN)N)rrr staticmethodrj classmethodrrrrr]rrrzrhrr r r rrs(         rc@seZdZdZeddZedddZedddZed d Z ed d Z ed dZ ee ddZ ee ddZee ddZdS)FrozenImporterfrozencCsd|jtjS)Nr)r1rrr)mr r rrjszFrozenImporter.module_reprNcCs"t|rt|||jdSdSdS)Nr)r>r_rbrrr r rr s zFrozenImporter.find_speccCst|r|SdSr)r>r_)rrXrr r rr'szFrozenImporter.find_modulecCsdSrr )rrfr r rr0szFrozenImporter.create_modulecCs@|jj}t|s$td||dttj|}t||j dSr^) rprr>r_rVr1rIget_frozen_objectexecr)rgrcoder r rr4s   zFrozenImporter.exec_modulecCs t||Sr)rhrr r rr=szFrozenImporter.load_modulecCs t|Sr)r>rrr r rrFszFrozenImporter.get_codecCsdSrr rr r rrLszFrozenImporter.get_sourcecCs t|Sr)r>is_frozen_packagerr r rrzRszFrozenImporter.is_package)NN)N)rrrrrrjrrrrrrrarrrzr r r rr s,         rc@seZdZddZddZdS)_ImportLockContextcCs tdSr)r>r?r3r r rr:_sz_ImportLockContext.__enter__cCs tdSr)r>r@)r"exc_type exc_value exc_tracebackr r rr=csz_ImportLockContext.__exit__N)rrrr:r=r r r rr[srcCs@|d|d}t||kr$td|d}|r= 0z__package__ not set to a stringz6attempted relative import with no known parent packagezEmpty module name) isinstancestr TypeErrorr1rrrVrrrr r r _sanity_checks    rzNo module named z{!r}cCsd}|dd}|r|tjkr*t|||tjkr>tj|Stj|}z |j}Wn2tk rtd||}t||ddYnXt ||}|dkrtt||dnt |}|rtj|}t ||dd||S)Nrrz; {!r} is not a packager) rrrcrIrrq_ERR_MSGr1ModuleNotFoundErrorrrr)rimport_rr parent_modulerrfrgr r r_find_and_load_unlockeds*        rc Csjt|2tj|t}|tkr6t||W5QRSW5QRX|dkr^d|}t||dt||S)Nz(import of {} halted; None in sys.modulesr) r6rrcr&_NEEDS_LOADINGrr1rrF)rrrgrRr r r_find_and_loads   rrcCs*t||||dkr t|||}t|tSr)rrr _gcd_importrr r rrs  r recursivec Cs|D]}t|tsB|r"|jd}nd}td|dt|jq|dkrl|st|drt||j|ddqt||sd |j|}zt ||Wqt k r}z*|j |krt j |tdk rWYqW5d}~XYqXq|S) Nz.__all__z ``from list''zItem in z must be str, not *__all__Trr)rrrrrr_handle_fromlistrr1rIrrrrcr&r)rgfromlistrrxwhere from_nameexcr r rrs,      rcCs|d}|d}|dk rR|dk rN||jkrNtjd|d|jdtdd|S|dk r`|jStjdtdd|d }d |kr|d d }|S) Nrrpz __package__ != __spec__.parent (z != )) stacklevelzYcan't resolve package from __spec__ or __package__, falling back on __name__ and __path__rrrr)r&rrrrr)globalsrrfr r r_calc___package__s&  rr c Cs|dkrt|}n$|dk r|ni}t|}t|||}|s|dkrTt|ddS|s\|St|t|dd}tj|jdt|j|Snt|drt||tS|SdS)Nrrr) rr partitionrrrcrrr) rrlocalsrrrgglobals_rcut_offr r r __import__9s      rcCs&t|}|dkrtd|t|S)Nzno built-in module named )rrrVr)rrfr r r_builtin_from_name^s  rc Cs|a|att}tjD]H\}}t||r|tjkrrrrcitemsrrUrr_rrrrrr) sys_module _imp_module module_typerrgrtrf self_module builtin_namebuiltin_moduler r r_setupes$          rcCs&t||tjttjtdSr)rrrrrr)rrr r r_installs  rcCs ddl}|a|tjtdSr)_frozen_importlib_externalrrrrcr)rr r r_install_external_importerssr)NN)N)Nr)NNr r)1rrrrAr%r/rrr5r6r9rFrIrSr]rarhrvrwrbrrrrrrdrrrerrrrrrr_ERR_MSG_PREFIXrrobjectrrrrrrrrrrr r r rs\D%   $e -H%*IO   / % %#