+
    Bi0                        ^ RI 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
t
R. R#OR.R.R.tR. R$OR.R.R.tR. R%OR	R.. R
.tR. R&OR	R.. R.tR. R'O. . R.tR. R(O. . R.tRRR.R.. R.tRRR.. . R.tRR.. . R.tR. R)OR.. R.tR. R*OR.. R.tRRR.. . R.tRRR.. . R.tRRR.. . RRP1                  R4      ,           .tR tR t ! R  R!]P8                  4      t]R"8X  d   ]P>                  ! 4        R# R# )+    N)supporta.moduleaczb.somethingza/__init__.py
a/module.py
                                from b import something
                                from c import something
b/__init__.py
                                from sys import *
a  a/__init__.py
a/module.py
                                from b import something
                                from c import something
b/__init__.py
                                from __future__ import absolute_import
                                from sys import *
blahblaha  mymodule.py
a/__init__.py
                                import blahblah
                                from a import b
                                import c
a/module.py
                                import sys
                                from a import b as x
                                from a.c import sillyname
a/b.py
a/c.py
                                from a.module import x
                                import mymodule as sillyname
                                from sys import version_info
zaj  mymodule.py
a/__init__.py
a/module.py
                                from __future__ import absolute_import
                                import sys # sys
                                import blahblah # fails
                                import gc # gc
                                import b.x # b.x
                                from b import y # b.y
                                from b.z import * # b.z.*
a/gc.py
a/sys.py
                                import mymodule
a/b/__init__.py
a/b/x.py
a/b/y.py
a/b/z.py
b/__init__.py
                                import z
b/unused.py
b/x.py
b/y.py
b/z.py
a  mymodule.py
a/__init__.py
                                from .b import y, z # a.b.y, a.b.z
a/module.py
                                from __future__ import absolute_import # __future__
                                import gc # gc
a/gc.py
a/sys.py
a/b/__init__.py
                                from ..b import x # a.b.x
                                #from a.b.c import moduleC
                                from .c import moduleC # a.b.moduleC
a/b/x.py
a/b/y.py
a/b/z.py
a/b/g.py
a/b/c/__init__.py
                                from ..c import e # a.b.c.e
a/b/c/moduleC.py
                                from ..c import d # a.b.c.d
a/b/c/d.py
a/b/c/e.py
a/b/c/x.py
a  mymodule.py
a/__init__.py
                                from . import sys # a.sys
a/another.py
a/module.py
                                from .b import y, z # a.b.y, a.b.z
a/gc.py
a/sys.py
a/b/__init__.py
                                from .c import moduleC # a.b.c.moduleC
                                from .c import d # a.b.c.d
a/b/x.py
a/b/y.py
a/b/z.py
a/b/c/__init__.py
                                from . import e # a.b.c.e
a/b/c/moduleC.py
                                #
                                from . import f   # a.b.c.f
                                from .. import x  # a.b.x
                                from ... import another # a.another
a/b/c/d.py
a/b/c/e.py
a/b/c/f.py
za.barza/__init__.py
                                def foo(): pass
a/module.py
                                from . import foo
                                from . import bar
zza/__init__.py
                                def foo(): pass
a/module.py
                                from . import *
 zb.moduleza/__init__.py
a/module.py
                                import b.module
b/__init__.py
b/module.py
                                ?  # SyntaxError: invalid syntax
za/__init__.py
a/module.py
                                import c
                                from b import c
b/__init__.py
b/c.py
a_utf8b_utf8u  a_utf8.py
                                # use the default of utf8
                                print('Unicode test A code point 2090 ₐ that is not valid in cp1252')
                                import b_utf8
b_utf8.py
                                # use the default of utf8
                                print('Unicode test B code point 2090 ₐ that is not valid in cp1252')
uz  a_utf8.py
                                # coding=utf8
                                print('Unicode test A code point 2090 ₐ that is not valid in cp1252')
                                import b_utf8
b_utf8.py
                                # use the default of utf8
                                print('Unicode test B code point 2090 ₐ that is not valid in cp1252')
a_cp1252s   a_cp1252.py
                                # coding=cp1252
                                # 0xe2 is not allowed in utf8
                                print('CP1252 test Pt')
                                import b_utf8
u   b_utf8.py
                                # use the default of utf8
                                print('Unicode test A code point 2090 ₐ that is not valid in cp1252')
