Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/support/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/support/__pycache__/warnings_helper.cpython-39.opt-2.pyc

a

��g��@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�offsetcCs ddlm}tjdd��(}t�dt�t|dd�Wd�n1sF0Y|�t|�d|�|\}|�	t
|jt�|j�|r�|�t
|j�|�|�|jd�|�|j�|dur�|�|j|�tjdd��.}t�d	t�||||||d
�Wd�n1�s0Y|�|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�8/usr/local/lib/python3.9/test/support/warnings_helper.py�check_syntax_warnings**��&rcs�fdd�}|S)Ncst�����fdd��}|S)NcsPt���4tjd�d��|g|�Ri|��Wd�S1sB0YdS)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@s0eZdZdd�Zdd�Zedd��Zdd�Zd	S)
�WarningsRecordercCs||_d|_dS)Nr��	_warnings�_last)r"Z
warnings_listrrr�__init__:szWarningsRecorder.__init__cCsDt|j�|jkr t|jd|�S|tjjvr0dStd||f��dS)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+cOs.|�d�}|s$dtff}|dur$d}t||�S)N�quietrT)�get�Warning�_filterwarnings)�filtersr$r>rrr�check_warningsMs

rCFccshddlm}tjdd��0}tjd||d�dV|r:|�Wd�n1sN0Y|�|g�dS)Nr)�
gc_collectTrr
)rr)r
rDrr�filterwarningsr)rrr�force_gcrDrrrr�check_no_warningses�$rGccs8t|tdd��dVWd�n1s*0YdS)NT)rrF)rG�ResourceWarning)rrrr�check_no_resource_warning~srIccst�d�}|j�d�}|r"|��tjdd��*}tjd�d�t	|�VWd�n1s^0Yt
|�}g}|D]j\}}d}	|dd�D]8}|j}
t�
|t|
�tj�r�t|
j|�r�d}	|�|�q�|	sx|sx|�||jf�qx|r�td|d	��|�rtd
|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�s4
(
��rAc
cs<tjdd�}zdVW|tjdd�<n|tjdd�<0dSr7)rrB)Zold_filtersrrr�save_restore_warnings_filters�sr`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&�


'


Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists