a „oe� ã@sddZddlZddlZddlZddlmZdZdZdZdZ dZ d d „Z dd d „Z dd d„Z dd„ZdS)zX Re-implementation of find_module and get_frozen_object from the deprecated imp module. éN)Úmodule_from_specééééécCs(t|tƒrtj ¡jntjj}|||ƒS)N)Ú isinstanceÚlistÚ importlibÚ machineryÚ PathFinderÚ find_specÚutil)ÚmoduleÚpathsÚfinder©rú0C:\Program Files\Certbot\pkgs\setuptools\_imp.pyr s ÿýr c CsRt||ƒ}|durtd|ƒ‚|js>t|dƒr>tj d|j¡}d}d}t|jt ƒ}|j dksp|r‚t |jtj j ƒr‚t}d}d}}nÀ|j dks |r²t |jtj jƒr²t}d}d}}n�|j�r6|j }tj |¡d }|tj jvràd nd }|tj jvröt}n&|tj jv�r t}n|tj jv�rt}|tthv�rBt||ƒ}n d}d}}|||||ffS) z7Just like 'imp.find_module()', but with package supportNú Can't find %sÚsubmodule_search_locationsz __init__.pyéÿÿÿÿÚfrozenÚzbuilt-inrÚrÚrb)r Ú ImportErrorÚ has_locationÚhasattrr rÚspec_from_loaderÚloaderrÚtypeÚoriginÚ issubclassr ÚFrozenImporterÚ PY_FROZENÚBuiltinImporterÚ C_BUILTINÚosÚpathÚsplitextÚSOURCE_SUFFIXESÚ PY_SOURCEÚBYTECODE_SUFFIXESÚ PY_COMPILEDÚEXTENSION_SUFFIXESÚ C_EXTENSIONÚopen) rrÚspecÚkindÚfileZstaticr(ÚsuffixÚmoderrrÚ find_modulesR   ÿþý ÿþý   r6cCs&t||ƒ}|std|ƒ‚|j |¡S©Nr)r rrÚget_code)rrr1rrrÚget_frozen_objectMs  r9cCs"t||ƒ}|std|ƒ‚t|ƒSr7)r rr)rrÚinfor1rrrÚ get_moduleTs  r;)N)N)Ú__doc__r'Úimportlib.utilr Úimportlib.machineryrr+r-r/r&r$r r6r9r;rrrrÚs  0