utf-8c                     \         P                  P                  V 4      p \         P                  ! V4       \        V R4      #   \         d+   pTP
                  \
        P                  8w  d   h  R p?L<R p?ii ; i)Nwb)ospathdirnamemakedirsOSErrorerrnoEEXISTopen)r   r   es   &  -/usr/lib/python3.14/test/test_modulefinder.py	open_filer   "  s^    ggood#G
G d  77ell" #s   A A8 A33A8c                    R p VP                  4        F  p\        V4      \        8w  d   VP                  R4      pVP	                  R4      '       g   VP	                  R4      '       d)   VP                  VP                  4       R,           4       K~  V'       d   VP                  4        \        V4      \        8X  d   VP                  R4      p\        \        P                  P                  WP                  4       4      4      pK  	  V'       d   VP                  4        R # R #   T'       d   TP                  4        i i ; i)Nr          	   
)
splitlinestypebytesencode
startswithwritestripclosedecoder   r   r   join)test_dirsourceofilines   &&  r   create_packager-   ,  s    
C%%'DDzU"{{7+t$$(>(>		$**,./IIK:&;;w/DXzz| DE ( IIK 3IIK s   AD% D% */D% A/D% %E c                      a  ] tR tRt o R tR tR^ . ]P                  3R l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R tR tR tR tR tRtV tR# )ModuleFinderTesti>  c                    \         P                  ! 4       V n        V P                  \        P                  P                  \         P                  4      .V n        R # N)tempfilemkdtempr)   r   r   r   __file__	test_pathselfs   &r   setUpModuleFinderTest.setUp?  s5     ((*--9J9J)KL    c                F    \         P                  ! V P                  4       R # r1   )shutilrmtreer)   r6   s   &r   tearDownModuleFinderTest.tearDownC  s    dmm$r:   Fc                   Vw  rgrp
\        V P                  V
4       V! V P                  VVR 7      pVP                  V4       V'       d   VP	                  4        \        \        V4      4      p\        VP                  4      pV P                  W4       VP                  4       w  rV P                  W4       V P                  W4       R# ))r   debugreplace_pathsN)
r-   r)   r5   import_hookreportsortedsetmodulesassertEqualany_missing_maybe)r7   inforD   rA   rB   modulefinder_classimport_thisrG   missingmaybe_missingr*   mffoundbadmaybes   &&&&&&         r   _do_testModuleFinderTest._do_testF  s    ?C<gft}}f-T^^56CE
{#IIK W&rzz"( ))+
&.r:   c                0    V P                  \        4       R # r1   )rS   package_testr6   s   &r   test_packageModuleFinderTest.test_packagea  s    l#r:   c                0    V P                  \        4       R # r1   )rS   
maybe_testr6   s   &r   
test_maybeModuleFinderTest.test_maybed  s    j!r:   c                0    V P                  \        4       R # r1   )rS   maybe_test_newr6   s   &r   test_maybe_newModuleFinderTest.test_maybe_newg  s    n%r:   c                0    V P                  \        4       R # r1   )rS   absolute_import_testr6   s   &r   test_absolute_imports&ModuleFinderTest.test_absolute_importsj      *+r:   c                0    V P                  \        4       R # r1   )rS   relative_import_testr6   s   &r   test_relative_imports&ModuleFinderTest.test_relative_importsm  re   r:   c                0    V P                  \        4       R # r1   )rS   relative_import_test_2r6   s   &r   test_relative_imports_2(ModuleFinderTest.test_relative_imports_2p      ,-r:   c                0    V P                  \        4       R # r1   )rS   relative_import_test_3r6   s   &r   test_relative_imports_3(ModuleFinderTest.test_relative_imports_3s  rn   r:   c                0    V P                  \        4       R # r1   )rS   relative_import_test_4r6   s   &r   test_relative_imports_4(ModuleFinderTest.test_relative_imports_4v  rn   r:   c                0    V P                  \        4       R # r1   )rS   syntax_error_testr6   s   &r   test_syntax_error"ModuleFinderTest.test_syntax_errory  s    '(r:   c                0    V P                  \        4       R # r1   )rS   same_name_as_bad_testr6   s   &r   test_same_name_as_bad&ModuleFinderTest.test_same_name_as_bad|  s    +,r:   c                   \         P                  P                  V P                  R 4      pV\        P
                  P                  ^ ,          ,           pV\        P
                  P                  ^ ,          ,           p\        V4      ;_uu_ 4       pVP                  RP                  R4      4       RRR4       \        P                  ! W#R7       \         P                  ! V4       V P                  \        4       R#   + '       g   i     LT; i)r   ztesting_modulefinder = True
r   N)cfile)r   r   r(   r)   	importlib	machinerySOURCE_SUFFIXESBYTECODE_SUFFIXESr   r$   r"   
py_compilecompileremoverS   bytecode_test)r7   	base_pathsource_pathbytecode_pathfiles   &    r   test_bytecodeModuleFinderTest.test_bytecode  s    GGLL4	)"5"5"E"Ea"HH!I$7$7$I$I!$LL{##tJJ6==gFG $;<
		+m$	 $#s   !C;;D	c                   \         P                  P                  V P                  R R4      p\         P                  P                  V P                  R R4      p\        P
                  ! 4       ;_uu_ 4       pV P                  \        ^W3.R7       RRR4       XP                  4       pRV: RV: 2pV P                  WC4       R#   + '       g   i     L=; i)r   z	module.pyzspam.py)rA   rB   Nzco_filename z changed to )
