+
    Bi                     
   ^ RI Ht ]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t]P                  ! R4      t^ RIt^ RIH	t	 ^ RI
t
^ RIt^ RIt^ RIt^ RIH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t ^ RIt ! R
 R4      t]P:                  ! ]]R7      w  tt ! R R4      t ]P:                  ! ] ]]]R7      w  t!t" ! R R4      t#]P:                  ! ]#]R7      w  t$t% ! R R4      t&]P:                  ! ]&]]]R7      w  t't( ! R R4      t)]P:                  ! ])]R7      w  t*t+ ! R R4      t,]P:                  ! ],]R7      w  t-t. ! R R]P^                  4      t)]P`                  ! ]RJ R4       ! R R]P^                  4      4       t1 ! R R]P^                  4      t2]3R8X  d   ]Ph                  ! 4        R# R#   ] d    Rt ELSi ; i  ] d    Rt EL^i ; i  ] d    Rt ELii ; i)    )utilzimportlib.abc	importlibzimportlib.machineryzimportlib.utilN)_bootstrap_external)support)	os_helperc                   6   a  ] tR t^$t o RtR tR tR tRtV t	R# )DecodeSourceBytesTestsu   string ='ü'c                    V P                   P                  R 4      pV P                  V P                  P	                  V4      V P                   4       R# )utf-8NsourceencodeassertEqualr   decode_source)selfsource_bytess   & 4/usr/lib/python3.14/test/test_importlib/test_util.pytest_ut8_default'DecodeSourceBytesTests.test_ut8_default(   s9    {{))'200>L    c                    R V P                   ,           pVP                  R4      pV P                  V P                  P	                  V4      V4       R# )z# coding=latin-1
