Sindbad~EG File Manager

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

�

(Μg����ddlZddlZddlZddlZddlZddlZd�Zdddd�d�Zd�ZGd�d	e	�Z
ejd
��Zejde
dfd��Zejd
��Zdd�Zejd��Zd�Zy)�Nc��	tj�5tjdt��t	j
|�cddd�S#1swYyxYw�N�ignore)�category)�warnings�catch_warnings�simplefilter�DeprecationWarning�	importlib�
import_module)�names �9/usr/local/lib/python3.12/test/support/warnings_helper.py�import_deprecatedr	s<��=�	�	 �	 �	"����h�1C�D��&�&�t�,�
#�	"�	"�s�0A�A����lineno�offsetc��ddlm}tjd��5}tjdt
�t
|dd�ddd�|jt�d|�|\}|jt|jt
�|j�|r%|jt|j�|�|j|jd�|j!|j"�|�|j|j"|�tjd��5}tjd	t
�||||||�
�ddd�|j|g�y#1swY��3xYw#1swY�)xYw)Nr)�check_syntax_errorT��record�alwaysz
<testcase>�execr�errorr)�test.supportrrrr	�
SyntaxWarning�compile�assertEqual�len�
assertTrue�
issubclassr�assertRegex�str�message�filename�assertIsNotNoner)�testcase�	statement�errtextrrr�warns�warns        r�check_syntax_warningr-s3��0�	�	 �	 ��	-�����h�
�6��	�<��0�
.�
����U��Q��.��E�D����
�4�=�=�-�@��
�
�'�����S����.��8��������5����T�[�[�)�
�����T�[�[�&�1�

�	 �	 ��	-�����g�}�5��8�Y��"(��	9�
.�

�����#�/
.�	-��$
.�	-�s�(E6�3(F�6F�Fc���	�fd�}|S)Nc�F���tj����fd��}|S)Nc���tj�5tjd����|g|��i|��cddd�S#1swYyxYwr)rrr	)�self�args�kwargsr�tests   ��r�wrapperz3ignore_warnings.<locals>.decorator.<locals>.wrapper5s=����(�(�*��%�%�h��B��D�2�4�2�6�2�+�*�*�s�#A�A)�	functools�wraps)r4r5rs` �r�	decoratorz"ignore_warnings.<locals>.decorator4s%���	����	�	3�
�	3����)rr8s` r�ignore_warningsr;.s����
��r9c�0�eZdZ	d�Zd�Zed��Zd�Zy)�WarningsRecorderc� �||_d|_y)Nr��	_warnings�_last)r1�
warnings_lists  r�__init__zWarningsRecorder.__init__Bs��&�����
r9c���t|j�|jkDrt|jd|�S|tj
jvryt|�d|����)N���z has no attribute )r r@rA�getattrr�WarningMessage�_WARNING_DETAILS�AttributeError)r1�attrs  r�__getattr__zWarningsRecorder.__getattr__FsT���t�~�~�����+��4�>�>�"�-�t�4�4�
�X�,�,�=�=�
=����t�D�E�Er9c�4�|j|jdS�Nr?�r1s rrzWarningsRecorder.warningsMs���~�~�d�j�j�k�*�*r9c�8�t|j�|_yrM)r r@rArNs r�resetzWarningsRecorder.resetQs������(��
r9N)�__name__�
__module__�__qualname__rCrK�propertyrrPr:r9rr=r=>s+����F��+��+�)r9r=c�\�	|jd�}|s
dtff}|�d}t||�S)N�quietrT)�get�Warning�_filterwarnings)�filtersr3rVs   r�check_warningsr[Us=���
�J�J�w��E����=�"���=��E��7�E�*�*r9Fc#��K�	ddlm}tjd��5}tjd||��d��|r|�ddd�|jg�y#1swY�xYw�w)Nr)�
gc_collectTrr)r%r)rr]rr�filterwarningsr)r(r%r�force_gcr]r+s      r�check_no_warningsr`msb�����(�	�	 �	 ��	-������(/�)1�	3�	���L�

.�
�����#�
.�	-�s�A-�&A!�A-�!A*�&A-c#�dK�	t|td��5d��ddd�y#1swYyxYw�w)NT)rr_)r`�ResourceWarning)r(s r�check_no_resource_warningrc�s(�����
�8�o��	M�
�
N�	M�	M�s�0�$�	0�-�0c#��K�	tjd�}|jjd�}|r|j	�tjd��5}tjdjd�t|���ddd�t�}g}|D]�\}}d}	|ddD]g}|j}
tj|t|
�tj�s�>t!|
j"|�s�Ud}	|j%|��i|	r�z|r�}|j'||j(f���|rt+d|d	z��|rt+d
|d	z��y#1swY��xYw�w)N��__warningregistry__TrrrFzunhandled warning %srz)filter (%r, %s) did not catch any warning)�sys�	_getframe�	f_globalsrW�clearrr�modulesr	r=�listr%�re�matchr$�Ir"�	__class__�remove�appendrQ�AssertionError)rZrV�frame�registry�w�reraise�missing�msg�cat�seen�warnings           rrYrY�sK�����
�M�M�!��E����"�"�#8�9�H������	�	 �	 ��	-��	���J��,�,�X�6��q�!�!�
.��1�g�G��G����S������A��i�i�G�����c�'�l�B�D�D�1��7�,�,�c�2������q�!�
��E��N�N�C����.�/����3�g�a�j�@�A�A���H�$�Q�Z�(�)�	)��/
.�	-�s8�AE2�0E&�A!E2�.E2�E2�E2� AE2�&E/�+E2c#�K�tjdd}	d��|tjddy#|tjddwxYw�wrM)rrZ)�old_filterss r�save_restore_warnings_filtersr�s>�����"�"�1�%�K�*�
�)�������k������s�A�/�A�A�Ac�<�tjdtd��y)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,r
r:r9r�_warn_about_deprecationr��s���M�M�	*�	��r9)r)F)�
contextlibr6rrmrgrrr-r;�objectr=�contextmanagerr[rXr`rcrYrr�r:r9r�<module>r�s������	�
��-�$�#$�T�$�<
� )�v�)�.���+��+�.���(*�W�u�$��$�0������"$)�N���*��*�r9

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