+
    Bi`                        ^ RI Ht ^ RIHt ^ RIHt ^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt  ! R	 R
]P,                  4      t ! R R]P,                  4      t ! R R]P,                  4      t ! R R]P,                  4      t ! R R]P,                  4      tR t]R8X  d   ]P<                  ! 4        R# R# )    )Path)unload)check_warningsN)spec_from_file_location)DirsOnSysPath)FakePath)uncachec                   h   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tRtV tR# )PkgutilTestsc                    \         P                  ! 4       V n        V P                  \        P
                  V P                  4       \        P                  P                  ^ V P                  4       R# r   N)	tempfilemkdtempdirname
addCleanupshutilrmtreesyspathinsertselfs   &(/usr/lib/python3.14/test/test_pkgutil.pysetUpPkgutilTests.setUp   s>    '')t||44<<(    c                (    \         P                  ^  R# r   )r   r   r   s   &r   tearDownPkgutilTests.tearDown    s    HHQKr   c                Z   R pRp\         P                  P                  V P                  V4      p\         P                  ! V4       \        \         P                  P                  VR4      R4      pVP                  4        \        \         P                  P                  VR4      R4      pVP                  V4       VP                  4        \         P                  ! \         P                  P                  VR4      4       \        \         P                  P                  VRR4      R4      pVP                  V4       VP                  4        \        P                  ! VR4      pV P                  WR4       \        P                  ! VR4      pV P                  Wb4       \        P                  V R# )test_getdata_filesys%   Hello, world!
Second line
Third line__init__.pywbres.txtsubsub/res.txtN)osr   joinr   mkdiropenclosewritepkgutilget_dataassertEqualr   modules)r   pkgRESOURCE_DATApackage_dirfres1res2s   &      r   r!   !PkgutilTests.test_getdata_filesys#   s$   $ D ggll4<<5
k=94@		k95t<			
k512k5)<dC			 Y/-]3-KKr   c                J   R pRpRp\         P                  P                  V P                  V4      p\        P
                  ! VR4      pVP                  VR,           R4       VP                  VR,           V4       VP                  VR,           V4       VP                  4        \        P                  P                  ^ V4       \        P                  ! VR4      pV P                  Wc4       \        P                  ! VR	4      pV P                  Ws4       . p\        P                  ! V.4       F>  p	V P                  V	\        P                  4       VP!                  V	P"                  4       K@  	  V P                  VR.4       \        P                  ^  \        P$                  V R
# )test_getdata_zipfile.ziptest_getdata_zipfiler"   w/__init__.py /res.txtz/sub/res.txtr%   r'   N)r(   r   r)   r   zipfileZipFilewritestrr,   r   r   r.   r/   r0   iter_modulesassertIsInstance
ModuleInfoappendnamer1   )
r   zipr2   r3   zip_filezr6   r7   names
moduleinfos
   &         r   r;   !PkgutilTests.test_getdata_zipfile@   sE   ($ D 77<<c2OOHc* 	


3',	

3#]3	

3'7		 	8$Y/-]3-!..z:J!!*g.@.@ALL) ; 	!7 89HHQKKKr   c                   R pRpRp\         P                  P                  V P                  V4      p\        P
                  ! VR4      pVP                  VR,           R4       VP                  VR,           V4       VP                  4        \        P                  P                  ^ V4        \        P                  ! VR4      pV P                  Wc4       . p\        P                  ! \        V4      .4       F>  pV P                  V\        P                   4       VP#                  VP$                  4       K@  	  V P                  Wr.4       \        P                  ^  \        P&                  P)                  VR4       R	p	V P+                  \,        V	4      ;_uu_ 4        \/        \        P                  ! R
4      4       RRR4       R#   \        P                  ^  \        P&                  P)                  TR4       i ; i  + '       g   i     R# ; i)r:   r;   r"   r<   r=   r>   r?   r%   Nz9path must be None or list of paths to look for modules ininvalid_path)r(   r   r)   r   r@   rA   rB   r,   r   r   r.   r/   r0   rC   r   rD   rE   rF   rG   r1   popassertRaisesRegex
ValueErrorlist)
r   rH   r2   r3   rI   rJ   resrK   rL   expected_msgs
   &         r   test_issue44061_iter_modules)PkgutilTests.test_issue44061_iter_modulesc   s   ($ D 77<<c2OOHc* 	


3',	

3#]3		 	8$	'""3	2CS0 E%22HX4F3GH
%%j'2D2DEZ__- I UE*KKOOC& S##J==%%n56 >= KKOOC& >==s   +BG  G:3G7:H	c                @   R p\         P                  P                  V P                  V4      p\         P                  ! V^ 4       V P                  \         P                  V4       \        P                  ! V P                  .R7       F  pV P                  R4       K  	  R# )unreadable_package)r   zunexpected package foundN)
r(   r   r)   r   r*   r   rmdirr.   walk_packagesfail)r   package_namedts   &   r   test_unreadable_dir_on_syspath+PkgutilTests.test_unreadable_dir_on_syspath   sh    +GGLL|4 	A!$&&T\\N;AII01 <r   c                   R p\         P                  P                  V P                  V4      p\         P                  ! V4       \        \         P                  P                  VR4      R4      pVP                  4        \         P                  ! \         P                  P                  VR4      4       \        \         P                  P                  VRR4      R4      pVP                  4        \        \         P                  P                  VRR4      R4      pVP                  4        Rp\         P                  P                  V P                  V4      p\         P                  ! V4       \        \         P                  P                  VR4      R4      pVP                  4        \         P                  ! \         P                  P                  VR 4      4       \        \         P                  P                  VR R4      R4      pVP                  4        \        \         P                  P                  VR R4      R4      pVP                  4        . ROp\        P                  ! V P                  .4       Uu. uF  qw^,          NK  	  ppV P                  W4       V F-  p	V	P                  R4      '       d   K  \        P                  V	 K/  	  R# u upi )test_walkpackages_filesysr#   r$   r&   zmod.pymodN)r&   zsub.test_walkpackages_filesysz!sub.test_walkpackages_filesys.modrc   ztest_walkpackages_filesys.subz!test_walkpackages_filesys.sub.mod)r(   r   r)   r   r*   r+   r,   r.   r[   r0   endswithr   r1   )
r   pkg1pkg1_dirr5   pkg2pkg2_direxpectedeactualr2   s
   &         r   rc   &PkgutilTests.test_walkpackages_filesys   s   *77<<d3
h6=		
h./h}=tD		hx8$?		 77<<d3
h6=		
h(CDEh(C]SUYZ		h(CXNPTU		
  '44dll^DED!1DE*C||E""C   Fs   4Kc                   RpRpRp\         P                  P                  V P                  V4      p\        P
                  ! VR4      pVP                  VR,           R4       VP                  VR,           V,           R,           R4       VP                  VR,           V,           R,           R4       VP                  VR,           R4       VP                  VR,           V,           R,           R4       VP                  VR,           V,           R,           R4       VP                  4        \        P                  P                  ^ V4       . ROp\        P                  ! V.4       Uu. uF  qw^,          NK  	  ppV P                  W4       \        P                  ^  V F-  p	V	P                  R	4      '       d   K  \        P                  V	 K/  	  R
# u upi )zBTests the same as test_walkpackages_filesys, only with a zip file.ztest_walkpackages_zipfile.ziptest_walkpackages_zipfiler&   r<   r=   r>   /z/mod.pyrd   N)r&   zsub.test_walkpackages_zipfilez!sub.test_walkpackages_zipfile.modro   ztest_walkpackages_zipfile.subz!test_walkpackages_zipfile.sub.mod)r(   r   r)   r   r@   rA   rB   r,   r   r   r.   r[   r0   re   r1   )
r   rH   rf   rh   rI   rJ   rj   rk   rl   r2   s
   &         r   ro   &PkgutilTests.test_walkpackages_zipfile   sc    .*77<<c2OOHc*	

4.("-	

4#:$~5r:	

4#:$y0"5	

4.("-	

4#:$~5r:	

4#:$y0"5		8$
  '44hZ@A@!1@A*HHQKC||E""C  	 Bs   #Gc                   R pV P                  \        \        34      ;_uu_ 4        \        \        P
                  ! V4      4       RRR4       RpV P                  \        \        34      ;_uu_ 4        \        \        P
                  ! V4      4       RRR4       R#   + '       g   i     L_; i  + '       g   i     R# ; i)test_dirNs   test_dir)assertRaises	TypeErrorrR   rS   r.   r[   )r   	str_inputbytes_inputs   &  r   2test_walk_packages_raises_on_string_or_bytes_input?PkgutilTests.test_walk_packages_raises_on_string_or_bytes_input   s    		:677&&y12 8 "	:677&&{34 87	 87 877s    B3 B0B-	0C	c                   ^ RI p^ RIpR\        3R\        P                  3R\        P                  P                  3RV3RV3RVP
                  3RVP
                  3R	VP
                  P                  3R
VP
                  P                  3RVP
                  P                  P                  3RVP
                  P                  P                  3R\        3R\        3R\        P                  3R\        P                  3R\        3R\        3R\        P                  33pR\        3^\        3R\        3R\        3R\        3R\        3R\        3R\        3R\        3R\        3R\        3R\        3R\        3R\        3R \        3R!\        3R"\        33pR(pV F  p\        P                  P                  V P                   V4      p \        P"                  ! VRR#7       \        P                  P                  TR$4      p\'        TR%4      ;_uu_ 4       pTP)                  R4       TP+                  4        RRR4       \,        P.                  ! 4        \,        P0                  ! T4      pY%T33,          p\3        T4      ^8  g   K  Y5RR) \        33,          pEK  	  VR&\        33,          pV FO  w  rV P5                  V	R'7      ;_uu_ 4        \6        P8                  ! V	4      pV P;                  W4       RRR4       KQ  	  V F`  w  rV P5                  V	R'7      ;_uu_ 4        V P=                  V4      ;_uu_ 4        \6        P8                  ! V	4       RRR4       RRR4       Kb  	  R#   \$         d     EK  i ; i  + '       g   i     ELP; i  + '       g   i     K  ; i  + '       g   i     LY; i  + '       g   i     K  ; i)*r   Nr(   zos.pathzos.path:pathseploggingzlogging:zlogging.handlerszlogging.handlers:zlogging.handlers:SysLogHandlerzlogging.handlers.SysLogHandlerz(logging.handlers:SysLogHandler.LOG_ALERTz(logging.handlers.SysLogHandler.LOG_ALERTzbuiltins.intzbuiltins:intzbuiltins.int.from_byteszbuiltins:int.from_byteszbuiltins.ZeroDivisionErrorzbuiltins:ZeroDivisionErrorzos:pathg       @Tr>   z?abczabc/foofoozos.foozos.foo:zos.pth:pathsepzlogging.handlers:NoSuchHandlerz,logging.handlers:SysLogHandler.NO_SUCH_VALUEz,logging.handlers.SysLogHandler.NO_SUCH_VALUEZeroDivisionErrorzos.path.9abc9abcexist_okr#   r<   u   ०वमस)s)	u	   वमस   é   Èu   안녕하세요u   さよならu   ありがとうu   Хорошоu   спасибоu   现代汉语常用字表)r{   logging.handlersr(   r   pathsephandlersSysLogHandler	LOG_ALERTint