zlatin-1Nr   r   r   r   s   &  r   test_specified_encoding.DecodeSourceBytesTests.test_specified_encoding,   s=    %3}}Y/00>Gr   c                   R P                  V P                  V P                  .4      pVP                  R4      pV P                  V P                  P                  V4      RP                  V P                  V P                  .4      4       R# )z
r   
N)joinr   r   r   r   r   r   s   &  r   test_universal_newlines.DecodeSourceBytesTests.test_universal_newlines2   sd    dkk4;;78}}W-00>DKK#=>	@r    N)
__name__
__module____qualname____firstlineno__r   r   r   r   __static_attributes____classdictcell____classdict__s   @r   r	   r	   $   s"     FMH@ @r   r	   c                   \   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V tR# )ModuleFromSpecTestsc                    ! R  R4      pV P                   P                  RV! 4       4      pV P                  \        4      ;_uu_ 4        V P                  P                  V4      pRRR4       R#   + '       g   i     R# ; i)c                   &   a  ] tR t^At o R tRtV tR# )9ModuleFromSpecTests.test_no_create_module.<locals>.Loaderc                    R # Nr    )r   modules   &&r   exec_moduleEModuleFromSpecTests.test_no_create_module.<locals>.Loader.exec_moduleB   s    r   r    N)r!   r"   r#   r$   r1   r%   r&   r'   s   @r   Loaderr-   A   s      r   r3   testN)	machinery
ModuleSpecassertRaisesImportErrorr   module_from_specr   r3   specr0   s   &   r   test_no_create_module)ModuleFromSpecTests.test_no_create_module@   sZ    	 	 ~~((:{++YY//5F ,+++s   	A//B 	c                H    ! R  RV P                   P                  4      pV P                  P                  RV! 4       4      pV P                  P                  V4      pV P                  V\        P                  4       V P                  VP                  VP                  4       R# )c                   &   a  ] tR t^It o R tRtV tR# )CModuleFromSpecTests.test_create_module_returns_None.<locals>.Loaderc                    R # r/   r    )r   r;   s   &&r   create_moduleQModuleFromSpecTests.test_create_module_returns_None.<locals>.Loader.create_moduleJ   s    r   r    Nr!   r"   r#   r$   rB   r%   r&   r'   s   @r   r3   r@   I   s      r   r3   r4   N)abcr3   r5   r6   r   r9   assertIsInstancetypes
ModuleTyper   r!   namer:   s   &   r   test_create_module_returns_None3ModuleFromSpecTests.test_create_module_returns_NoneH   sr    	TXX__ 	 ~~((:++D1fe&6&67$))4r   c                Z  aa R o ! R R\         P                  4      o ! VV3R lRV P                  P                  4      pV P                  P                  RV! 4       4      pV P                  P                  V4      pV P                  VS4       V P                  VP                  S4       R# )zalready setc                       ] tR t^StRtR# )<ModuleFromSpecTests.test_create_module.<locals>.CustomModuler    N)r!   r"   r#   r$   r%   r    r   r   CustomModulerN   S   s    r   rO   c                   0   <a  ] tR t^Ut o VV3R ltRtV tR# )6ModuleFromSpecTests.test_create_module.<locals>.Loaderc                :   < S! VP                   4      pSVn        V# r/   )rI   r!   )r   r;   r0   rO   rI   s   && r   rB   DModuleFromSpecTests.test_create_module.<locals>.Loader.create_moduleV   s    %dii0"&r   r    NrD   )r(   rO   rI   s   @r   r3   rQ   U   s      r   r3   r4   N)rG   rH   rE   r3   r5   r6   r   r9   rF   r   r!   )r   r3   r;   r0   rO   rI   s   &   @@r   test_create_module&ModuleFromSpecTests.test_create_moduleQ   s    	5++ 		 	TXX__ 	
 ~~((:++D1fl3$/r   c                    V P                   P                  R \        4       4      pV P                  P	                  V4      pV P                  VP                  VP                  4       R# r4   N)r5   r6   objectr   r9   r   r!   rI   r   r;   r0   s   &  r   test___name__!ModuleFromSpecTests.test___name___   sF    ~~((:++D1$))4r   c                    V P                   P                  R \        4       4      pV P                  P	                  V4      pV P                  VP                  V4       R# rW   )r5   r6   rX   r   r9   r   __spec__rY   s   &  r   test___spec__!ModuleFromSpecTests.test___spec__d   sB    ~~((:++D1$/r   c                    \        4       pV P                  P                  R V4      pV P                  P	                  V4      pV P                  VP                  V4       R# rW   )rX   r5   r6   r   r9   assertIs
__loader__)r   loaderr;   r0   s   &   r   test___loader__#ModuleFromSpecTests.test___loader__i   sG    ~~((8++D1f''0r   c                    V P                   P                  R \        4       4      pV P                  P	                  V4      pV P                  VP                  VP                  4       R# )ztest.pkgN)r5   r6   rX   r   r9   r   __package__parentrY   s   &  r   test___package__$ModuleFromSpecTests.test___package__o   sH    ~~((VX>++D1++T[[9r   c                    V P                   P                  R \        4       RR7      pV P                  P	                  V4      pV P                  VP                  VP                  4       R# )r4   T)
is_packageN)r5   r6   rX   r   r9   r   __path__submodule_search_locationsrY   s   &  r   test___path__!ModuleFromSpecTests.test___path__t   sM    ~~((d(K++D1$*I*IJr   c                    V P                   P                  R \        4       RR7      pRVn        V P                  P                  V4      pV P                  VP                  VP                  4       R# )r4   	some/path)originTN)	r5   r6   rX   has_locationr   r9   r   __file__rs   rY   s   &  r   test___file__!ModuleFromSpecTests.test___file__y   sS    ~~((+(N ++D1$++6r   c                    V P                   P                  R \        4       4      pRVn        RVn        V P
                  P                  V4      pV P                  VP                  VP                  4       R# )r4   rr   TN)	r5   r6   rX   cachedrt   r   r9   r   
__cached__rY   s   &  r   test___cached__#ModuleFromSpecTests.test___cached__   sW    ~~((:! ++D1**DKK8r   r    N)r!   r"   r#   r$   r<   rJ   rT   rZ   r^   rd   ri   ro   rv   r{   r%   r&   r'   s   @r   r*   r*   >   s=     6505
0
1:
K
79 9r   r*   )rE   r5   r   c                   D   a  ] tR t^t o R tR tR tR tR tR t	Rt
V tR# )	ResolveNameTestsc                ^    V P                  R V P                  P                  R R4      4       R# )baconNr   r   resolve_namer   s   &r   test_absoluteResolveNameTests.test_absolute   s#    $))"8"8$"GHr   c                ^    V P                  R V P                  P                  R R4      4       R# )r   spamNr   r   s   &r   test_absolute_within_package-ResolveNameTests.test_absolute_within_package   s#    $))"8"8&"IJr   c                    V P                  \        4      ;_uu_ 4        V P                  P                  R R4       RRR4       R#   + '       g   i     R# ; i).bacon Nr7   r8   r   r   r   s   &r   test_no_package ResolveNameTests.test_no_package   s6    {++II""8R0 ,+++   AA	c                ^    V P                  R V P                  P                  RR4      4       R# )zspam.eggs.baconr   	spam.eggsNr   r   s   &r   test_in_package ResolveNameTests.test_in_package   s(    *//+F	Hr   c                ^    V P                  R V P                  P                  RR4      4       R# )z
spam.bacon..baconr   Nr   r   s   &r   test_other_package#ResolveNameTests.test_other_package   s'    //	;G	Ir   c                    V P                  \        4      ;_uu_ 4        V P                  P                  R R4       RRR4       R#   + '       g   i     R# ; i)r   r   Nr   r   s   &r   test_escapeResolveNameTests.test_escape   s6    {++II""9f5 ,+++r   r    N)r!   r"   r#   r$   r   r   r   r   r   r   r%   r&   r'   s   @r   r~   r~      s,     IK1
H
I
6 6r   r~   c                   |   a  ] tR t^t o  ! R R4      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# )FindSpecTestsc                   4   a  ] tR t^t o ]RR l4       tRtV tR# )FindSpecTests.FakeMetaFinderNc                
    WV3# r/   r    )rI   pathtargets   &&&r   	find_spec&FindSpecTests.FakeMetaFinder.find_spec   s    <@<N5Nr   r    )NN)r!   r"   r#   r$   staticmethodr   r%   r&   r'   s   @r   FakeMetaFinderr      s     	N 
Nr   r   c                |   R p\         P                  ! V4      ;_uu_ 4        \        P                  ! V4      pRpV P                  P                  W4      pW2n        WBn        V\        P                  V&   V P                   P                  V4      pV P                  WT4       RRR4       R#   + '       g   i     R# ; isome_modz	a loader!N)r   uncacherG   rH   r5   r6   rb   r]   sysmodulesr   r   r   rI   r0   rc   r;   founds   &     r   test_sys_modulesFindSpecTests.test_sys_modules   s    \\$%%d+F F>>,,T:D &"O &CKKII''-EU)  s   A?B**B;	c                t   R p\         P                  ! V4      ;_uu_ 4        \        P                  ! V4      pV=RpV P
                  P                  W4      pWBn        V\        P                  V&   V P                   P                  V4      pV P                  WT4       RRR4       R#   + '       g   i     R# ; ir   )r   r   rG   rH   rb   r5   r6   r]   r   r   r   r   r   s   &     r   #test_sys_modules_without___loader__1FindSpecTests.test_sys_modules_without___loader__   s    \\$%%d+F! F>>,,T:D"O &CKKII''-EU)  s   A;B&&B7	c           	        R p\         P                  ! V4      ;_uu_ 4        \        P                  ! V4      pRVn        V\
        P                  V&   V P                  \        4      ;_uu_ 4        V P                   P                  V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; ir   N)
r   r   rG   rH   r]   r   r   r7   
ValueErrorr   r   rI   r0   s   &  r   test_sys_modules_spec_is_None+FindSpecTests.test_sys_modules_spec_is_None   s    \\$%%d+F"FO &CKK"":..		##D) /	   /.	  s$   AB0/B	B0B-(B00C	c                n   R p\         P                  ! V4      ;_uu_ 4        \        P                  ! V4      pV P                  P                  VR4      pW2n        V\        P                  V&   V P                   P                  V4      pV P                  WC4       RRR4       R#   + '       g   i     R# ; ir   )r   r   rG   rH   r5   r6   r]   r   r   r   r   )r   rI   r0   r;   r   s   &    r   test_sys_modules_loader_is_None-FindSpecTests.test_sys_modules_loader_is_None   s    \\$%%d+F>>,,T48D"O &CKKII''-EU)  s   A8B##B4	c           	        R p\         P                  ! V4      ;_uu_ 4        \        P                  ! V4      p V=V\        P                  V&   V P                  \        4      ;_uu_ 4        V P                   P                  V4       RRR4       RRR4       R#   \
         d     Lki ; i  + '       g   i     L+; i  + '       g   i     R# ; ir   )r   r   rG   rH   r]   AttributeErrorr   r   r7   r   r   r   s   &  r    test_sys_modules_spec_is_not_set.FindSpecTests.test_sys_modules_spec_is_not_set   s    \\$%%d+FO !'CKK"":..		##D) /   "  /.  sE   B=B0B=+B*	B=B'$B=&B''B=*B:5B==C	c           
     h   R p\         P                  ! V4      ;_uu_ 4        \         P                  ! V P                  .R7      ;_uu_ 4        V P	                  VRR3V P                   P                  V4      4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   )	meta_pathN)r   r   import_stater   r   r   )r   rI   s   & r   test_successFindSpecTests.test_success   sz    \\$""d.A.A-BCC  $d!3!%!4!4T!:< D  CC  s#   +B /B	;B BB  B1	c                Z    V P                  V P                  P                  R 4      4       R# )nevergoingtofindthismoduleN)assertIsNoner   r   r   s   &r   test_nothingFindSpecTests.test_nothing   s     $))--.JKLr   c                   R pRp\         P                  ! VRR7      ;_uu_ 4       p\         P                  ! WV4      w  rEV P                   P                  V4      pV P	                  VR4       V P                  V\        \        P                  4      4       V P                  V\        \        P                  4      4       V P                   P                  V4      pV P                  Wv4       RRR4       R#   + '       g   i     R# ; ir   hamTpkgNr   temp_module	submoduler   assertIsNotassertInsortedr   r   assertNotInr   r   rI   subnamepkg_dirfullname_r;   
