o ƒ_¶aX ã@sddZddlZddlZddlZddlmZdZdZdZ dZ dZ d d „Z dd d „Z dd d„Zdd„ZdS)zX Re-implementation of find_module and get_frozen_object from the deprecated imp module. éNé)Úmodule_from_specéééécCs(t|tƒr tj ¡jntjj}|||ƒS©N)Ú isinstanceÚlistÚ importlibÚ machineryÚ PathFinderÚ find_specÚutil)ÚmoduleÚpathsÚfinder©rú1/usr/lib/python3/dist-packages/setuptools/_imp.pyrs ÿý rc CsJt||ƒ}|durtd|ƒ‚|jst|dƒrtj d|j¡}d}d}t|jt ƒ}|j dks8|rAt |jtj j ƒrAt}d}d}}n\|j dksP|rYt |jtj jƒrYt}d}d}}nD|jr—|j }tj |¡d }|tj jvrod nd }|tj jvrzt}n|tj jvrƒt}n|tj jvr‹t}|tthvr–t||ƒ}nd}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ÚfileÚstaticr)ÚsuffixÚmoderrrÚ find_modulesH    ÿ  ÿ      €r8cCs&t||ƒ}|s td|ƒ‚|j |¡S©Nr)rrr Úget_code)rrr2rrrÚget_frozen_objectGs   r;cCs"t||ƒ}|s td|ƒ‚t|ƒSr9)rrr)rrÚinfor2rrrÚ get_moduleNs  r=r)Ú__doc__r(Úimportlib.utilr Úimportlib.machineryÚ py34compatrr,r.r0r'r%rr8r;r=rrrrÚs  *