§
    *‚KgÑ  ã                   ó  — d dl Z d dlZd dlZd dlZd dlZd dlZd„ Zddddœd„Zd„ Z G d„ d	e	¦  «        Z
e j        d
„ ¦   «         Ze j        dedfd„¦   «         Ze j        d„ ¦   «         Zdd„Ze j        d„ ¦   «         Zd„ ZdS )é    Nc                 óº   — t          j        ¦   «         5  t          j        dt          ¬¦  «         t	          j        | ¦  «        cddd¦  «         S # 1 swxY w Y   dS )z3Import *name* while suppressing DeprecationWarning.Úignore©ÚcategoryN)ÚwarningsÚcatch_warningsÚsimplefilterÚDeprecationWarningÚ	importlibÚimport_module)Únames    ú3/usr/lib/python3.11/test/support/warnings_helper.pyÚimport_deprecatedr   	   sš   € å	Ô	 Ñ	"Ô	"ð -ð -ÝÔ˜hÕ1CÐDÑDÔDÐDÝÔ& tÑ,Ô,ð-ð -ð -ð -ñ -ô -ð -ð -ð -ð -ð -ð -øøøð -ð -ð -ð -ð -ð -s   ”/AÁAÁAÚ é   ©ÚlinenoÚoffsetc                óJ  — ddl m} t          j        d¬¦  «        5 }t          j        dt
          ¦  «         t          |dd¦  «         d d d ¦  «         n# 1 swxY w Y   |                      t          |¦  «        d|¦  «         |\  }|  	                    t          |j        t
          ¦  «        |j        ¦  «         |r(|                      t          |j        ¦  «        |¦  «         |                      |j        d¦  «         |                      |j        ¦  «         |�|                      |j        |¦  «         t          j        d¬¦  «        5 }t          j        d	t
          ¦  «          || ||||¬
¦  «         d d d ¦  «         n# 1 swxY w Y   |                      |g ¦  «         d S )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Ð/Ð/Ð/Ð/Ð/Ý	Ô	 ¨Ð	-Ñ	-Ô	-ð 1°ÝÔ˜h­Ñ6Ô6Ð6Ý�	˜<¨Ñ0Ô0Ð0ð1ð 1ð 1ñ 1ô 1ð 1ð 1ð 1ð 1ð 1ð 1øøøð 1ð 1ð 1ð 1ð ×Ò�˜U™œ Q¨Ñ.Ô.Ð.à�E€DØ×Ò�
 4¤=µ-Ñ@Ô@Øœñ'ô 'ð 'àð 9Ø×Ò�S ¤Ñ.Ô.°Ñ8Ô8Ð8Ø×Ò˜œ¨Ñ5Ô5Ð5Ø×Ò˜Tœ[Ñ)Ô)Ð)ØÐØ×Ò˜Tœ[¨&Ñ1Ô1Ð1õ
 
Ô	 ¨Ð	-Ñ	-Ô	-ð 9°ÝÔ˜g¥}Ñ5Ô5Ð5ØÐ˜8 Y°Ø"(°ð	9ñ 	9ô 	9ð 	9ð9ð 9ð 9ñ 9ô 9ð 9ð 9ð 9ð 9ð 9ð 9øøøð 9ð 9ð 9ð 9ð
 ×Ò˜ Ñ#Ô#Ð#Ð#Ð#s#   œ,AÁAÁAÅ+FÆFÆ	Fc                 ó   ‡ — ˆ fd„}|S )z Decorator to suppress deprecation warnings.

    Use of context managers to hide warnings make diffs
    more noisy and tools like 'git blame' less useful.
    c                 óJ   •‡ — t          j        ‰ ¦  «        ˆˆ fd„¦   «         }|S )Nc                 ó¢   •— t          j        ¦   «         5  t          j        d‰¬¦  «          ‰| g|¢R i |¤Žcd d d ¦  «         S # 1 swxY w Y   d S )Nr   r   )r   r   r	   )ÚselfÚargsÚkwargsr   Útests      €€r   Úwrapperz3ignore_warnings.<locals>.decorator.<locals>.wrapper5   s©   ø€ åÔ(Ñ*Ô*ð 3ð 3ÝÔ% h¸ÐBÑBÔBÐBØ�t˜DÐ2 4Ð2Ð2Ð2¨6Ð2Ð2ð3ð 3ð 3ð 3ñ 3ô 3ð 3ð 3ð 3ð 3ð 3ð 3øøøð 3ð 3ð 3ð 3ð 3ð 3s   •"AÁAÁA)Ú	functoolsÚwraps)r4   r5   r   s   ` €r   Ú	decoratorz"ignore_warnings.<locals>.decorator4   s>   øø€ Ý	Œ˜Ñ	Ô	ð	3ð 	3ð 	3ð 	3ð 	3ñ 