spec_agains   &       r   test_find_submodule!FindSpecTests.test_find_submodule   s    d--..@KH99&&x0DT4(MM$s{{ 34Xvckk':;,,X6JZ. .---s   CC44D	c                F   R pRp\         P                  ! VRR7      ;_uu_ 4       pV P                  P                  V4       \         P                  ! WV4      w  rEV P                   P                  V4      pV P                  VR4       V P                  V\        \        P                  4      4       V P                  V\        \        P                  4      4       V P                   P                  V4      pV P                  Wv4       RRR4       R#   + '       g   i     R# ; ir   )r   r   initimport_moduler   r   r   r   r   r   r   r   r   r   s   &       r   +test_find_submodule_parent_already_imported9FindSpecTests.test_find_submodule_parent_already_imported  s    d--II##D)..@KH99&&x0DT4(MM$s{{ 34Xvckk':;,,X6JZ. .---s   C DD 	c                "   R pRp\         P                  ! VRR7      ;_uu_ 4       p\         P                  ! WV4      w  rERV,           pV P                   P                  Wa4      pV P	                  VR4       V P                  V\        \        P                  4      4       V P                  V\        \        P                  4      4       V P                   P                  V4      pV P                  W4       RRR4       R#   + '       g   i     R# ; ir   r   Tr   .Nr   )	r   rI   r   r   r   r   relnamer;   r   s	   &        r   test_find_relative_module'FindSpecTests.test_find_relative_module  s    d--..@KHGmG99&&w5DT4(MM$s{{ 34Xvckk':;,,X6JZ. .---s   CC==D	c           	        R pRp\         P                  ! VRR7      ;_uu_ 4       p\         P                  ! WV4      w  rERV,           pV P                  \        4      ;_uu_ 4        V P                   P                  V4       RRR4       V P                  V\        \        P                  4      4       V P                  V\        \        P                  4      4       RRR4       R#   + '       g   i     Ll; i  + '       g   i     R# ; ir   )
r   r   r   r7   r8   r   r   r   r   r   )r   rI   r   r   r   r   r   s   &      r   )test_find_relative_module_missing_package7FindSpecTests.test_find_relative_module_missing_package#  s    d--..@KHGmG"";//		##G, 0T6#++#67Xvckk':; .- 0/ .--s%   A C8%C%	AC8%C50C88D		c                    V P                  \        4      ;_uu_ 4        V P                  P                  R 4       RRR4       R#   + '       g   i     R# ; i)zmodule.nameN)r7   ModuleNotFoundErrorr   r   r   s   &r   test_find_submodule_in_module+FindSpecTests.test_find_submodule_in_module.  s7     233II. 4333   AA	r    N)r!   r"   r#   r$   r   r   r   r   r   r   r   r   r   r   r   r   r   r%   r&   r'   s   @r   r   r      sS     O O
*
***
*<M///	</ /r   r   )r   r   r5   c                   ,   a  ] tR tRt o R tR tRtV tR# )MagicNumberTestsi;  c                d    V P                  \        V P                  P                  4      ^4       R# )   N)r   lenr   MAGIC_NUMBERr   s   &r   test_lengthMagicNumberTests.test_length=  s!    TYY334a8r   c                R    V P                  V P                  P                  R 4       R# )s   
N)assertEndsWithr   r   r   s   &r   test_incorporates_rn%MagicNumberTests.test_incorporates_rnA  s    DII22G<r   r    N)r!   r"   r#   r$   r   r   r%   r&   r'   s   @r   r   r   ;  s     9= =r   r   c                   "  a  ] tR tRt o ]P
                  P                  t]P                  ! ]P
                  P                  RJ R4      R 4       t
