ó
    F\hÅ  ã                   ó  • S SK r S SKrS SKrS SKrS SKrS SKrS rSSSS.S jjrS r " S S	\	5      r
\ R                  S
 5       r\ R                  S\S4S j5       r\ R                  S 5       rSS jr\ R                  S 5       rS rg)é    Nc                 óÀ   • [         R                  " 5          [         R                  " S[        S9  [        R
                  " U 5      sSSS5        $ ! , (       d  f       g= f)z3Import *name* while suppressing DeprecationWarning.Úignore©ÚcategoryN)ÚwarningsÚcatch_warningsÚsimplefilterÚDeprecationWarningÚ	importlibÚimport_module)Únames    Ú3/usr/lib/python3.13/test/support/warnings_helper.pyÚimport_deprecatedr   	   s9   € ä	×	 Ò	 Õ	"Ü×Ò˜hÔ1CÒDÜ×&Ò& tÓ,÷ 
#×	"×	"ús   –/AÁ
AÚ é   ©ÚlinenoÚoffsetc          	      ó0  • SSK Jn  [        R                  " SS9 n[        R                  " S[
        5        [        USS5        S S S 5        U R                  [        W5      SU5        Uu  nU R                  [        UR                  [
        5      UR                  5        U(       a%  U R                  [        UR                  5      U5        U R                  UR                  S5        U R!                  UR"                  5        Ub  U R                  UR"                  U5        [        R                  " SS9 n[        R                  " S	[
        5        U" XUX4S
9  S S S 5        U R                  U/ 5        g ! , (       d  f       GN8= f! , (       d  f       N3= f)Nr   )Úcheck_syntax_errorT©ÚrecordÚalwaysz
<testcase>Úexecr   Úerrorr   )Útest.supportr   r   r   r	   ÚSyntaxWarningÚcompileÚassertEqualÚlenÚ
assertTrueÚ
issubclassr   ÚassertRegexÚstrÚmessageÚfilenameÚassertIsNotNoner   )ÚtestcaseÚ	statementÚerrtextr   r   r   ÚwarnsÚwarns           r   Úcheck_syntax_warningr-      s/  € õ 0Ü	×	 Ò	 ¨Ò	-°Ü×Ò˜h¬Ô6Ü�	˜<¨Ô0÷ 
.ð ×Ñœ˜U› Q¨Ô.à�E€DØ×Ñœ
 4§=¡=´-Ó@ØŸ™ô'æØ×ÑœS §¡Ó.°Ô8Ø×Ñ˜Ÿ™¨Ô5Ø×Ñ˜TŸ[™[Ô)ØÑØ×Ñ˜TŸ[™[¨&Ô1ô
 
×	 Ò	 ¨Ò	-°Ü×Ò˜g¤}Ô5Ù˜8°Ø"(ò	9÷ 
.ð
 ×Ñ˜ Õ#÷/ 
.Ö	-ú÷$ 
.Õ	-ús   ›)E5Ä6$FÅ5
FÆ
Fc                 ó   ^ • U 4S jnU$ )zˆDecorator to suppress warnings.

Use of context managers to hide warnings make diffs
more noisy and tools like 'git blame' less useful.
c                 óJ   >^ • [         R                  " T 5      UU 4S j5       nU$ )Nc                 ó¦   >• [         R                  " 5          [         R                  " STS9  T" U /UQ70 UD6sS S S 5        $ ! , (       d  f       g = f)Nr   r   )r   r   r	   )ÚselfÚargsÚkwargsr   Útests      €€r   ÚwrapperÚ3ignore_warnings.<locals>.decorator.<locals>.wrapper5   s=   ø€ ä×(Ò(Õ*Ü×%Ò% h¸ÒBÙ˜DÐ2 4Ò2¨6Ñ2÷ +×*×*ús   —!AÁ
A)Ú	functoolsÚwraps)r4   r5   r   s   ` €r   Ú	decoratorÚ"ignore_warnings.<locals>.decorator4   s%   ù€ Ü	�Š˜Ó	õ	3ó 
ð	3ð ˆó    © )r   r9   s   ` r   Úignore_warningsr=   .   s   ø€ õð Ðr;   c                   ó:   • \ rS rSrSrS rS r\S 5       rS r	Sr
g)	ÚWarningsRecorderé>   znConvenience wrapper for the warnings list returned on
entry to the warnings.catch_warnings() context manager.
c                 ó   • Xl         SU l        g )Nr   ©Ú	_warningsÚ_last)r1   Úwarnings_lists     r   Ú__init__ÚWarningsRecorder.__init__B   s   € Ø&ŒØˆ�
r;   c                 óÜ   • [        U R                  5      U R                  :”  a  [        U R                  S   U5      $ U[        R
                  R                  ;   a  g [        U < SU< 35      e)Néÿÿÿÿz has no attribute )r    rC   rD   Úgetattrr   ÚWarningMessageÚ_WARNING_DETAILSÚAttributeError)r1   Úattrs     r   Ú__getattr__ÚWarningsRecorder.__getattr__F   sT   € Üˆt�~‰~Ó §¡Ó+Ü˜4Ÿ>™>¨"Ñ-¨tÓ4Ð4Ø”X×,Ñ,×=Ñ=Ó=ØÜ»ºtÐDÓEÐEr;   c                 ó4   • U R                   U R                  S  $ ©NrB   ©r1   s    r   r   ÚWarningsRecorder.warningsM   s   € à�~‰~˜dŸj™j˜kÐ*Ð*r;   c                 ó8   • [        U R                  5      U l        g rR   )r    rC   rD   rS   s    r   ÚresetÚWarningsRecorder.resetQ   s   € Ü˜Ÿ™Ó(ˆ�
r;   )rD   rC   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rF   rO   Úpropertyr   rV   Ú__static_attributes__r<   r;   r   r?   r?   >   s+   † ñòòFð ñ+ó ð+õ)r;   r?   c                  ód   • UR                  S5      nU (       d  S[        44n Uc  Sn[        X5      $ )at  Context manager to silence warnings.

Accept 2-tuples as positional arguments:
    ("message regexp", WarningCategory)

Optional argument:
 - if 'quiet' is True, it does not fail if a filter catches nothing
    (default True without argument,
     default False if some filters are defined)

Without argument, it defaults to:
    check_warnings(("", Warning), quiet=True)
Úquietr   T)ÚgetÚWarningÚ_filterwarnings)Úfiltersr3   r`   s      r   Úcheck_warningsre   U   s6   € ð �J‰J�wÓ€EÞØœ�=Ð"ˆà‰=ØˆEÜ˜7Ó*Ð*r;   Fc              #   óè   #   • SSK Jn  [        R                  " SS9 n[        R                  " SUUS9  Sv •  U(       a  U" 5         SSS5        U R                  W/ 5        g! , (       d  f       N!= f7f)a±  Context manager to check that no warnings are emitted.

This context manager enables a given warning within its scope
and checks that no warnings are emitted even with that warning
enabled.

If force_gc is True, a garbage collection is attempted before checking
for warnings. This may help to catch warnings emitted when objects
are deleted, such as ResourceWarning.

Other keyword arguments are passed to warnings.filterwarnings().
r   )Ú
gc_collectTr   r   )r%   r   N)r   rg   r   r   Úfilterwarningsr   )r(   r%   r   Úforce_gcrg   r+   s         r   Úcheck_no_warningsrj   m   s\   é € õ (Ü	×	 Ò	 ¨Ò	-°Ü×Ò Ø(/Ø)1ò	3ó 	ÞÙŒL÷ 
.ð ×Ñ˜ Õ#÷ 
.Õ	-üs   ‚A2�)A!ÁA2Á!
A/Á+A2c              #   óf   #   • [        U [        SS9   Sv •  SSS5        g! , (       d  f       g= f7f)a  Context manager to check that no ResourceWarning is emitted.

Usage:

    with check_no_resource_warning(self):
        f = open(...)
        ...
        del f

You must remove the object which may emit ResourceWarning before
the end of the context manager.
T)r   ri   N)rj   ÚResourceWarning)r(   s    r   Úcheck_no_resource_warningrm   †   s"   é € ô 
˜8¬oÈÓ	MÛ÷ 
N×	MÖ	Müs   ‚1’ —	1 
.ª1c              #   óD  #   • [         R                  " S5      nUR                  R                  S5      nU(       a  UR	                  5         [
        R                  " SS9 n[         R                  S   R                  S5        [        U5      v •  SSS5        [        W5      n/ nU  H³  u  pxSn	USS  Hu  nUR                  n
[        R                  " U[        U
5      [        R                  5      (       d  ME  [!        U
R"                  U5      (       d  Mb  Sn	UR%                  U5        Mw     U	(       a  MŽ  U(       a  M—  UR'                  XxR(                  45        Mµ     U(       a  [+        S	US
   -  5      eU(       a  [+        SUS
   -  5      eg! , (       d  f       GN= f7f)zªCatch the warnings, then check if all the expected
warnings have been raised and re-raise unexpected warnings.
If 'quiet' is True, only re-raise the unexpected warnings.
é   Ú__warningregistry__Tr   r   r   NFzunhandled warning %sr   z)filter (%r, %s) did not catch any warning)ÚsysÚ	_getframeÚ	f_globalsra   Úclearr   r   Úmodulesr	   r?   Úlistr%   ÚreÚmatchr$   ÚIr"   Ú	__class__ÚremoveÚappendrX   ÚAssertionError)rd   r`   ÚframeÚregistryÚwÚreraiseÚmissingÚmsgÚcatÚseenÚwarnings              r   rc   rc   ˜   sK  é € ô �MŠM˜!Ó€EØ�‰×"Ñ"Ð#8Ó9€HÞØ�‰ÔÜ	×	 Ò	 ¨Ò	-°ô 	�‰�JÑ×,Ñ,¨XÔ6Ü˜qÓ!Ò!÷ 
.ô �1‹g€GØ€GÛ‰ˆØˆØ™“ˆAØ—i‘iˆGä—’˜œc '›l¬B¯D©D×1Ó1Ü˜7×,Ñ,¨c×2Ó2Ø�Ø—‘˜qÖ!ñ ÷ ˆtŸE˜Eà�N‰N˜C§¡Ð.Ö/ñ ö ÜÐ3°g¸a±jÑ@ÓAÐAÞÜÐHØ$ Q™Zñ(ó )ð 	)ð ÷/ 
.Ö	-üs8   ‚AF Á0FÂA$F Ã7F ÄF Ä4F Ä=AF Æ
FÆF c               #   ó’   #   • [         R                  S S  n  S v •  U [         R                  S S & g ! U [         R                  S S & f = f7frR   )r   rd   )Úold_filterss    r   Úsave_restore_warnings_filtersr‰   ¿   s=   é € ä×"Ñ"¡1Ð%€Kð*Ûà)Œ×Ñ™Ñø˜kŒ×Ñ™Ñüs   ‚A—/ ›A¯AÁAc                  ó8   • [         R                  " S[        SS9  g )Nz€This is used in test_support test to ensure support.ignore_deprecations_from() works as expected. You should not be seeing this.r   )Ú
stacklevel)r   r,   r
   r<   r;   r   Ú_warn_about_deprecationrŒ   È   s   € Ü‡M‚Mð	*ô 	Øór;   )r   )F)Ú
contextlibr7   r   rw   rq   r   r   r-   r=   Úobjectr?   Úcontextmanagerre   rb   rj   rm   rc   r‰   rŒ   r<   r;   r   Ú<module>r�      s¶   ðÛ Û Û Û 	Û 
Û ò-ð$Ø#$¨Tö$ò<ô )�vô )ð. ×Ññ+ó ð+ð. ×ÑØ(*°WÀuó $ó ð$ð0 ×Ññó ðô"$)ðN ×Ññ*ó ð*ór;   