from_bytesr}   ru   rR   ImportErrorAttributeErrorr)   r   makedirsUnicodeEncodeErrorr+   r-   flush	importlibinvalidate_cachesimport_modulelensubTestr.   resolve_namer0   rt   )r   r{   success_casesfailure_casesunicode_wordsuwr^   r5   rd   r   rj   oexcs   &            r   test_name_resolution!PkgutilTests.test_name_resolution   sB    2J 0 !!1!12 '"2"23-w/?/?/M/MN-w/?/?/M/MN7  ..88:7  ..88:S!S!&7&7)+<=)+<= )
0 9	N)9Z 
#K ~&${+-~>;^L;^L +.Z(Z #
,M  BT\\2.AA-
 Q.Aa	 
 '')))"-C#YZ'M2w{Sb';!7!88%  * 	4jABB(KA""((+  - #" )
 $FA""&&s++((+ , #" $1 ' 
  #"" ,+ #""sN   M*"M=(N#N8=N%N8*M:9M:=NN"%N50N88O	c           	        \         P                  P                  \         P                  P                  \        4      R R4      p\        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V P                  \        P                  ! R4      R4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V P                  \        P                  ! R4      R4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V P                  \        P                  ! R4      R	4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R	4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V P                  \        P                  ! R4      R	4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R	4       RRR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL"; i  + '       g   i     L; i  + '       g   i     R# ; i)
test_importdatapackage3zpackage3.submodulezpackage3.submodule.attr	submoduleNzpackage3.submodule:attrzpackage3:submodule.attrrebound
r(   r   r)   r   __file__r	   r   r0   r.   r   r   r   s   & r   %test_name_resolution_import_rebinding2PkgutilTests.test_name_resolution_import_rebindingE  s    ww||BGGOOH5}fMZ!566d8K8KW112KLkZ 9L6Z!566d8K8KW112KLkZ 9L6Z!566d8K8KW112KLiXW112KLkZW112KLiX 9L6 Z!566d8K8KW112KLiXW112KLkZW112KLiX 9L66 9L8K8K6668K8K8K6668K8K8K666 9L8K666   I-+'I	I-6J
'J	1JJ=)A3J)	J= K$A3K	K$I*$	I--I>	J	JJ&	)J:4	J==K	K!K$$K5	c           	        \         P                  P                  \         P                  P                  \        4      R R4      p\        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V P                  \        P                  ! R4      R4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V P                  \        P                  ! R4      R4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V P                  \        P                  ! R4      R	4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V P                  \        P                  ! R4      R	4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       RRR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL"; i  + '       g   i     L; i  + '       g   i     R# ; i)
r   r   package4zpackage4.submodulezpackage4.submodule.attrr   Nzpackage4.submodule:attrzpackage4:submodule.attroriginr   r   s   & r   &test_name_resolution_import_rebinding23PkgutilTests.test_name_resolution_import_rebinding2V  s   ww||BGGOOH5}fMZ!566d8K8KW112KLkZ 9L6Z!566d8K8KW112KLkZ 9L6Z!566d8K8KW112KLhWW112KLkZW112KLkZ 9L6 Z!566d8K8KW112KLhWW112KLkZW112KLkZ 9L66 9L8K8K6668K8K8K6668K8K8K666 9L8K666r   )r   N)__name__
__module____qualname____firstlineno__r   r   r!   r;   rV   r`   rc   ro   rx   r   r   r   __static_attributes____classdictcell____classdict__s   @r   r   r      sO     )
:!F%7N	2&!P!!F5Y,vY"[ [r   r   c                   d   a  ] tR tRt o  ! R R]4      t ! R R]4      tR tR tR t	R	 t
R
tV tR# )PkgutilPEP302Testsif  c                   2   a  ] tR tRt o R tR tR tRtV tR# )PkgutilPEP302Tests.MyTestLoaderih  c                    R # )N )r   specs   &&r   create_module-PkgutilPEP302Tests.MyTestLoader.create_modulei  s    r   c                f    VP                   P                  R ^ 4      ^,           VP                   R &   R# )loadsN)__dict__get)r   rd   s   &&r   exec_module+PkgutilPEP302Tests.MyTestLoader.exec_modulel  s&    $'LL$4$4Wa$@1$DCLL!r   c                    R # )Hello, world!r   r   s   &&r   r/   (PkgutilPEP302Tests.MyTestLoader.get_datap  s    "r   r   N)	r   r   r   r   r   r   r/   r   r   r   s   @r   MyTestLoaderr   h  s     		E	# 	#r   r   c                   *   a  ] tR tRt o RR ltRtV tR# )!PkgutilPEP302Tests.MyTestImporteris  Nc                ~    \         P                  4       p\        VR VP                  P                  ,          V. R7      # )z<%s>)loadersubmodule_search_locations)r   r   r   	__class__r   )r   fullnamer   targetr   s   &&&& r   	find_spec+PkgutilPEP302Tests.MyTestImporter.find_spect  s;    '446F*8+1F4D4D4M4M+M28FHJ Jr   r   )NN)r   r   r   r   r   r   r   r   s   @r   MyTestImporterr   s  s     	J 	Jr   r   c                b    \         P                  P                  ^ V P                  4       4       R# r   )r   	meta_pathr   r   r   s   &r   r   PkgutilPEP302Tests.setUp{  s    Q 3 3 56r   c                (    \         P                  ^  R# r   )r   r   r   s   &r   r   PkgutilPEP302Tests.tearDown~  s    MM!r   c                v    V P                  \        P                  ! R R4      R4       \        P                  R  R# )r|   dummyr   N)r0   r.   r/   r   r1   r   s   &r   test_getdata_pep302&PkgutilPEP302Tests.test_getdata_pep302  s+    ))%9?KKKr   c                    ^ RI pV P                  VP                  ^4       V P                  \        P                  ! RR4      R4       V P                  VP                  ^4       \
        P                  R R# )r   Nr|   r   r   )r|   r0   r   r.   r/   r   r1   )r   r|   s   & r   test_alreadyloaded%PkgutilPEP302Tests.test_alreadyloaded  sX     	A&))%9?KA&KKr   r   N)r   r   r   r   objectr   r   r   r   r   r   r   r   r   s   @r   r   r   f  s8     	#v 	#J J7
 r   r   c                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )ExtendPathTestsi  c                   \         P                  ! 4       p\        P                  P	                  ^ V4       \
        P                  P                  W!4      p\
        P                  ! V4       \        \
        P                  P                  VR4      R4      ;_uu_ 4       pVP                  R4       RRR4       V#   + '       g   i     T# ; i)r   r#   r<   zKfrom pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
N)
r   r   r   r   r   r(   r)   r*   r+   r-   )r   pkgnamer   pkgdirfls   &&   r   create_initExtendPathTests.create_init  s    ""$7#g/
"'',,v}5s;;rHHde <  <; s   B99C
	c                    \         P                  P                  WVR ,           4      p\        VR4      ;_uu_ 4       p\	        RP                  V4      VR7       RRR4       R#   + '       g   i     R# ; i).pyr<   zvalue={})fileN)r(   r   r)   r+   printformat)r   r   r   submodule_namevaluemodule_namer   s   &&&&&  r   create_submodule ExtendPathTests.create_submodule  sN    ggll7^e5KL+s##r*##E*4 $###s   A##A4	c           
        R pV P                  V4      pV P                  V4      pV P                  W!R^ 4       V P                  W1R^4       ^ RIp^ RIpV P	                  VP
                  P                  ^ 4       V P	                  VP                  P                  ^4       V P	                  \        VP                  4      \        \        P                  P                  W!4      \        P                  P                  W14      .4      4       \        P                  ! V4       \        P                  ! V4       \        P                  ^  \        P                  ^  \        P                   R  \        P                   R \        P                   R R# )r|   barbazNfoo.barfoo.baz)r   r   foo.barfoo.bazr0   r   r   r   sorted__path__r(   r   r)   r   r   r   r1   r   r   	dirname_0	dirname_1r|   s   &    r   test_simpleExtendPathTests.test_simple  s   $$W-	$$W-	i%;i%;** 	-i!A!#i!A!C D	E
 	i i HHQKHHQKKKKK	"KK	"r   c                
   \         P                  p\         P                  pR pRpV P                  V4      p\        P
                  P                  WS4      pRP                  W44      p\        P                  P                  VR4       \        P                  P                  VR4        V P                  WSV^ 4       \        P                  ! V4       \        V! V4      4      pV! V4      p	V F  p
V
P                  V4      pVP                   p VP                   pV P%                  V
\        P&                  P(                  4       V P+                  W4       V P%                  V\        P&                  P,                  4       V P/                  V
P                  V4      4       K  	  V P1                  \2        4      ;_uu_ 4        \        V! R4      4       RRR4       V P1                  \2        4      ;_uu_ 4        \        V! R4      4       RRR4       \4        P6                  ! V4       \        P
                  ^   \        P                  R  \        P                  R R#   \"         d     ELQi ; i  + '       g   i     L; i  + '       g   i     L; i  \8         d     R# i ; i  \4        P6                  ! T4       \        P
                  ^   \        P                  R  \        P                  R i   \8         d     i i ; i; i)spameggsz{}.{}Nzinvalid.modulez.spamz	spam.eggs)r.   iter_importersget_importerr   r(   r   r)   r   r   r1   rP   r   r   r   rS   r   r   r   rD   	machinery
FileFinderr0   SourceFileLoaderassertIsNonert   r   r   r   KeyError)r   r  r  r   modnamer   pathitemr   	importersexpected_importerfinderr   r   s   &            r   test_iter_importers#ExtendPathTests.test_iter_importers  sO    //++""7+77<<1>>'3$'&"	!!'GQ?##H-^H56I ,X 6#''1#]]F
 %%fi.A.A.L.LM  ;%%f&/&9&9&J&JL!!&"2"27";< $ "";//^$456 0 "";//^G,- 0 MM'"KK'KK,) &   0/ 0/   MM'"KK'KK, s   'A$J% IB&J% >I-%J% 5J J% 7"J I*&J% )I**J% -I=	8J%  J	J% J"!J"%(L"K10L1K?<L>K??Lc           
        R pV P                  V4      pV P                  V4      pV P                  W!R^ 4       \        P                  ! \        P                  P                  W!R4      4       V P                  W1R^4       ^ RIp^ RIpV P                  VP                  P                  ^ 4       V P                  VP                  P                  ^4       V P                  \        VP                  4      \        \        P                  P                  W!4      \        P                  P                  W14      .4      4       \        P                  ! V4       \        P                  ! V4       \         P                  ^  \         P                  ^  \         P"                  R  \         P"                  R \         P"                  R R# )r|   r   r#   r   Nr   r   )r   r   r(   unlinkr   r)   r   r   r0   r   r   r   r   r   r   r   r   r1   r   s   &    r   test_mixed_namespace$ExtendPathTests.test_mixed_namespace  s:   $$W-	$$W-	i%;
		"'',,y=ABi%;** 	-i!A!#i!A!C D	E
 	i i HHQKHHQKKKKK	"KK	"r   c                   R pV P                  V4      pV P                  R\        P                  ! RR 4      4       V P                  R\        P                  ! RR 4      4       V P                  ^{\        P                  ! ^{R 4      4       V P                  R\        P                  ! RR 4      4       \        P
                  ! V4       \        P                  ^  R# )r|   notalistN)notarS   )r   r0   r.   extend_pathr   r   r   r   )r   r   r   s   &  r   test_extend_path_argument_types/ExtendPathTests.test_extend_path_argument_types  s    $$W-	 	W%8%8U%KL-w/B/BCWY^/_`g11#u=>w224?@ 	i HHQKr   c                N   R pV P                  V4      p\        \        P                  P	                  VR4      R4      ;_uu_ 4       pVP                  RP	                  . RO4      4       RRR4       \        P                  ! \        P                  R4      pV P                  VRR	 \        P                  4       V P                  VR	,          R4       V P                  VR