R tR tR tR tR	 tR
 tR tR tR t]P(                  ! ]P,                  R8H  ;'       d    ]P.                  R8H  R4      R 4       t]P                  ! ]P
                  P                  RJ R4      R 4       t]P                  ! ]P
                  P                  RJ R4      R 4       tR tR tR tR tR tR t R t!R t"R t#]P                  ! ]P
                  P                  RJ R4      R 4       t$]P                  ! ]P
                  P                  RJ R4      R 4       t%]P                  ! ]P
                  P                  RJ R4      R  4       t&]P                  ! ]P
                  P                  RJ R4      R! 4       t']P                  ! ]P
                  P                  RJ R4      R" 4       t(R#t)V t*R# )$PEP3147TestsiK  Nz1requires sys.implementation.cache_tag not be Nonec           	        \         P                  P                  R RRR4      p\         P                  P                  R RRRRP                  V P                  4      4      pV P                  V P                  P                  VRR7      V4       R# 	foobarbazqux.py__pycache__
qux.{}.pycr   optimizationNosr   r   formattagr   r   cache_from_sourcer   r   expects   &  r   test_cache_from_source#PEP3147Tests.test_cache_from_sourceQ  so    
 ww||E5%:eUE=*11$((;=44T4K	!r   c           	     D   \         P                  ! \        P                  R R4      ;_uu_ 4        V P	                  \
        4      ;_uu_ 4        V P                  P                  R4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)	cache_tagNzwhatever.py)r   	swap_attrr   implementationr7   NotImplementedErrorr   r  r   s   &r   #test_cache_from_source_no_cache_tag0PEP3147Tests.test_cache_from_source_no_cache_tag\  sc    s11;EE""#677		++M: 8 FE77 FEEs#   BA;	)B;BBB	c                   \         P                  P                  R R4      p\         P                  P                  R RRP                  V P                  4      4      pV P                  V P                  P                  VRR7      V4       R# )zfoo.barfiler  z