r   r   r(   r)   r   captured_stdoutrS   rZ   getvalueassertIn)r7   old_pathnew_pathoutputexpecteds   &    r   test_replace_paths#ModuleFinderTest.test_replace_paths  s    77<<sK@77<<sI>$$&&&MM*A*2)=(>  @ ' "5=xHh' '&s   4CC	c           
     l    R R R.. . R\        \        R4      4      ,          .pV P                  V4       R# )r   bzVa.py
                                %r
                                import b
b.py
Ni   )listrangerS   )r7   extended_opargs_tests   & r   test_extended_opargs%ModuleFinderTest.test_extended_opargs  s@    #J
 5<		  	*+r:   c                0    V P                  \        4       R # r1   )rS   coding_default_utf8_testr6   s   &r   test_coding_default_utf8)ModuleFinderTest.test_coding_default_utf8  s    ./r:   c                0    V P                  \        4       R # r1   )rS   coding_explicit_utf8_testr6   s   &r   test_coding_explicit_utf8*ModuleFinderTest.test_coding_explicit_utf8  s    /0r:   c                0    V P                  \        4       R # r1   )rS   coding_explicit_cp1252_testr6   s   &r   test_coding_explicit_cp1252,ModuleFinderTest.test_coding_explicit_cp1252  s    12r:   c                f     ! R  R\         P                  4      pV P                  \        VR7       R# )c                   >   a a ] tR tRt oV 3R ltV 3R ltRtVtV ;t# )AModuleFinderTest.test_load_module_api.<locals>.CheckLoadModuleApii  c                (   < \         SV `  ! V/ VB  R # r1   )super__init__)r7   argskwds	__class__s   &*,r   r   JModuleFinderTest.test_load_module_api.<locals>.CheckLoadModuleApi.__init__  s     $/$/r:   c                .   < Vw  rVp\         SV `  WW44      # r1   )r   load_module)	r7   fqnamefppathname	file_infosuffixmoder    r   s	   &&&&&   r   r   MModuleFinderTest.test_load_module_api.<locals>.CheckLoadModuleApi.load_module  s    %."dw*6xKKr:    )	__name__
__module____qualname____firstlineno__r   r   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   CheckLoadModuleApir     s     0L Lr:   r   )rK   N)modulefinderModuleFinderrS   rb   )r7   r   s   & r   test_load_module_api%ModuleFinderTest.test_load_module_api  s*    	L!:!: 	L 	*?QRr:   )r)   r5   N)r   r   r   r   r8   r>   r   r   rS   rW   r[   r_   rc   rh   rl   rq   ru   ry   r}   r   r   r   r   r   r   r   r   r   )r   s   @r   r/   r/   >  s     M% %*"YeYrYr /6$"&,,...)-%(,013
S 
Sr:   r/   __main__)r   r   sysr   )r   r   r   r   
__future__)r   a.bza.cr   mymoduler   )	r   r   r   zb.xzb.yzb.zr   r   gc)r   r   r   r   a.b.ya.b.za.b.ca.b.c.moduleCa.b.c.da.b.c.ea.b.xr   )r   r   za.sysr   r   r   r   r   r   r   za.b.c.fr   z	a.another)r   r   r   )r   r   r   zb.c) r   r   importlib.machineryr   r   r<   unittestr2   testr   r   rZ   r^   rV   rb   rg   rk   rp   rt   r   rx   r|   r   r   r"   r   r   r-   TestCaser/   r   mainr   r:   r   <module>r      s   	        $ 
EM?
  EM?  6r	,   r B  " J  % P *I  *
  E L"	  !E2	  x	  x	   F7O
	  $uSx(( uSn zMMO r:   