,          R4       \        P                  ! V4       \        P                  ^  R#   + '       g   i     L; i)r|   zbar.pkgr<   
r   /foo/bar/bazNr   )r   r!  r>   z#commentr   )r   r+   r(   r   r)   r-   r.   r  r   r0   r   r   )r   r   r   pkg_fileextended_pathss   &    r   test_extend_path_pkg_files*ExtendPathTests.test_extend_path_pkg_files  s    $$W-	"'',,y)4c::hNN499 &   ; !,,SXXu=,chh7+U3+^< 	i HHQK! ;:s   #DD$	r   N)r   r   r   r   r   r   r  r  r  r  r%  r   r   r   s   @r   r   r     s.     	5
#:-`#: r   r   c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )NestedNamespacePackageTesti4  c                r    \         P                  ! 4       V n        \        P                  R ,          V n        R# :NNNN)r   r   basedirr   r   old_pathr   s   &r   r    NestedNamespacePackageTest.setUp6  s!    '')r   c                    V P                   \        P                  R &   \        P                  ! V P
                  4       R# r*  )r,  r   r   r   r   r+  r   s   &r   r   #NestedNamespacePackageTest.tearDown:  s#    mmdll#r   c                   VP                  R ^4      w  r4\        P                  P                  V P                  VP                  R \        P                  P                  4      4      p\        P                  ! VRR7       \        \        P                  P                  WTR,           4      R4      ;_uu_ 4       pVP                  V4       RRR4       R#   + '       g   i     R# ; i).Tr   r   r<   N)
