HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/support/__pycache__/warnings_helper.cpython-310.opt-2.pyc
o

�i��@s�ddlZddlZddlZddlZddlZdddd�dd�Zdd�ZGd	d
�d
e�Zej	dd��Z
ej	ded
fdd��Zej	dd��Z
ddd�Zej	dd��Zdd�ZdS)�N����lineno�offsetcCsddlm}tjdd��}t�dt�t|dd�Wd�n1s#wY|�t|�d|�|\}|�	t
|jt�|j�|rJ|�t
|j�|�|�|jd�|�|j�|durb|�|j|�tjdd��}t�d	t�||||||d
�Wd�n1s�wY|�|g�dS)Nr)�check_syntax_errorT��record�alwaysz
<testcase>�execr�errorr)�test.supportr�warnings�catch_warnings�simplefilter�
SyntaxWarning�compile�assertEqual�lenZ
assertTrue�
issubclass�categoryZassertRegex�str�message�filenameZassertIsNotNoner)�testcaseZ	statementZerrtextrrr�warns�warn�r�9/usr/local/lib/python3.10/test/support/warnings_helper.py�check_syntax_warnings.����rcs	�fdd�}|S)Ncst�����fdd��}|S)NcsPt���tjd�d��|g|�Ri|��Wd�S1s!wYdS)N�ignore�r)rrr)�self�args�kwargs)r�testrr�wrapper-s
$�z3ignore_warnings.<locals>.decorator.<locals>.wrapper)�	functools�wraps)r%r&r!)r%r�	decorator,sz"ignore_warnings.<locals>.decoratorr)rr)rr!r�ignore_warnings&sr*c@s2eZdZ	dd�Zdd�Zedd��Zdd�Zd	S)
�WarningsRecordercCs||_d|_dS)Nr��	_warnings�_last)r"Z
warnings_listrrr�__init__:s
zWarningsRecorder.__init__cCs@t|j�|jkrt|jd|�S|tjjvrdStd||f��)N���z%r has no attribute %r)rr-r.�getattrr�WarningMessage�_WARNING_DETAILS�AttributeError)r"�attrrrr�__getattr__>s
zWarningsRecorder.__getattr__cCs|j|jd�S�Nr,�r"rrrrEszWarningsRecorder.warningscCst|j�|_dSr7)rr-r.r8rrr�resetIszWarningsRecorder.resetN)�__name__�
__module__�__qualname__r/r6�propertyrr9rrrrr+6s
r+cOs0	|�d�}|sdtff}|durd}t||�S)N�quietrT)�get�Warning�_filterwarnings)�filtersr$r>rrr�check_warningsMs



rCFccsl�	ddlm}tjdd��}tjd||d�dV|r|�Wd�n1s)wY|�|g�dS)Nr)�
gc_collectTrr
)rr)r
rDrr�filterwarningsr)rrr�force_gcrDrrrr�check_no_warningses����rGccs>�	t|tdd��dVWd�dS1swYdS)NT)rrF)rG�ResourceWarning)rrrr�check_no_resource_warning~s
�"�rIccs�	t�d�}|j�d�}|r|��tjdd��}tjd�d�t	|�VWd�n1s1wYt
|�}g}|D]5\}}d}	|dd�D]}|j}
t�
|t|
�tj�rft|
j|�rfd}	|�|�qJ|	ss|ss|�||jf�q>|r~td|d	��|r�td
|d	��dS)N�Z__warningregistry__Trrr
Fzunhandled warning %srz)filter (%r, %s) did not catch any warning)�sys�	_getframe�	f_globalsr?�clearrr�modulesrr+�listr�re�matchr�Ir�	__class__�remove�appendr:�AssertionError)rBr>�frame�registry�wZreraise�missing�msg�cat�seen�warningrrrrA�s@�
�
�
����rAc
cs<�tjdd�}z
dVW|tjdd�<dS|tjdd�<wr7)rrB)Zold_filtersrrr�save_restore_warnings_filters�s
�"r`cCstjdtdd�dS)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)rr�DeprecationWarningrrrr�_warn_about_deprecation�s

�rc)r)F)�
contextlibr'rQrKrrr*�objectr+�contextmanagerrCr@rGrIrAr`rcrrrr�<module>s(�


'