file{}.pycr   r  Nr
  r  s   &  r   test_cache_from_source_no_dot*PEP3147Tests.test_cache_from_source_no_dotb  se    ww||Iv.i*11$((;=44T4K	!r   c           
        \         P                  P                  R RRR4      p\        P                  ! 4       ;_uu_ 4        \        P
                  ! R4       V P                  V P                  P                  VR4      V P                  P                  V^R7      4       V P                  V P                  P                  VR4      V P                  P                  VRR7      4       R	R	R	4       \        P                  ! 4       ;_uu_ 4        \        P
                  ! R
4       V P                  \        4      ;_uu_ 4        V P                  P                  VR4       R	R	R	4       V P                  \        4      ;_uu_ 4        V P                  P                  VR4       R	R	R	4       R	R	R	4       R	#   + '       g   i     L; i  + '       g   i     Lo; i  + '       g   i     L@; i  + '       g   i     R	# ; i)r  r  r  r  ignoreFr  Tr   Nerror)r  r   r   warningscatch_warningssimplefilterr   r   r  r7   DeprecationWarningr   r   s   & r   %test_cache_from_source_debug_override2PEP3147Tests.test_cache_from_source_debug_overridej  sR    ww||E5%:$$&&!!(+TYY88uE!YY88A8NPTYY88tD!YY88B8OQ	 ' $$&&!!'*""#566		++D%8 7""#566		++D$7 7	 '& '& 7666	 '&&sI    B%F/
4G(>G	%G( G	G(/F?	GG(G% G((G9	c                    R p\         P                  P                  RRP                  V P                  4      4      pV P                  V P                  P                  VRR7      V4       R# foo.pyr  z
foo.{}.pycr   r  Nr
  r  s   &  r   test_cache_from_source_cwd'PEP3147Tests.test_cache_from_source_cwd{  sQ    m\-@-@-JK44T4K	!r   c           
        \         P                  P                  R RR4      p ! R R4      p\        P                  ! 4       ;_uu_ 4        \        P
                  ! R4       V P                  V P                  P                  V. 4      V P                  P                  V^R7      4       V P                  V P                  P                  V^.4      V P                  P                  VRR7      4       V P                  \        4      ;_uu_ 4        V P                  P                  RV! 4       4       R	R	R	4       R	R	R	4       R	#   + '       g   i     L; i  + '       g   i     R	# ; i)
r  r  zbaz.pyc                   &   a  ] tR tRt o R tRtV tR# )=PEP3147Tests.test_cache_from_source_override.<locals>.Bearishi  c                    \         hr/   )RuntimeErrorr   s   &r   __bool__FPEP3147Tests.test_cache_from_source_override.<locals>.Bearish.__bool__  s    l 2r   r    N)r!   r"   r#   r$   r2  r%   r&   r'   s   @r   Bearishr/    s     22r   r4  r  r  r   z/foo/bar/baz.pyN)r  r   r   r!  r"  r#  r   r   r  r7   r1  )r   r   r4  s   &  r   test_cache_from_source_override,PEP3147Tests.test_cache_from_source_override  s     ww||E5(3	3 	3$$&&!!(+TYY88rB!YY88A8NPTYY88tD!YY88B8OQ""<00		++,=wyI 1 '& 10 '&&s%   	CE"E 	.E EEE$	c                    R p\         P                  P                  RRP                  V P                  4      4      pV P                  V P                  P                  VRR7      V4       R# r)  r
  r  s   &  r   0test_cache_from_source_optimization_empty_string=PEP3147Tests.test_cache_from_source_optimization_empty_string  sQ    m\-@-@-JK44T4K	!r   c                   R p\         P                  P                  p\        P                  P                  RRP                  V P                  4      4      pV^ 8X  d   VR,           pMBV^8:  d   VRP                  V4      ,           pM"RP                  V4      pV P                  V4       V P                  V P                  P                  VRR7      X4       R# )r*  r  foo.{}.pyc.opt-{}.pycz){!r} is a non-standard optimization levelNr  )r   flagsoptimizer  r   r   r  r  skipTestr   r   r  )r   r   optimization_levelalmost_expectr  msgs   &     r   (test_cache_from_source_optimization_None5PEP3147Tests.test_cache_from_source_optimization_None  s      YY//]HOODHH4MN""V+F1$"]%9%9:L%MMF=DDEWXCMM#44T4M	!r   c                d   R p\         P                  \         P                  ,           p\        P                  P                  RRP                  V P                  4      4      pV P                  P                  WR7      pV P                  VVRP                  V4      ,           4       V P                  V P                  P                  V^*R7      VR,           4       V P                  \        4      ;_uu_ 4        V P                  P                  VRR7       RRR4       R#   + '       g   i     R# ; i)r*  r  r;  r  r=  z.opt-42.pyczpath/is/badN)stringascii_lettersdigitsr  r   r   r  r  r   r  r   r7   r   )r   r   valid_charactersrB  gots   &    r   'test_cache_from_source_optimization_set4PEP3147Tests.test_cache_from_source_optimization_set  s     !//&--?]HOODHH4MNii))$)N&)=)=>N)OO	Q 	44T4K&6	8 z**II''='I +***s   6DD/	c           
     T   \         P                  ! 4       ;_uu_ 4        \         P                  ! R 4       V P                  \        4      ;_uu_ 4        V P
                  P                  RRRR7       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r  r*  Fr   r  N)r!  r"  r#  r7   	TypeErrorr   r  r   s   &r   ;test_cache_from_source_debug_override_optimization_both_setHPEP3147Tests.test_cache_from_source_debug_override_optimization_both_set  si    $$&&!!(+""9--		++He"+M . '&-- '&&s#   4BB	1BBBB'	\/z/test meaningful only where os.altsep is definedc                    V P                  V P                  P                  R RR7      RP                  V P                  4      4       R# )z\foo\bar\baz/qux.pyr   r  z#\foo\bar\baz\__pycache__\qux.{}.pycN)r   r   r  r  r  r   s   &r   )test_sep_altsep_and_sep_cache_from_source6PEP3147Tests.test_sep_altsep_and_sep_cache_from_source  s=     	II''(@r'R6==dhhG	Ir   c           	     
   \         P                  ! R RRR4      p\        P                  P	                  R RRRRP                  V P                  4      4      pV P                  V P                  P                  VRR7      V4       R# r  )
pathlibPurePathr  r   r   r  r  r   r   r  r  s   &  r   $test_cache_from_source_path_like_arg1PEP3147Tests.test_cache_from_source_path_like_arg  sm     ueX>eUE=*11$((;=44T4K	!r   z4requires sys.implementation.cache_tag to not be Nonec           	        \         P                  P                  R RRRRP                  V P                  4      4      p\         P                  P                  R RRR4      pV P                  V P                  P                  V4      V4       R# r  r  r  r  r  r  Nr  r   r   r  r  r   r   source_from_cacher  s   &  r   test_source_from_cache#PEP3147Tests.test_source_from_cache  sg    
 ww||E5%(//9;eUE8<44T:FCr   c           	        \         P                  P                  R RR4      p\        P                  ! \
        P                  RR4      ;_uu_ 4        V P                  \        4      ;_uu_ 4        V P                  P                  V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)blahr  zwhatever.pycr  N)r  r   r   r   r  r   r  r7   r  r   r_  r%  s   & r   #test_source_from_cache_no_cache_tag0PEP3147Tests.test_source_from_cache_no_cache_tag  sy    ww||FM>Bs11;EE""#677		++D1 8 FE77 FEEs$   B/.B	
B/B,'B//C 	c                \    V P                  \        V P                  P                  R 4       R# )z/foo/bar/bazqux.pycNr7   r   r   r_  r   s   &r   test_source_from_cache_bad_path,PEP3147Tests.test_source_from_cache_bad_path  s%     			335J	Lr   c                \    V P                  \        V P                  P                  R 4       R# )zfoo.cpython-32.pycNrg  r   s   &r   test_source_from_cache_no_slash,PEP3147Tests.test_source_from_cache_no_slash  s#    		335I	Kr   c                \    V P                  \        V P                  P                  R 4       R# )z__pycache__/foo.pycNrg  r   s   &r   #test_source_from_cache_too_few_dots0PEP3147Tests.test_source_from_cache_too_few_dots  s#    		335J	Lr   c                    V P                  \        4      ;_uu_ 4        V P                  P                  R 4       RRR4       R#   + '       g   i     R# ; i)z(__pycache__/foo.cpython-32.opt-1.foo.pycNrg  r   s   &r   $test_source_from_cache_too_many_dots1PEP3147Tests.test_source_from_cache_too_many_dots  s8    z**II''>@ +***r   c                \    V P                  \        V P                  P                  R 4       R# )z"__pycache__/foo.cpython-32.foo.pycNrg  r   s   &r   test_source_from_cache_not_opt+PEP3147Tests.test_source_from_cache_not_opt  s"    		330	2r   c                \    V P                  \        V P                  P                  R 4       R# )z/foo/bar/foo.cpython-32.foo.pycNrg  r   s   &r   $test_source_from_cache_no__pycache__1PEP3147Tests.test_source_from_cache_no__pycache__  s"    		33-	/r   c                    \         P                  P                  R RP                  V P                  4      4      pV P                  V P                  P                  V4      R4       R# )r  zfoo.{}.opt-1.pycr*  Nr^  r%  s   & r   )test_source_from_cache_optimized_bytecode6PEP3147Tests.test_source_from_cache_optimized_bytecode  sE    ww||M+=+D+DTXX+NO44T:HEr   c                "   \         P                  P                  R RP                  V P                  4      4      pV P                  \        4      ;_uu_ 4        V P                  P                  V4       RRR4       R#   + '       g   i     R# ; i)r  zfoo.{}.opt-.pycN)	r  r   r   r  r  r7   r   r   r_  r%  s   & r   +test_source_from_cache_missing_optimization8PEP3147Tests.test_source_from_cache_missing_optimization
  sX    ww||M+<+C+CDHH+MNz**II''- +***s   A==B	c           	        \         P                  ! R RRRRP                  V P                  4      4      p\        P
                  P                  R RRR4      pV P                  V P                  P                  V4      V4       R# r]  )
rX  rY  r  r  r  r   r   r   r   r_  r  s   &  r   $test_source_from_cache_path_like_arg1PEP3147Tests.test_source_from_cache_path_like_arg  se     ue] , 3 3DHH =?eUE8<44T:FCr   c                ^   \         P                  P                  \         P                  P                  R R4      \         P                  P                  \         P                  P                  R R4      \         P                  P                  \         P                  P                  R R4      \         P                  P                  ,           .pRp\         P                  R8X  d"   RpV Uu. uF  q2 V 2NK
  	  ppVRR.,          pV F  pV P                  VR	7      ;_uu_ 4        V\         P                  P                  \         P                  P                  R
RRR4      ,           p\         P                  P                  VR
RRRP                  V P                  4      4      p\        P                  ! V4      ;_uu_ 4        V P                  V P                  P                  VRR7      V4       RRR4       RRR4       K  	  R# u upi   + '       g   i     L#; i  + '       g   i     EK(  ; i)tmpbytecodeu   ☃ztrailing-slashr   ntzC:z
\\?\C:\fooz\\localhost\c$\bar)r   r  r  r  r  r  r  N)r  r   r   seprI   subTestr  r  r   temporary_pycache_prefixr   r  )r   pycache_prefixesdriveprefixpycache_prefixr   r  s   &      r   .test_cache_from_source_respects_pycache_prefix;PEP3147Tests.test_cache_from_source_respects_pycache_prefix  s    GGLLeZ8GGLLeX6GGLLe-=>L

 77d?E1A C1Av'&"1A   C0E FF.N>22rww||GGKKuh @ @"E5% ''13 22>BB$$		33Dr3J  C 32 / C CB 322s+   'H!BH>.H,HHHH,c           
     <   \         P                  P                  \         P                  P                  R R4      p\         P                  P                  RRRR4      p\         P                  P	                  \         P
                  ! 4       4      ^ ,          \         P                  P                  ,           p\         P                  P                  V\         P                  P                  \         P
                  ! 4       V4      RRRRV P                   R24      p\        P                  ! V4      ;_uu_ 4        V P                  V P                  P                  VRR	7      \         P                  P                  V4      4       R
R
R
4       R
#   + '       g   i     R
# ; i)r  r  r  r  r  r  qux.r<  r   r  N)r  r   r   r  
splitdrivegetcwdrelpathr  r   r  r   r  normpath)r   r  r   rootr  s   &    r   7test_cache_from_source_respects_pycache_prefix_relativeDPEP3147Tests.test_cache_from_source_respects_pycache_prefix_relative5  s    bggkk5*Eww||E5%:ww!!"))+.q1BGGKK?GGOOBIIK.5%4z!68 **>::		++Dr+B  (* ;:::s   5AF

F	c           	        \         P                  P                  \         P                  P                  R R4      p\         P                  P                  VRRRRV P                   R24      p\         P                  P                  \         P                  P                  RRRR4      p\
        P                  ! V4      ;_uu_ 4        V P                  V P
                  P                  V4      V4       RRR4       R#   + '       g   i     R# ; i)	r  r  r  r  r  r  r<  r  N	r  r   r   r  r  r   r  r   r_  r   r  r   r  s   &   r   ,test_source_from_cache_inside_pycache_prefix9PEP3147Tests.test_source_from_cache_inside_pycache_prefixG  s     bggkk5*Eww||NE5%"488*D13bggkk5%I**>::TYY88>G ;:::s   ,C::D	c           	        \         P                  P                  \         P                  P                  R R4      p\         P                  P                  RRRRRV P                   R24      p\         P                  P                  RRRR4      p\
        P                  ! V4      ;_uu_ 4        V P                  V P
                  P                  V4      V4       R	R	R	4       R	#   + '       g   i     R	# ; i)
r  r  r  r  r  r  r  r<  r  Nr  r  s   &   r   -test_source_from_cache_outside_pycache_prefix:PEP3147Tests.test_source_from_cache_outside_pycache_prefixT  s     bggkk5*Eww||E5%"488*D13eUE8<**>::TYY88>G ;:::s   +,C!!C2	r    )+r!   r"   r#   r$   r   r  r  r  unittestskipIfr  r  r  r&  r+  r5  r8  rD  rL  rP  
skipUnlessr  r  altseprU  rZ  r`  rd  rh  rk  rn  rq  rt  rw  rz  r}  r  r  r  r  r  r%   r&   r'   s   @r   r   r   K  si     


&
&C__S''11T9HJ!J!;!8"!J$!! J"N 4<<BII,<FHIHI __S''11T9HJ!J! __S''11T9KMDMD2LK
L
@
2/F
. __S''11T9KMDMD __S''11T9KM M 6 __S''11T9KM*M*  __S''11T9KM	HM	H __S''11T9KM	HM	Hr   r   c                      a  ] tR tRt o ]P
                  ! ]P                  P                  R9   R4      R 4       t	Rt
V tR# )r   ig  z8only applies to candidate or final python release levelsc                    R p\         P                  \        P                  P                  R,          R4      pRpV P                  WV4       R# )i+  :N   Nlittlea  To avoid breaking backwards compatibility with cached bytecode files that can't be automatically regenerated by the current user, candidate and final releases require the current  importlib.util.MAGIC_NUMBER to match the expected magic number in this test. Set the expected magic number in this test to the current MAGIC_NUMBER to continue with the release.

Changing the MAGIC_NUMBER for a maintenance release requires discussion in python-dev and notification of community stakeholders.N)int
from_bytesr   r   r   r   )r   EXPECTED_MAGIC_NUMBERactualrC  s   &   r   test_magic_number"MagicNumberTests.test_magic_numberk  sF    & !%	 ; ;B ?J	& 	 	.<r   r    N)	candidatefinal)r!   r"   r#   r$   r  r  r   version_inforeleaselevelr  r%   r&   r'   s   @r   r   r   g  s<      %%)??B=	=r   zsubinterpreters requiredc                      a  ] tR tRt o R tR t]P                  ! ]RJ R4      ]	P                  ! 4       R 4       4       t]P                  ! ]RJ R4      ]	P                  ! R4      R	 4       4       t]P                  ! ]RJ R4      R
 4       tRtV tR# ),IncompatibleExtensionModuleRestrictionsTestsi  c                   a \         P                  ! R 4      oV3R lpV P                  V4       \         P                  ! SV4      pVe3   VP                  P
                  R8X  d   \        VP                  4      hR# R# )isolatedc                  n   <  \         P                  ! S 4       R #   \         P                   d     R # i ; ir/   _interpretersdestroyInterpreterNotFoundErrorinterpids   r   ensure_destroyedWIncompatibleExtensionModuleRestrictionsTests.run_with_own_gil.<locals>.ensure_destroyed  .    %%h/ 99     44Nr8   r  create
addCleanupexectyper!   r8   rC  r   scriptr  excsnapr  s   &&  @r   run_with_own_gil=IncompatibleExtensionModuleRestrictionsTests.run_with_own_gil  sj     ''
3	
 	()$$Xv6||$$5!'++.. 6 r   c                   a \         P                  ! R 4      oV3R lpV P                  V4       \         P                  ! SV4      pVe3   VP                  P
                  R8X  d   \        VP                  4      hR# R# )legacyc                  n   <  \         P                  ! S 4       R #   \         P                   d     R # i ; ir/   r  r  s   r   r  ZIncompatibleExtensionModuleRestrictionsTests.run_with_shared_gil.<locals>.ensure_destroyed  r  r  Nr8   r  r  s   &&  @r   run_with_shared_gil@IncompatibleExtensionModuleRestrictionsTests.run_with_shared_gil  sj     ''1	
 	()$$Xv6||$$5!'++.. 6 r   Nz%test requires _testsinglephase modulec           	     v   \         P                  ! R 4      pV P                  R4      ;_uu_ 4        V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V P	                  V4       RRR4       \         P                  ! R4      pV P                  R4      ;_uu_ 4        V P                  \        4      ;_uu_ 4        V P                  V4       RRR4       RRR4       V P                  R4      ;_uu_ 4        V P                  \        4      ;_uu_ 4        V P	                  V4       RRR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lg; i  + '       g   i     R# ; i)z
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=True):
                import _testsinglephase
            check disabled, shared GILN#check disabled, per-interpreter GILz
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=False):
                import _testsinglephase
            check enabled, shared GIL"check enabled, per-interpreter GIL)textwrapdedentr  r  r  r7   r8   r   r  s   & r   test_single_phase_init_moduleJIncompatibleExtensionModuleRestrictionsTests.test_single_phase_init_module  s*   
  " 
 \\677$$V, 8\\?@@!!&) A  & 
 \\566"";//((0 0 7 \\>??"";//%%f- 0 @? 877@@ 0/ 76 0/ @??s_   E#E,F
E.	FF'#F	5F'E	E+	.E>9FF	F$F''F8	z$test requires _testmultiphase modulez/gh-117649: not supported in free-threaded buildc           	        \         P                  '       d   R pMRp\        P                  ! RV R\        P
                  : RV R24      pV\        P                  ! R4      ,           pV P                  R4      ;_uu_ 4        V P                  V4       RRR4       V P                  R	4      ;_uu_ 4        V P                  V4       RRR4       V\        P                  ! R
4      ,           pV P                  R4      ;_uu_ 4        V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V P                  \        4      ;_uu_ 4        V P                  V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     LS; i  + '       g   i     R# ; i)AppleFrameworkLoaderExtensionFileLoaderzw
            from importlib.util import spec_from_loader, module_from_spec
            from importlib.machinery import zD

            name = '_test_shared_gil_only'
            filename = z
            loader = zP(name, filename)
            spec = spec_from_loader(name, loader)

            a  
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=True):
                module = module_from_spec(spec)
                loader.exec_module(module)
            r  Nr  a  
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=False):
                module = module_from_spec(spec)
                loader.exec_module(module)
            r  r  )r   is_apple_mobiler  r  _testmultiphaseru   r  r  r  r7   r8   )r   rc   	prescriptr  s   &   r   'test_incomplete_multi_phase_init_moduleTIncompatibleExtensionModuleRestrictionsTests.test_incomplete_multi_phase_init_module  sk   
 """+F*FOO )--3H 5 (003 4X 	% 		 X__ .   \\677$$V, 8\\?@@!!&) A X__ .   \\566$$V, 7\\>??"";//%%f- 0 @? 87@@ 76 0/ @??sH   E94FF7GF2	'G9F		F	F/	2G=GG	c                   \         P                  ! R 4      pV P                  R4      ;_uu_ 4        V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V P	                  V4       RRR4       \         P                  ! R4      pV P                  R4      ;_uu_ 4        V P                  V4       RRR4       V P                  R4      ;_uu_ 4        V P	                  V4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lk; i  + '       g   i     R# ; i)z
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=True):
                import _testmultiphase
            r  Nr  z
            from importlib.util import _incompatible_extension_module_restrictions
            with _incompatible_extension_module_restrictions(disable_check=False):
                import _testmultiphase
            r  r  )r  r  r  r  r  r  s   & r   %test_complete_multi_phase_init_moduleRIncompatibleExtensionModuleRestrictionsTests.test_complete_multi_phase_init_module  s     " 
 \\677$$V, 8\\?@@!!&) A  & 
 \\566$$V, 7\\>??!!&) @? 87@@ 76???s/   C;#D,D!D4;D	D	!D1	4E	r    )r!   r"   r#   r$   r  r  r  r  _testsinglephaser    expected_failure_if_gil_disabledr  r  requires_gil_enabledr  r  r%   r&   r'   s   @r   r  r    s     // __%-/VW --/. 0 X.. ___,.TU!!"ST(. U V(.T ___,.TU* V*r   r  c                   &   a  ] tR tRt o R tRtV tR# )	MiscTestsi  c                  aaa ^ RI p\        P                  oRo^doVVV3R lp\        P                  ! \
        RV4      ;_uu_ 4        \        P                  ! \        RV4      ;_uu_ 4        V P                  \        4      ;_uu_ 4        RS^,          ,          p\
        P                  ! \        P                  V4       RRR4       RRR4       RRR4       V P                  \        4      ;_uu_ 4        \        P                  ! \        P                  P                  4       RRR4       R#   + '       g   i     Lv; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r   NFc                    < R oS! WRS 4      # )TNr    )fddataoldwrite
seen_writetruncate_at_lengths   &&r   writeJMiscTests.test_atomic_write_should_notice_incomplete_writes.<locals>.write  s    JB%8&8 9::r   _ior     x)_pyior  r  r   r  r   r7   OSError_write_atomicr   TESTFNstat)r   r  r  contentr  r  r  s   &   @@@r   1test_atomic_write_should_notice_incomplete_writes;MiscTests.test_atomic_write_should_notice_incomplete_writes  s    88
 	;  3UEBBGU33""7++ "4q"89#11)2B2BGL	 , 4 C w''GGG%%,,- (' ,+ 43 CB (''sH   %E-E	6D/E		E6/E(/D?:E	EEE%	(E9	r    N)r!   r"   r#   r$   r  r%   r&   r'   s   @r   r  r    s     . .r   r  __main__)5test.test_importlibr   import_importlibrE   r   r5   importlib_utilimportlib.utilr   r   r  rX  rG  r   r4   r   test.supportr   r  rG   r  unittest.mockr!  r  r8   r  r  r   r	   	test_bothFrozen_DecodeSourceBytesTestsSource_DecodeSourceBytesTestsr*   Frozen_ModuleFromSpecTestsSource_ModuleFromSpecTestsr~   Frozen_ResolveNameTestsSource_ResolveNameTestsr   Frozen_FindSpecTestsSource_FindSpecTestsr   Frozen_MagicNumberTestsSource_MagicNumberTestsr   Frozen_PEP3147TestsSource_PEP3147TestsTestCaser  r  r  r!   mainr    r   r   <module>r     s=   $
O,[)!!"78	&&'78  ) 	   
  "     
@ @. 
^^*@F9 F9T 	NN&C9&(
6 6F 
^^$>:@/ @/J 
^^M>#,.
= = 
^^$>:TH THr 
^^L~6&=x(( &=R 
$&(BCw*83D3D w* Dw*t.!! .< zMMO c    O  Ms6   
G G% G5 	G"!G"%	G21G25	HH