rsplitr(   r   r)   r+  replacesepr   r+   r-   )r   rG   contentsbasefinal	base_pathr5   s   &&&    r   r   (NestedNamespacePackageTest.create_module>  s    kk#q)GGLLt||C/MN	
I-"'',,y%-8#>>!GGH ?>>>s   7CC$	c                r   R pV P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RR4       V P                  RR4       \        P                  P                  ^ \        P                  P                  V P                  R	4      4       \        P                  P                  ^ \        P                  P                  V P                  R
4      4       ^ RIpV P                  \        R4       V P                  \        VP                  4      ^4       ^ RIpV P                  \        R4       V P                  \        VP                  P                  4      ^4       ^ RIHp ^ RIHp V P                  V^4       V P                  V^4       R# )zBimport pkgutil; __path__ = pkgutil.extend_path(__path__, __name__)za.pkg.__init__zb.pkg.__init__za.pkg.subpkg.__init__zb.pkg.subpkg.__init__za.pkg.subpkg.czc = 1zb.pkg.subpkg.dzd = 2r  bNr2   z
pkg.subpkg)c)r^   )r   r   r   r   r(   r)   r+  r2   r   r   r0   r   r   
pkg.subpkgsubpkgpkg.subpkg.cr<  pkg.subpkg.dr^   )r   pkgutil_boilerplater2   r<  r^   s   &    r   test_nested&NestedNamespacePackageTest.test_nestedE  sC   A 	 	+-@A+-@A24GH24GH+W5+W5277<<c:;277<<c:;&S\\*A.-SZZ00115""AAr   )r+  r,  N)
r   r   r   r   r   r   r   rB  r   r   r   s   @r   r(  r(  4  s     $$ r   r(  c                   2   a  ] tR tRt o R tR tR tRtV tR# )ImportlibMigrationTestsi]  c                    \        4       ;_uu_ 4       pV P                  \        P                  ! R 4      4       V P	                  \        VP                  4      ^ 4       RRR4       R#   + '       g   i     R# ; i)z*??N)r   r  r.   r  r0   r   warnings)r   r<   s   & r   "test_get_importer_avoids_emulation:ImportlibMigrationTests.test_get_importer_avoids_emulationb  sM    g2259:S_a0 s   AA((A9	c                     \         P                  ! \        R 4      4       R#   \         d    T P	                  R4        R# i ; i)z/homez3Unexpected AttributeError when calling get_importerN)r.   r  r   r   r\   r   s   &r   test_issue44061'ImportlibMigrationTests.test_issue44061h  s8    	M  g/ 	MIIKL	Ms   # AAc                    \        4       ;_uu_ 4       p\        P                  ! 4        F  pK  	  V P                  \	        VP
                  4      ^ 4       RRR4       R#   + '       g   i     R# ; ir   )r   r.   r  r0   r   rG  )r   r<   importers   &  r   $test_iter_importers_avoids_emulation<ImportlibMigrationTests.test_iter_importers_avoids_emulationn  sG    #224d4S_a0 s   AAA0	r   N)	r   r   r   r   rH  rK  rO  r   r   r   s   @r   rE  rE  ]  s     
1M1 1r   rE  c                  l    ^ RI p ^ RIpV P                  P                  4        VP                  ! 4        R# r   )	zipimportr   _zip_directory_cacheclearr   )rR  r   s     r   tearDownModulerU  t  s&    ""((*!r   __main__)pathlibr   test.support.import_helperr   test.support.warnings_helperr   unittestr   r   importlib.utilr   r.   r(   os.pathr   r   r@   r   test.support.os_helperr   test.test_importlib.utilr	   TestCaser   r   r   r(  rE  rU  r   mainr   r   r   <module>ra     s     - 7  
  2  	     4 + ,J[8$$ J[Z
(** (Z^h'' ^B&!2!2 &R1h// 1." zMMO r   