ó {G_Tc@sÒddlZddlZddlZddlZddlmZdZdZdZdZ dZ edZ e ed d ƒZ e e d d ƒZe eed d ƒZe e eed d ƒZe eed d ƒZe e ed d ƒZe e eed d ƒZd Zd dd „ƒYZdefd„ƒYZdefd„ƒYZddd„ƒYZdd d„ƒYZdd!d„ƒYZdejfd„ƒYZdefd„ƒYZd„ZedkrÎeƒndS("iÿÿÿÿN(t test_supportsHdef get_name(): return __name__ def get_file(): return __file__ s import sub sfrom . import sub sfrom .... import sub s'from __future__ import absolute_import sreloaded = True stexecs !!!_test_!!!t TestImportercBsÇeZi eefd6eefd6eefd6eefd6eefd6eefd6eefd6eefd6ee fd6eefd 6eefd 6Z e d „Z d „Z dd „Zd„ZRS(thooktestmodulethooktestpackageshooktestpackage.subshooktestpackage.sub.subbershooktestpackage.oldabsshooktestpackage.newabsshooktestpackage.newrels!hooktestpackage.sub.subber.subestshooktestpackage.futreltsubt reloadmodulecCs"|tkrt‚n||_dS(N(t test_patht ImportErrortpath(tselfR ((s1/usr/local/lib/python2.7/test/test_importhooks.pyt__init__4s  cCs t‚dS(N(tNotImplementedError(R ((s1/usr/local/lib/python2.7/test/test_importhooks.pyt _get__path__;scCs||jkr|SdSdS(N(tmodulestNone(R tfullnameR ((s1/usr/local/lib/python2.7/test/test_importhooks.pyt find_module>scBst|j|\}}ejj|ej|ƒƒ}d|jj|_||_|re|j ƒ|_ n||j U|S(Ns<%s>( Rtsyst setdefaulttimpt new_modulet __class__t__name__t__file__t __loader__R t__path__t__dict__(R Rtispkgtcodetmod((s1/usr/local/lib/python2.7/test/test_importhooks.pyt load_moduleDs  N(Rt __module__tFalsettest_cotTruettest2_oldabs_cottest2_newabs_cottest2_newrel_cottest2_deeprel_cottest2_futrel_coRRR R RRR(((s1/usr/local/lib/python2.7/test/test_importhooks.pyR$s              t MetaImportercBseZd„ZRS(cCsgS(N((R ((s1/usr/local/lib/python2.7/test/test_importhooks.pyR Ps(RR R (((s1/usr/local/lib/python2.7/test/test_importhooks.pyR)Ost PathImportercBseZd„ZRS(cCs |jgS(N(R (R ((s1/usr/local/lib/python2.7/test/test_importhooks.pyR Ts(RR R (((s1/usr/local/lib/python2.7/test/test_importhooks.pyR*Sst ImportBlockercBs,eZdZd„Zdd„Zd„ZRS(s‘Place an ImportBlocker instance on sys.meta_path and you can be sure the modules you specified can't be imported, even if it's a builtin.cGstj|ƒ|_dS(N(tdicttfromkeyst namestoblock(R R.((s1/usr/local/lib/python2.7/test/test_importhooks.pyR \scCs||jkr|SdS(N(R.R(R RR ((s1/usr/local/lib/python2.7/test/test_importhooks.pyR^scCs td‚dS(Ns I dare you(R(R R((s1/usr/local/lib/python2.7/test/test_importhooks.pyRbsN(RR t__doc__R RRR(((s1/usr/local/lib/python2.7/test/test_importhooks.pyR+Xs  t ImpWrappercBs eZdd„Zdd„ZRS(cCs5|dk r(tjj|ƒ r(t‚n||_dS(N(RtosR tisdirR(R R ((s1/usr/local/lib/python2.7/test/test_importhooks.pyR hs cCsš|jdƒd}||kr2|jdkr2dS|jdkrJd}n |jg}ytj||ƒ\}}}Wntk r‰dSXt|||ƒS(Nt.iÿÿÿÿ(tsplitR RRRRt ImpLoader(R RR tsubnametfiletfilenametstuff((s1/usr/local/lib/python2.7/test/test_importhooks.pyRms   N(RR RR R(((s1/usr/local/lib/python2.7/test/test_importhooks.pyR0fs R5cBseZd„Zd„ZRS(cCs||_||_||_dS(N(R7R8R9(R R7R8R9((s1/usr/local/lib/python2.7/test/test_importhooks.pyR ~s  cCsGtj||j|j|jƒ}|jr:|jjƒn||_|S(N(RRR7R8R9tcloseR(R RR((s1/usr/local/lib/python2.7/test/test_importhooks.pyRƒs !  (RR R R(((s1/usr/local/lib/python2.7/test/test_importhooks.pyR5|s tImportHooksBaseTestCasecBseZd„Zd„ZRS(cCsJtj|_tj|_tj|_tjjƒtjjƒ|_dS(N( RR t meta_patht path_hookstpath_importer_cachetclearRtcopytmodules_before(R ((s1/usr/local/lib/python2.7/test/test_importhooks.pytsetUps     cCsX|jtj(|jtj(|jtj(tjjƒtjjƒtjj|jƒdS(N( R RR<R=R>R?RtupdateRA(R ((s1/usr/local/lib/python2.7/test/test_importhooks.pyttearDown”s      (RR RBRD(((s1/usr/local/lib/python2.7/test/test_importhooks.pyR;‹s tImportHooksTestCasecBs8eZdd„Zd„Zd„Zd„Zd„ZRS(cCs¶ddl}ddl}ddl}ddl}|j|jƒdƒ|j|jƒdƒ|j|jjƒdƒ|j|jjjƒdƒ|rï|j|j|ƒ|j|j|ƒ|j|jj|ƒ|j|jjj|ƒnt t ft j ds<    +^