Ô	ð	3ð ˆó    © )r   r8   s   ` r   Úignore_warningsr;   .   s$   ø€ ðð ð ð ð ð Ðr9   c                   ó:   — e Zd ZdZd„ Zd„ Zed„ ¦   «         Zd„ ZdS )ÚWarningsRecorderzyConvenience wrapper for the warnings list returned on
       entry to the warnings.catch_warnings() context manager.
    c                 ó"   — || _         d| _        d S )Nr   ©Ú	_warningsÚ_last)r1   Úwarnings_lists     r   Ú__init__zWarningsRecorder.__init__B   s   € Ø&ˆŒØˆŒ
ˆ
ˆ
r9   c                 óÄ   — t          | j        ¦  «        | j        k    rt          | j        d         |¦  «        S |t          j        j        v rd S t          | ›d|›�¦  «        ‚)Néÿÿÿÿz has no attribute )r    r@   rA   Úgetattrr   ÚWarningMessageÚ_WARNING_DETAILSÚAttributeError)r1   Úattrs     r   Ú__getattr__zWarningsRecorder.__getattr__F   s_   € ÝˆtŒ~ÑÔ ¤Ò+Ð+Ý˜4œ>¨"Ô-¨tÑ4Ô4Ð4Ø•XÔ,Ô=Ð=Ð=Ø�4Ý¸¸¸¸t¸tÐDÑEÔEÐEr9   c                 ó*   — | j         | j        d …         S ©Nr?   ©r1   s    r   r   zWarningsRecorder.warningsM   s   € àŒ~˜dœj˜k˜kÔ*Ð*r9   c                 ó8   — t          | j        ¦  «        | _        d S rM   )r    r@   rA   rN   s    r   ÚresetzWarningsRecorder.resetQ   s   € Ý˜œÑ(Ô(ˆŒ
ˆ
ˆ
r9   N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__rC   rK   Úpropertyr   rP   r:   r9   r   r=   r=   >   si   € € € € € ðð ðð ð ðFð Fð Fð ð+ð +ñ „Xð+ð)ð )ð )ð )ð )r9   r=   c                  ól   — |                      d¦  «        }| sdt          ff} |€d}t          | |¦  «        S )a˜  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   NT)ÚgetÚWarningÚ_filterwarnings)Úfiltersr3   rW   s      r   Úcheck_warningsr\   U   sC   € ð �JŠJ�wÑÔ€EØð Ø��=Ð"ˆàˆ=ØˆEÝ˜7 EÑ*Ô*Ð*r9   Fc              #   óê   K  — ddl m} t          j        d¬¦  «        5 }t          j        d||¬¦  «         dV — |r
 |¦   «          ddd¦  «         n# 1 swxY w Y   |                      |g ¦  «         dS )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   r^   r   r   Úfilterwarningsr   )r(   r%   r   Úforce_gcr^   r+   s         r   Úcheck_no_warningsra   m   sÞ   è è € ð (Ð'Ð'Ð'Ð'Ð'Ý	Ô	 ¨Ð	-Ñ	-Ô	-ð °ÝÔ Ø(/Ø)1ð	3ñ 	3ô 	3ð 	3ð 	ˆˆˆØð 	ØˆJ‰LŒLˆLðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð ×Ò˜ Ñ#Ô#Ð#Ð#Ð#s   ž(AÁAÁAc              #   ór   K  — t          | t          d¬¦  «        5  dV — ddd¦  «         dS # 1 swxY w Y   dS )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   r`   N)ra   ÚResourceWarning)r(   s    r   Úcheck_no_resource_warningrd   †   sŠ   è è € õ 
˜8­oÈÐ	MÑ	MÔ	Mð ð Øˆˆˆðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   š,¬0³0c              #   ó  K  — t          j        d¦  «        }|j                             d¦  «        }|r|                     ¦   «          t          j        d¬¦  «        5 }t           j        d                              d¦  «         t          |¦  «        V — ddd¦  «         n# 1 swxY w Y   t          |¦  «        }g }| D ]”\  }}d}	|dd…         D ]b}|j        }
t          j        |t          |
¦  «        t          j        ¦  «        r,t!          |
j        |¦  «        rd}	|                     |¦  «         Œc|	s|s|                     ||j        f¦  «         Œ•|rt+          d	|d
         z  ¦  «        ‚|rt+          d|d
         z  ¦  «        ‚dS )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_globalsrX   Úclearr   r   Úmodulesr	   r=   Úlistr%   ÚreÚmatchr$   ÚIr"   Ú	__class__ÚremoveÚappendrQ   ÚAssertionError)r[   rW   ÚframeÚregistryÚwÚreraiseÚmissingÚmsgÚcatÚseenÚwarnings              r   rZ   rZ   ˜   sì  è è € õ ŒM˜!ÑÔ€EØŒ×"Ò"Ð#8Ñ9Ô9€HØð Ø�ŠÑÔÐÝ	Ô	 ¨Ð	-Ñ	-Ô	-ð "°õ 	Œ�JÔ×,Ò,¨XÑ6Ô6Ð6Ý˜qÑ!Ô!Ð!Ð!Ð!ð"ð "ð "ñ "ô "ð "ð "ð "ð "ð "ð "øøøð "ð "ð "ð "õ �1‰gŒg€GØ€GØð 0ð 0‰ˆˆSØˆØ˜˜˜”ð 	"ð 	"ˆAØ”iˆGå”˜�c '™lœl­B¬DÑ1Ô1ð "Ý˜7Ô,¨cÑ2Ô2ð"à�Ø—’˜qÑ!Ô!Ð!øØð 	0˜Eð 	0à�NŠN˜C ¤Ð.Ñ/Ô/Ð/øØð BÝÐ3°g¸a´jÑ@ÑAÔAÐAØð )ÝÐHØ$ QœZñ(ñ )ô )ð 	)ð)ð )s   Á7BÂB#Â&B#c               #   óŠ   K  — t           j        d d …         } 	 d V — | t           j        d d …<   d S # | t           j        d d …<   w xY wrM   )r   r[   )Úold_filterss    r   Úsave_restore_warnings_filtersr€   ¿   sY   è è € åÔ" 1 1 1Ô%€Kð*Øˆˆˆà)�Ô˜˜˜ÑÐÐø˜k�Ô˜˜˜ÑÐ)Ð)Ð)Ð)s	   ˜/ ¯Ac                  ó>   — t          j        dt          d¬¦  «         d S )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:   r9   r   Ú_warn_about_deprecationrƒ   È   s2   € Ý„Mð	*õ 	Øðñ ô ð ð ð r9   )r   )F)Ú
contextlibr6   r   rn   rh   r   r   r-   r;   Úobjectr=   Úcontextmanagerr\   rY   ra   rd   rZ   r€   rƒ   r:   r9   r   ú<module>r‡      se  ðØ Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð Ø 	€	€	€	Ø 
€
€
€
Ø €€€ð-ð -ð -ð$Ø#$¨Tð$ð $ð $ð $ð $ð<ð ð ð )ð )ð )ð )ð )�vñ )ô )ð )ð. Ôð+ð +ñ Ôð+ð. ÔØ(*°WÀuð $ð $ð $ñ Ôð$ð0 Ôðð ñ Ôðð"$)ð $)ð $)ð $)ðN Ôð*ð *ñ Ôð*ðð ð ð ð r9   