Sindbad~EG File Manager

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

�

SԚg����ddlZddlZddlZddlZddlZddlZd�Zdddd�d�Zd�ZGd�d	e	��Z
ejd
���Zejde
dfd���Zejd
���Zdd�Zejd���Zd�ZdS)�Nc��	tj��5tjdt���t	j|��cddd��S#1swxYwYdS�N�ignore)�category)�warnings�catch_warnings�simplefilter�DeprecationWarning�	importlib�
import_module)�names �9/usr/local/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�ddlm}tjd���5}tjdt
��t
|dd��ddd��n#1swxYwY|�t|��d|��|\}|�	t|jt
��|j��|r(|�t|j��|��|�|jd��|�|j��|�|�|j|��tjd���5}tjd	t
��||||||�
��ddd��n#1swxYwY|�|g��dS)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-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�	Fc���	�fd�}|S)Nc�J���tj�����fd���}|S)Nc���tj��5tjd�����|g|�Ri|��cddd��S#1swxYwYdSr)rrr	)�self�args�kwargsr�tests   ��r�wrapperz3ignore_warnings.<locals>.decorator.<locals>.wrapper5s�����(�*�*�
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)r4r5rs` �r�	decoratorz"ignore_warnings.<locals>.decorator4s>����	���	�	�	3�	3�	3�	3�	3�
�	�	3����)rr8s` r�ignore_warningsr;.s)����
������r9c�8�eZdZ	d�Zd�Zed���Zd�ZdS)�WarningsRecorderc�"�||_d|_dS)Nr��	_warnings�_last)r1�
warnings_lists  r�__init__zWarningsRecorder.__init__Bs��&�����
�
�
r9c���t|j��|jkrt|jd|��S|tjjvrdSt|�d|�����)N���z has no attribute )r r@rA�getattrr�WarningMessage�_WARNING_DETAILS�AttributeError)r1�attrs  r�__getattr__zWarningsRecorder.__getattr__Fs_���t�~�����+�+��4�>�"�-�t�4�4�4�
�X�,�=�
=�
=��4�����t�t�D�E�E�Er9c�*�|j|jd�S�Nr?�r1s rrzWarningsRecorder.warningsMs���~�d�j�k�k�*�*r9c�8�t|j��|_dSrM)r r@rArNs r�resetzWarningsRecorder.resetQs�����(�(��
�
�
r9N)�__name__�
__module__�__qualname__rCrK�propertyrrPr:r9rr=r=>sd����������F�F�F��+�+��X�+�)�)�)�)�)r9r=c�n�	|�d��}|sdtff}|�d}t||��S)N�quietrT)�get�Warning�_filterwarnings)�filtersr3rVs   r�check_warningsr[UsH���
�J�J�w���E�����=�"���=��E��7�E�*�*�*r9Fc#��K�	ddlm}tjd���5}tjd||���dV�|r
|��ddd��n#1swxYwY|�|g��dS)Nr)�
gc_collectTrr)r%r)rr]rr�filterwarningsr)r(r%r�force_gcr]r+s      r�check_no_warningsr`ms������(�'�'�'�'�'�	�	 ��	-�	-�	-������(/�)1�	3�	3�	3�	3�	�����	��J�L�L�L�
������������������
�����#�#�#�#�#s�(A�A�Ac#�tK�	t|td���5dV�ddd��dS#1swxYwYdS)NT)rr_)r`�ResourceWarning)r(s r�check_no_resource_warningrc�s������
�8�o��	M�	M�	M���
������������������������s�-�1�1c#�K�	tjd��}|j�d��}|r|���tjd���5}tjd�d��t|��V�ddd��n#1swxYwYt|��}g}|D]�\}}d}	|dd�D]b}|j}
tj
|t|
��tj��r,t!|
j|��rd}	|�|���c|	s|s|�||jf����|rt+d|d	z���|rt+d
|d	z���dS)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�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�tjdd�}	dV�|tjdd�<dS#|tjdd�<wxYwrM)rrZ)�old_filterss r�save_restore_warnings_filtersr�sY�����"�1�1�1�%�K�*�
����)����������k�������)�)�)�)s	�/�Ac�>�tjdtd���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,r
r:r9r�_warn_about_deprecationr��s2���M�	*�	�������r9)r)F)�
contextlibr6rrmrgrrr-r;�objectr=�contextmanagerr[rXr`rcrYrr�r:r9r�<module>r�se��������������	�	�	�	�
�
�
�
�����-�-�-�$�#$�T�$�$�$�$�$�<
�
�
� )�)�)�)�)�v�)�)�)�.��+�+���+�.��(*�W�u�$�$�$���$�0�������"$)�$)�$)�$)�N��*�*���*�����r9

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