Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_exception_group.cpython-312.pyc

�

'Μg���>�ddlZddlZddlZddlmZGd�dej�ZGd�dej�ZGd�dej�Z	Gd	�d
ej�Z
d�ZGd�d
ej�ZGd�dej�Z
Gd�de
�ZGd�de
�ZGd�dej�Zd#d�ZGd�dej�Zd�ZGd�de
�ZGd�de
�ZGd�de�ZGd �d!e�Zed"k(rej2�yy)$�N)�C_RECURSION_LIMITc��eZdZd�Zd�Zd�Zy)�TestExceptionGroupTypeHierarchyc���|jttt��|jttt��|jttt
��y�N)�
assertTrue�
issubclass�ExceptionGroup�	Exception�BaseExceptionGroup�
BaseException��selfs �6/usr/local/lib/python3.12/test/test_exception_group.py�test_exception_group_typesz:TestExceptionGroupTypeHierarchy.test_exception_group_typess=�����
�>�9�=�>����
�>�3E�F�G����
�#5�}�E�F�c�t�|jtd�5ttddd�y#1swYyxYw)Nr)�assertRaisesRegex�	TypeErrorr�OSErrorrs r�"test_exception_is_not_generic_typezBTestExceptionGroupTypeHierarchy.test_exception_is_not_generic_types&��
�
#�
#�I�{�
;��g��<�
;�
;�s�.�7c��t}|jt|tj�|jt
|tj�yr)r�assertIsInstancer
�types�GenericAliasr)r�Es  r�$test_exception_group_is_generic_typezDTestExceptionGroupTypeHierarchy.test_exception_group_is_generic_types>�������n�Q�/��1C�1C�D����0��3�U�5G�5G�HrN)�__name__�
__module__�__qualname__rrr�rrrrs��G�
�Irrc�$�eZdZd�Zd�Zd�Zd�Zy)�BadConstructorArgsc��d}|jt|�5td�ddd�|jt|�5ttd�g�ddd�|jt|�5tdtd�gtd�g�ddd�y#1swY�~xYw#1swY�VxYw#1swYyxYw)Nz8BaseExceptionGroup.__new__\(\) takes exactly 2 argumentsz	no errorszno msg�eg�too�many�rrr
�
ValueError�r�MSGs  r�'test_bad_EG_construction__too_many_argsz:BadConstructorArgs.test_bad_EG_construction__too_many_argss���I��
�
#�
#�I�s�
3��;�'�4�
�
#�
#�I�s�
3��J�x�0�1�2�4�
�
#�
#�I�s�
3��4�*�U�"3�!4�y��7H�6I�J�4�
3�	4�
3��
3�
3��
3�
3�s#�B"�B.�7"B:�"B+�.B7�:Cc��d}|jt|�5ttd�t	d��ddd�|jt|�5tdtd�g�ddd�y#1swY�?xYw#1swYyxYw)Nzargument 1 must be str, not �z
bad syntax)rrr
r)�SyntaxErrorr*s  r�%test_bad_EG_construction__bad_messagez8BadConstructorArgs.test_bad_EG_construction__bad_message sh��,��
�
#�
#�I�s�
3��:�b�>�;�|�+D�E�4�
�
#�
#�I�s�
3��4�*�R�.�!1�2�4�
3�4�
3��
3�
3�s�A6�B�6A?�Bc�j�d}|jt|�5tdtd�h�ddd�|jt|�5tdd�ddd�d}|jt|�5tdg�ddd�y#1swY�bxYw#1swY�CxYw#1swYyxYw)Nz1second argument \(exceptions\) must be a sequencezerrors not sequence�*r%z;second argument \(exceptions\) must be a non-empty sequencer(r*s  r�+test_bad_EG_construction__bad_excs_sequencez>BadConstructorArgs.test_bad_EG_construction__bad_excs_sequence's���B��
�
#�
#�I�s�
3��0�:�b�>�2B�C�4�
�
#�
#�I�s�
3��4��&�4�M��
�
#�
#�J��
4��4��$�5�
4�
4�
3��
3�
3��5�
4�s#�B�
B�;
B)�B�B&�)B2c���d}|jt|�5tdtg�ddd�|jt|�5tddg�ddd�y#1swY�6xYw#1swYyxYw)NzAItem [0-9]+ of second argument \(exceptions\) is not an exceptionzexpect instance, not typez	bad errorznot an exception)rr)r
rr*s  r�/test_bad_EG_construction__nested_non_exceptionszBBadConstructorArgs.test_bad_EG_construction__nested_non_exceptions2sa��%��
�
#�
#�J��
4��6��	�B�5�
�
#�
#�J��
4��;�);�(<�=�5�
4�5�
4��
4�
4�s�A �	A,� A)�,A5N)rrr r,r0r3r5r!rrr#r#s��K�3�	%�>rr#c�H�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�InstanceCreationc��td�td�g}|jtt	d|��t�y)N��r%)r)r�assertIs�typer
�r�excss  r�$test_EG_wraps_Exceptions__creates_EGz5InstanceCreation.test_EG_wraps_Exceptions__creates_EG<s2���1�
�y��|�,���
�
����d�+�,��	rc��td�td�g}|jtt	d|��t
�y)Nr9r:�beg)r)rr;r<rr
r=s  r�%test_BEG_wraps_Exceptions__creates_EGz6InstanceCreation.test_BEG_wraps_Exceptions__creates_EGBs3���1�
�y��|�,���
�
��#�E�4�0�1��	rc��d}|jt|�5tdtd�t	d�g�}ddd�y#1swYyxYw)Nz/Cannot nest BaseExceptions in an ExceptionGroupr%r9r:)rrr
r)�KeyboardInterrupt)rr+r%s   r�-test_EG_wraps_BaseException__raises_TypeErrorz>InstanceCreation.test_EG_wraps_BaseException__raises_TypeErrorHs>��
>��
�
#�
#�I�s�
3���z�!�}�6G��6J�&K�L�B�4�
3�
3�s�!A�Ac��tdtd�td�g�}|jt	|�t�y)NrAr9r:)rr)rDr;r<)rrAs  r�)test_BEG_wraps_BaseException__creates_BEGz:InstanceCreation.test_BEG_wraps_BaseException__creates_BEGMs0�� ���A��8I�!�8L�(M�N���
�
�d�3�i�!3�4rc��Gd�dt�}|jt|dtd�t	d�g��|�y)Nc��eZdZy)�IInstanceCreation.test_EG_subclass_wraps_non_base_exceptions.<locals>.MyEGN�rrr r!rr�MyEGrJR���rrLr%r.r2)r
r;r<r)r�rrLs  r�*test_EG_subclass_wraps_non_base_exceptionsz;InstanceCreation.test_EG_subclass_wraps_non_base_exceptionsQs;��	�>�	�	
�
�
���d�Z��^�Y�r�]�;�<�=��	rc��Gd�dt�}d}|jt|�5|dtd�t	d�g�ddd�y#1swYyxYw)Nc��eZdZy)�MInstanceCreation.test_EG_subclass_does_not_wrap_base_exceptions.<locals>.MyEGNrKr!rrrLrRZrMrrL�$Cannot nest BaseExceptions in 'MyEG'r%r.r2)r
rrr)rD�rrL�msgs   r�.test_EG_subclass_does_not_wrap_base_exceptionsz?InstanceCreation.test_EG_subclass_does_not_wrap_base_exceptionsYsJ��	�>�	�5��
�
#�
#�I�s�
3���
�2��(9�"�(=�>�?�4�
3�
3�s�A�Ac��Gd�dtt�}d}|jt|�5|dtd�t	d�g�ddd�y#1swYyxYw)Nc��eZdZy)�TInstanceCreation.test_BEG_and_E_subclass_does_not_wrap_base_exceptions.<locals>.MyEGNrKr!rrrLrYbrMrrLrSr%r.r2)rr)rrrDrTs   r�5test_BEG_and_E_subclass_does_not_wrap_base_exceptionszFInstanceCreation.test_BEG_and_E_subclass_does_not_wrap_base_exceptionsasM��	�%�z�	�5��
�
#�
#�I�s�
3���
�2��(9�"�(=�>�?�4�
3�
3�s�A�Ac�d�Gd�dtt�}|dtd�t�g�y)Nc��eZdZy)�[InstanceCreation.test_EG_and_specific_subclass_can_wrap_any_nonbase_exception.<locals>.MyEGNrKr!rrrLr]jrMrrLr%r.)r
r)rrNs  r�<test_EG_and_specific_subclass_can_wrap_any_nonbase_exceptionzMInstanceCreation.test_EG_and_specific_subclass_can_wrap_any_nonbase_exceptionis'��	�>�:�	�	
�T�J�r�N�I�K�0�1rc�d�Gd�dtt�}|dtd�t�g�y)Nc��eZdZy)�\InstanceCreation.test_BEG_and_specific_subclass_can_wrap_any_nonbase_exception.<locals>.MyEGNrKr!rrrLraqrMrrLr%r.)rr)rrNs  r�=test_BEG_and_specific_subclass_can_wrap_any_nonbase_exceptionzNInstanceCreation.test_BEG_and_specific_subclass_can_wrap_any_nonbase_exceptionps(��	�%�z�	�	
�T�J�r�N�I�K�0�1rc��Gd�dt�}|jt|dtd�t	d�g��|�|jt|dtd�td�g��|�y)Nc��eZdZy)�@InstanceCreation.test_BEG_subclass_wraps_anything.<locals>.MyBEGNrKr!rr�MyBEGreyrMrrfr%r.r2)rr;r<r)rrD)rrfs  r� test_BEG_subclass_wraps_anythingz1InstanceCreation.test_BEG_subclass_wraps_anythingxsk��	�&�	�	
�
�
���t�j��n�i��m�<�=�>��	�	
�
�
���t�j��n�.?��.C�D�E�F��	rN)
rrr r?rBrErGrOrVrZr^rbrgr!rrr7r7;s7����M�
5��@�@�2�2�	rr7c��eZdZd�Zd�Zd�Zy)�StrAndReprTestsc	�`�tdtd�td�g�}|jt	|�d�|jt|�d�td|td�|td�g�}|jt	|�d�|jt|�d�y)	N�flatr9r:�flat (2 sub-exceptions)z5ExceptionGroup('flat', [ValueError(1), TypeError(2)])�nested�nested (4 sub-exceptions)z�ExceptionGroup('nested', [ExceptionGroup('flat', [ValueError(1), TypeError(2)]), ValueError(1), ExceptionGroup('flat', [ValueError(1), TypeError(2)]), TypeError(2)]))rr)r�assertEqual�str�repr�rr%s  r�test_ExceptionGroupz#StrAndReprTests.test_ExceptionGroup�s���
��Z��]�I�a�L�1�3��	
����R��";�<�����b��C�	E� ��r�:�a�=�"�i��l�;�=��	
����R��"=�>�����b��
E�	Frc�L�tdtd�td�g�}|jt	|�d�|jt|�d�td|td�|g�}|jt	|�d�|jt|�d�y)	Nrkr9r:rlzABaseExceptionGroup('flat', [ValueError(1), KeyboardInterrupt(2)])rmznested (3 sub-exceptions)z�BaseExceptionGroup('nested', [BaseExceptionGroup('flat', [ValueError(1), KeyboardInterrupt(2)]), ValueError(1), BaseExceptionGroup('flat', [ValueError(1), KeyboardInterrupt(2)])]))rr)rDrorprqrrs  r�test_BaseExceptionGroupz'StrAndReprTests.test_BaseExceptionGroup�s���
��Z��]�$5�a�$8�9�;��	
����R��";�<�����b��
9�	:�
 ��r�:�a�=�"�-�/��	
����R��"=�>�����b��
?�	@rc	�r�Gd�dt�}|dtd�td�g�}|jt	|�d�|jt|�d�|d|td�|td�g�}|jt	|�d	�|jt|�d
�y)Nc��eZdZy)�3StrAndReprTests.test_custom_exception.<locals>.MyEGNrKr!rrrLrx�rMrrLrkr9r:rlz+MyEG('flat', [ValueError(1), TypeError(2)])rmrnz�MyEG('nested', [MyEG('flat', [ValueError(1), TypeError(2)]), ValueError(1), MyEG('flat', [ValueError(1), TypeError(2)]), TypeError(2)]))r
r)rrorprq)rrLr%s   r�test_custom_exceptionz%StrAndReprTests.test_custom_exception�s���	�>�	���Z��]�I�a�L�1�3��	
����R��";�<�����b��#P�Q�
��r�:�a�=�"�i��l�;�=��	
����R��"=�>�����b��'�	)rN)rrr rsruryr!rrriri�s��F�(@�,)rric�:�g}		td��#t$r}td�|�d}~wwxYw#t$r}|j|�Yd}~nd}~wwxYw		td��#t$r}t	t
��d}~wwxYw#t$r}|j|�Yd}~nd}~wwxYw		t
d��#t$r}td��d}~wwxYw#t$r}|j|�Yd}~nd}~wwxYw	td|��#t$r}|cYd}~Sd}~wwxYw)Nz#context and cause for ValueError(1)r9zcontext for TypeErrorzcontext for ValueError(2)r:�	simple eg)�MemoryErrorr)�appendrr�int�ImportErrorr
)r>�es  r�create_simple_egr��s��
�D��	'��C�D�D���	'��Q�-�Q�&��	'�������A�������	!��1�2�2���	!��C�.� ��	!�������A�������	 ��9�:�:���	 ��Q�-���	 �������A��������[�$�/�/��������s���	*�%�*�-�	A�A�A�A!�!	A>�*A9�9A>�>B�	B%�
B � B%�*B5�5	C�>C	�	C�C�	C5�C0�0C5�9D�	D�D�D�Dc��eZdZd�Zd�Zy)�ExceptionGroupFieldsc�*�t�}|j|jd�|j|jdd�|j	|j
dt�|j	|j
djt�|j	|j
djt�|j	|j
dt�|j|j
dj�|j	|j
djt�|j	|j
dt�|j|j
dj�|j	|j
djt�tjj}|dz|dz|dz|dzgg}|j|j j"|d�|j|j j$�t'd	�D]X}|j
|j }|j|j$�|j|j"|d|��Zy)
Nr{rr9r:�����)r�ro�message�argsr�
exceptionsr)�	__cause__r|�__context__r�assertIsNonerr�__code__�co_firstlineno�
__traceback__�	tb_lineno�tb_next�range)rr%�line0�
tb_linenos�i�tbs      r�!test_basics_ExceptionGroup_fieldsz6ExceptionGroupFields.test_basics_ExceptionGroup_fields�s���
�
��	
������[�1���������[�1�	
���b�m�m�A�.�
�;����b�m�m�A�.�8�8�+�F����b�m�m�A�.�:�:�K�H����b�m�m�A�.�	�:����"�-�-��*�4�4�5����b�m�m�A�.�:�:�G�D����b�m�m�A�.�
�;����"�-�-��*�4�4�5����b�m�m�A�.�:�:�K�H�!�)�)�8�8���b�j��q�y�%�"�*�e�b�j�9�;�
�����)�)�3�3�Z��]�C����"�*�*�2�2�3��q��A����q�!�/�/�B����b�j�j�)����R�\�\�:�a�=��+;�<�rc��tdtd�td�g�}|jt	|j
�t�|j|jt�5d|_ddd�|j
|jt�5td�g|_ddd�y#1swY�ExYw#1swYyxYw)Nr%r9r:znew msg�xyz)
r
rrror<r��tupler��assertRaises�AttributeErrorrrs  r�test_fields_are_readonlyz-ExceptionGroupFields.test_fields_are_readonlys���
�D�9�Q�<����"<�
=������b�m�m�,�e�4�
�
�
�
�
�
�~�
.�"�B�J�/�	�
�
�
�
�
�~�
.�$�U�^�,�B�M�/�
.�	/�
.��/�
.�s�+B7�C�7C�CN)rrr r�r�r!rrr�r��s��=�:-rr�c��eZdZd�Zy)�ExceptionGroupTestBasec�2�|�|jt|�|�t|t�r�|j	|t
jj�|jt|j�t|��t|j|�D]\}}|j|d|��y|j	|t�|jt|�t|��|j|j|j�y)a� Assert that the exception matches the template

            A template describes the shape of exc. If exc is a
            leaf exception (i.e., not an exception group) then
            template is an exception instance that has the
            expected type and args value of exc. If exc is an
            exception group, then template is a list of the
            templates of its nested exceptions.
        N)r;r<�
isinstancerr�collections�abc�Sequencero�lenr��zip�assertMatchesTemplater
r�)r�exc�exc_type�templater��ts      rr�z,ExceptionGroupTestBase.assertMatchesTemplates������M�M�$�s�)�X�.��c�-�.��!�!�(�K�O�O�,D�,D�E����S����0�#�h�-�@��C�N�N�H�5���1��*�*�1�d�A�6�6�
�!�!�(�M�:����T�#�Y��X��7����S�X�X�x�}�}�5rN)rrr r�r!rrr�r�s��6rr�c�<�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�ExceptionGroupSubgroupTestsc�t�t�|_td�tt�td�g|_y�Nr9r:�r�r%r)rr~�eg_templaters r�setUpz!ExceptionGroupSubgroupTests.setUp+�'��"�$���&�q�M�9�S�>�:�a�=�I��rc�d�dtd�ttgtdfg}|D]t}|jt�5|jj	|�ddd�|jt�5|jj|�ddd��vy#1swY�ExYw#1swY��xYw)Nzbad argzinstance not typer2)rrr�r%�subgroup�split)r�bad_args�args   r�(test_basics_subgroup_split__bad_arg_typezDExceptionGroupSubgroupTests.test_basics_subgroup_split__bad_arg_type/s�����/�0��i�(��b�M�#���C��"�"�9�-���� � ��%�.��"�"�9�-����
�
�c�"�.�-��-�-��-�-�s�B�3B&�B#	�&B/	c�D�|j}|j||jt��|j||jt��|j||jt
��|j||jt��yr)r%r;r�r
rrr
rrs  r�)test_basics_subgroup_by_type__passthroughzEExceptionGroupSubgroupTests.test_basics_subgroup_by_type__passthrough:sh��
�W�W���
�
�b�"�+�+�m�4�5��
�
�b�"�+�+�i�0�1��
�
�b�"�+�+�&8�9�:��
�
�b�"�+�+�n�5�6rc�`�|j|jjt��yr)r�r%r�rrs r�&test_basics_subgroup_by_type__no_matchzBExceptionGroupSubgroupTests.test_basics_subgroup_by_type__no_matchAs�����$�'�'�*�*�7�3�4rc��|j}ttd�td�gfttt�gfttf|jfg}|D]n\}}|j|��5|j
|�}|j|j|j�|j|t|�ddd��py#1swY�{xYw)Nr9r:)�match)r%r)rr~r��subTestr�ror�r�r
)rr%�	testcases�
match_typer��subegs      r�#test_basics_subgroup_by_type__matchz?ExceptionGroupSubgroupTests.test_basics_subgroup_by_type__matchDs���
�W�W���*�Q�-��A��7�8�
��3��(�)��)�
$�d�&6�&6�7�	9�	�%.� �J�����J��/����J�/��� � �����
�
�;��*�*�5�.�(�K�0�/�%.�/�/�s
�0AC
�
C	c�p�|j|j|jjd���y)Nc��y�NTr!�r�s r�<lambda>z\ExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__passthrough.<locals>.<lambda>Ss��$r)r;r%r�rs r�.test_basics_subgroup_by_predicate__passthroughzJExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__passthroughRs#���
�
�d�g�g�t�w�w�/�/��?�@rc�Z�|j|jjd���y)Nc��y�NFr!r�s rr�zYExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__no_match.<locals>.<lambda>Vs��Ur)r�r%r�rs r�+test_basics_subgroup_by_predicate__no_matchzGExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__no_matchUs�����$�'�'�*�*�?�;�<rc�f��|j}ttd�td�gfttt�gfttf|jfg}|D]V\�}|j�fd��}|j
|j|j�|j|t|��Xy)Nr9r:c���t|��Sr�r��r�r�s �rr�zVExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__match.<locals>.<lambda>as���*�Q�
�*Cr)
r%r)rr~r�r�ror�r�r
)rr%r�r�r�r�s     @r�(test_basics_subgroup_by_predicate__matchzDExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__matchXs����
�W�W���*�Q�-��A��7�8�
��3��(�)��)�
$�d�&6�&6�7�	9�	�%.� �J���K�K� C�D�E����U�]�]�B�J�J�7��&�&�u�n�h�G�%.rN)rrr r�r�r�r�r�r�r�r�r!rrr�r�*s.��J�	#�7�5�L�A�=�Hrr�c�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�ExceptionGroupSplitTestsc�t�t�|_td�tt�td�g|_yr�r�rs rr�zExceptionGroupSplitTests.setUpgr�rc���ttttfD]R}|jj|�\}}|j
|t|j�|j|��Tyr)	r
rrr
r%r�r�r�r�)rrr��rests    r�&test_basics_split_by_type__passthroughz?ExceptionGroupSplitTests.test_basics_split_by_type__passthroughksW����$�n�6�A��'�'�-�-��*�K�E�4��&�&��~�t�'7�'7�
9����d�#�6rc��|jjt�\}}|j|�|j	|t
|j�yr)r%r�rr�r�r
r��rr�r�s   r�#test_basics_split_by_type__no_matchz<ExceptionGroupSplitTests.test_basics_split_by_type__no_matchssA���g�g�m�m�G�,���t����%� ��"�"��.�$�"2�"2�	4rc�l�|j}t}t}||d�|d�g|t�gf||t�g|d�|d�gf||f|jdft
|f|d�|d�g|t�gfg}|D]�\}}}|j
|�\}}	|j|j|j�|j|t|�|�>|j|	j|j�|j|	t|���|j|	���yr�)r%r)rr~r�rr�ror�r�r
r�)
rr%�VE�TEr�r��match_template�
rest_templater�r�s
          r� test_basics_split_by_type__matchz9ExceptionGroupSplitTests.test_basics_split_by_type__matchys!��
�W�W��
��
���"�Q�%��A���"�S�'��+�
�"�S�'��R��U�B�q�E�N�+��"�X�t�'�'��.��r�]�R��U�B�q�E�N�R��W�I�6�
�	�:C�5�J��
��(�(�:�.�K�E�4����U�]�]�B�J�J�7��&�&��~�~�
7��(�� � ����r�z�z�:��*�*��.�-�9��!�!�$�'�:Crc��|jjd��\}}|j|t|j�|j|�y)Nc��yr�r!r�s rr�zVExceptionGroupSplitTests.test_basics_split_by_predicate__passthrough.<locals>.<lambda>�s��dr)r%r�r�r
r�r�r�s   r�+test_basics_split_by_predicate__passthroughzDExceptionGroupSplitTests.test_basics_split_by_predicate__passthrough�s>���g�g�m�m�N�3���t��"�"�5�.�$�:J�:J�K����$�rc��|jjd��\}}|j|�|j|t|j
�y)Nc��yr�r!r�s rr�zSExceptionGroupSplitTests.test_basics_split_by_predicate__no_match.<locals>.<lambda>�s��er)r%r�r�r�r
r�r�s   r�(test_basics_split_by_predicate__no_matchzAExceptionGroupSplitTests.test_basics_split_by_predicate__no_match�s>���g�g�m�m�O�4���t����%� ��"�"�4���9I�9I�Jrc��	�|j}t}t}||d�|d�g|t�gf||t�g|d�|d�gf||f|jdfg}|D]�\�	}}|j�	fd��\}}|j
|j|j�|j|t|�|��^|j
|j|j�|j|t|���y)Nr9r:c���t|��Srr�r�s �rr�zPExceptionGroupSplitTests.test_basics_split_by_predicate__match.<locals>.<lambda>�s���Z��:�-Fr)
r%r)rr~r�r�ror�r�r
)
rr%r�r�r�r�r�r�r�r�s
         @r�%test_basics_split_by_predicate__matchz>ExceptionGroupSplitTests.test_basics_split_by_predicate__match�s����
�W�W��
��
���"�Q�%��A���"�S�'��+�
�"�S�'��R��U�B�q�E�N�+��"�X�t�'�'��.�	
�	�:C�5�J��
��(�(�#F�G�K�E�4����U�]�]�B�J�J�7��&�&��~�~�
7��(�� � ����r�z�z�:��*�*��.�-�9�:CrN)
rrr r�r�r�r�r�r�r�r!rrr�r�fs'��J�$�4�(�0 �
K�
9rr�c��eZdZd�Zd�Zd�Zy)�DeepRecursionInSplitAndSubgroupc�d�td�}ttdz�D]}td|g�}�|S)Nr9r%)rr�rr
)rr�r�s   r�make_deep_egz,DeepRecursionInSplitAndSubgroup.make_deep_eg�s3���a�L���(�1�,�-�A��t�a�S�)�A�.��rc��|j�}|jt�5|jt�ddd�y#1swYyxYwr)r�r��RecursionErrorr�r�rr�s  r�test_deep_splitz/DeepRecursionInSplitAndSubgroup.test_deep_split�s6�������
�
�
�~�
.�
�G�G�I��/�
.�
.���A�Ac��|j�}|jt�5|jt�ddd�y#1swYyxYwr)r�r�r�r�rr�s  r�test_deep_subgroupz2DeepRecursionInSplitAndSubgroup.test_deep_subgroup�s6�������
�
�
�~�
.�
�J�J�y�!�/�
.�
.�r�N)rrr r�r�r�r!rrr�r��s����
"rr�c#��K�|�g}|j|j�t|t�r&|jD]}t||�Ed{����n||f��|j
�y7��wr)r}r�r�rr��leaf_generator�pop)r��tbsr�s   rr�r��sd����
�{����J�J�s� � �!��#�)�*����A�%�a��-�-�-� ��3�h���G�G�I�

.�s�AA1�A/�A1c��eZdZd�Zy)�LeafGeneratorTestc�
�t�}|jt|�D��cgc]\}}|��	c}}|j�t|�D]-\}}|j||j|jg��/ycc}}wr)r��assertSequenceEqualr�r�r�)rr%r��_r�s     r�test_leaf_generatorz%LeafGeneratorTest.test_leaf_generator�sx��
�
��� � �)�"�-�.�-�4�1�a�Q�-�.��M�M�	�%�R�(�F�A�s��$�$��b�&�&����8�
:�)��
/s�A?
N)rrr rr!rrr�r��s��
	:rr�c��g}		tt��#t$r}td|g��d}~wwxYw#t$r}|j|�Yd}~nd}~wwxYw		t	d��#t$r}td�|�d}~wwxYw#t
$r}|j|�Yd}~nd}~wwxYw	td|��#t$r}|cYd}~Sd}~wwxYw)Nrmz
out of memoryr9�root)r�bytesr
r}r|r))r>r�r%s   r�create_nested_egr�s���
�D��	0��E�"�"���	0� ��A�3�/�/��	0�������A�������	'��o�.�.���	'��Q�-�Q�&��	'�������A��������V�T�*�*�����	���sr��	/�
*�/�2�	A�A�A�A&�&	B�/A;�;B�B�	B'�B"�"B'�+B7�7	C�C�C�Cc�$�eZdZd�Zd�Zd�Zd�Zy)�NestedExceptionGroupBasicsTestc�x�t�}|j|ttt�gtd�g�y)Nr9)rr�r
rrr)rrs  r�"test_nested_group_matches_templatezANestedExceptionGroupBasicsTest.test_nested_group_matches_template�s2��
�
���"�"������
��A��/�	1rc�&�t�}|j|jdjt�|j|jdj
t�|j|jdjt�y)Nr9r)rrr�r�r|r�rrrs  r�test_nested_group_chainingz9NestedExceptionGroupBasicsTest.test_nested_group_chainingsg��
�
�����b�m�m�A�.�:�:�K�H����b�m�m�A�.�8�8�+�F����b�m�m�A�.�:�:�I�Frc��t�}tjj}|j|dzf|jdj|dzf|jdj|dzf|jdjdj|dzffD]<\}}|j|j|�|j|j��>y)N�rr�r9r��)	rr�r�r�r�ror�r�r�)rr%r�r��expecteds     r�&test_nested_exception_group_tracebackszENestedExceptionGroupBasicsTest.test_nested_exception_group_tracebacks	s���
�
�� �)�)�8�8��
�
�
�u�r�z�*�
�]�]�1�
�
+�
+�U�Q�Y�7�
�]�]�1�
�
+�
+�U�R�Z�8�
�]�]�1�
�
(�
(��
+�
9�
9�5�1�9�E�	
�N�R��
���R�\�\�8�4����b�j�j�)�
rc	�x�t�}|jttt	|���d�tj
j}|dz|dz|dzg|dz|dzgg}tt	|��D]5\}\}}|j|D�cgc]}|j��c}||��7ycc}w)Nr:rr�rr�)
rror��listr�r�r��	enumeraterr�)rr%r��expected_tbsr�rr�r�s        r�test_iteration_full_tracebacksz=NestedExceptionGroupBasicsTest.test_iteration_full_tracebackss���
�
��	
����T�.��"4�5�6��:� �)�)�8�8���"�*�e�a�i����;��"�*�e�b�j�1�3��'�~�b�'9�:�M�Q���C��$�$�(+�,��"�����,��Q��
!�;��,s�B7
N)rrr rr
rrr!rrr	r	�s��1�G�*�
!rr	c��eZdZd�Zy)�ExceptionGroupSplitTestBasec�*�|j|t�|j|�\}}|j|�}|��|j|t�t	|�D]\}}|j||��|j|�|j|t�t	|�D]\}}|j||��|�|j|t�d�}|j
||�||��||�}	||�}
|jt||��t||��t||��z�||�D] }|j|xr||	v|xr||
v��"|||fD]�}|��|j|j|j�|j|j|j�|j|j|j�|j|j|j�|jt|dd�t|dd����d�}d�}
|||fD];}||�D].}|j
|
|||��|
|||����0�=||fS)z5 Split an EG and do some sanity checks on the result Nc�R�|�gSt|�D��cgc]\}}|��	c}}Scc}}wr�r�)r�r�rs   r�leaveszAExceptionGroupSplitTestBase.split_exception_group.<locals>.leaves<s.����2�L��s�8K�*L�8K���1�1�8K�*L�L��*Ls�#�	__notes__c�:�t|�D]
\}}||us�|cSyrr)�leafr%r�r�s    r�tbs_for_leafzGExceptionGroupSplitTestBase.split_exception_group.<locals>.tbs_for_leafYs!��(��,���3���9��J�-rc�F�|D�cgc]}|s�|j��c}Scc}wr)r�)r�r�s  rr�zEExceptionGroupSplitTestBase.split_exception_group.<locals>.tb_linenos^s ��+.�5�3�R�"�B�L�L�3�5�5��5s��)rrr�r�r��assertIsNotNonerror��assertNotEqualr�r;r�r�r��getattr)rr%rr�r��sgr�rr�match_leaves�rest_leaves�partr!r�s              r�split_exception_groupz1ExceptionGroupSplitTestBase.split_exception_group(sh�����b�"4�5��h�h�u�o���t�
�[�[��
�����!�!�%�);�<�%�e�,���!��%�%�a��/�-�
� � ��$��!�!�"�&8�9�%�b�)���!��%�%�a��/�*����!�!�$�(:�;�	M�	
� � �����r�
�;��e�}���T�l�������r�
�O���u�
���V�D�\�!2�2�	4����A�����+�!�|�+��)��k�)�
+���D�"�%�D���� � ����T�\�\�:��
�
�b�l�l�D�N�N�;��
�
�b�n�n�d�.>�.>�?��
�
�b�.�.��0B�0B�C�� � ��B��T�2��D�+�t�4�6�
&�	�
	6��D�"�%�D��D�\���(�(��|�A�r�2�3��|�A�t�4�5�7�"�&��d�{�rN)rrr r*r!rrrr&s��@rrc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�NestedExceptionGroupSplitTestc�.�	�
��Gd�dt��	d��d��
�	�
�fd�}	|�td�t	t
�td�gtd�t	t
�td	�gtd	�gtd�g}td�td�gtd�td	�gtd	�gtd�g}t	t
�gt	t
�ggg}|j
t|�|j|t�\}}|j|�|j
|t|�|j|t�\}}|j
|t|�|j|�|j|ttf�\}}|j
|t|�|j|�|j|t�\}}|j
|t|�|j
|t|�|j|ttf�\}}|j
|t|�|j
|t|�|jt�\}}|j||�|j|�|j�	�\}}|j
|t|d
g�|j
|t|dg�y#t$r*}|jdt|����|}Yd}~���d}~wwxYw)Nc��eZdZy)�JNestedExceptionGroupSplitTest.test_split_by_type.<locals>.MyExceptionGroupNrKr!rr�MyExceptionGroupr/nrMrr0c��t|��r)r))�vs r�raiseVEzANestedExceptionGroupSplitTest.test_split_by_type.<locals>.raiseVEqs���Q�-�rc��t|��r)r)r�s r�raiseTEzANestedExceptionGroupSplitTest.test_split_by_type.<locals>.raiseTEts���A�,�rc�@������fd�����fd����fd�}|d�y)Nc���g}�|f�tf�|dzffD]\}}	||��td|��#t$r}|j|�Yd}~�<d}~wwxYw)Nr9�msg1)r~rr}r
)r�r>�fr�r�r5r3s     ��r�level1zVNestedExceptionGroupSplitTest.test_split_by_type.<locals>.nested_group.<locals>.level1xsh����� '��|�g�s�^�g�q��s�^�L�F�A�s�'��#��M�
%�V�T�2�2��%�'����A����'�s�3�	A�A�Ac���g}�|f�|dzf�|dzffD]\}}	||���d|��#t$r}|j|�Yd}~�9d}~wwxYw)Nr9r:�msg2)rr})r�r>r9r�r�r0r:r3s     ���r�level2zVNestedExceptionGroupSplitTest.test_split_by_type.<locals>.nested_group.<locals>.level2�sl����� &��{�V�Q�q�S�M�G�Q�q�S�>�J�F�A�s�'��#��K�
'�v�t�4�4��%�'����A����'�s�/�	A�A�Ac���g}�|dzf�|dzffD]\}}	||��td|��#t$r}|j|�Yd}~�<d}~wwxYw)Nr9r:�msg3)rr}r
)r�r>r9r�r�r=r3s     ��r�level3zVNestedExceptionGroupSplitTest.test_split_by_type.<locals>.nested_group.<locals>.level3�se����� &��!��}�w��!��n�=�F�A�s�'��#��>�
%�V�T�2�2��%�'����A����'�s�/�	A�A�A�r!)r@r:r=r0r5r3s @@���r�nested_groupzFNestedExceptionGroupSplitTest.test_split_by_type.<locals>.nested_groupws���
3�
5�
3�
�1�Irz
the note: r���rr9)
r
�add_note�idr)rr~r�r*r/r�r
r�r;)rrBr�r%r��valueErrors_template�typeErrors_templater�r�r0r5r3s         @@@r�test_split_by_typez0NestedExceptionGroupSplitTest.test_split_by_typems����	�~�	�	 �	�	�<	��N��A��	�#��
�1�
�>��A��	�#��
�1�
�>��1�
�
�

�q�M�
���A��
�1�
�.��A��
�1�
�.��1�
�
�

�q�M�
 ��"+�3�� 0�9�S�>�2B�C�D���"�"�2�~�{�C��0�0��[�A���t����%� ��"�"�4���E��0�0��]�C���t��"�"�5�.�+�F����$���0�0��j�)�5L�M���t��"�"�5�.�+�F����$���0�0��Z�@���t��"�"�5�.�:N�O��"�"�4��9L�M��0�0��i��5M�N���t��"�"�5�.�:M�N��"�"�4��9M�N��h�h�~�.���t��
�
�e�R� ����$���h�h�/�0���t��"�"�5�.�;�q�>�:J�K��"�"�4��+�a�.�9I�J��o�	�
�J�J��B�q�E�7�+�,��B��	�s�K!�!	L�*L�Lc	�`�d�}	td|td��|td��g��#t$r}|}Yd}~nd}~wwxYw|j|t�\}}|j|�|j
|ttd�td�g�|j|ttf�\}}|j
|ttd�td�g�|j|�|j|t�\}}|j
|ttd�g�|j
|ttd�g�|j|t�\}}|j
|ttd�g�|j
|ttd�g�y)Nc�8�	|�#t$r}|cYd}~Sd}~wwxYwr)r
)�exr�s  rr�zHNestedExceptionGroupSplitTest.test_split_BaseExceptionGroup.<locals>.exc�s!��
���� �
����
�s��	���rAr9r:)rr)rDr*rr�r�r
)rr�r�rAr�r�s      r�test_split_BaseExceptionGroupz;NestedExceptionGroupSplitTest.test_split_BaseExceptionGroup�s���	�	�$���J�q�M�*�C�0A�!�0D�,E�F�H�
H��!�	��C��	���0�0��i�@���t����%� ��"�"��$�z�!�}�6G��6J�&K�	M��0�0��*�/�0�2���t��"�"��%�
�1�
�7H��7K�'L�	N����$���0�0��j�A���t��"�"��>�J�q�M�?�	4��"�"��$�'8��';�&<�	>��0�0��6G�H���t��"�"��%�(9�!�(<�'=�	?��"�"��.�:�a�=�/�	3s�,1�	A�A�Ac��tdtd�td�g�}|jd�|jd�t	|j
�}|j
t�\}}|j|j
|�|j|j
|�|j|j
|�|j|j
|j
�|j|j
|j
�|j|j
|j
�|jd�|jd�|jd�|j|j
|dgz�|j|j
|dgz�|j|j
|dgz�y)Nr%r9r:�note1�note2r�r�)	r
r)rrErrr�ro�assertIsNot)rr%�
orig_notesr�r�s     r�test_split_copies_notesz5NestedExceptionGroupSplitTest.test_split_copies_notes�sL��
�D�:�a�=�)�A�,�"?�
@��
���G��
���G���"�,�,�'�
��h�h�y�)���t�������z�2�������*�5��������4�������u���7�������t�~�~�6�������$�.�.�9�
���D��
���w���
�
�f��������z�T�F�':�;�������*��y�*@�A��������v�h�)>�?rc���tdtd�td�g�}d|_|j	t�\}}|jt
|d��|jt
|d��y)Nr%r9r:�{r)r
r)rrr��assertFalse�hasattr)rr%r�r�s    r�+test_split_does_not_copy_non_sequence_noteszINestedExceptionGroupSplitTest.test_split_does_not_copy_non_sequence_notess`���D�:�a�=�)�A�,�"?�
@������h�h�y�)���t�������4�5������{�3�4rc�`�Gd�dt�}|dtd�td�g�}d}|jt|�5|j	t�ddd�|jt|�5|jt�ddd�y#1swY�>xYw#1swYyxYw)Nc��eZdZd�Zy)�KNestedExceptionGroupSplitTest.test_drive_invalid_return_value.<locals>.MyEgc��y)Nr2r!r=s  r�derivezRNestedExceptionGroupSplitTest.test_drive_invalid_return_value.<locals>.MyEg.derives��rN)rrr r]r!rr�MyEgr[s��
rr^r%r9r:z4derive must return an instance of BaseExceptionGroup)r
rr)rr�r�)rr^r%rUs    r�test_drive_invalid_return_valuez=NestedExceptionGroupSplitTest.test_drive_invalid_return_values���	�>�	��$��1��z�!�}�5�
6��D��
�
#�
#�I�s�
3��H�H�Y��4�
�
#�
#�I�s�
3��K�K�	�"�4�
3�4�
3��
3�
3�s�B�9B$�B!�$B-N)rrr rIrMrSrXr_r!rrr,r,ks ��aK�F&3�P@�(5�
#rr,c��eZdZd�Zd�Zd�Zy)�%NestedExceptionGroupSubclassSplitTestc�*�Gd�dt�}			td��#t$r}|d|g��d}~wwxYw#|$r-}	td��#t$r}|d||g��d}~wwxYwd}~wwxYw#|$r}|}Yd}~nd}~wwxYw|j||td�td�gg�|j	|t
�\}}|j
|�|j|ttd�td�gg�|j	|ttf�\}}|j|ttd�td�gg�|j
|�|j	|t�\}}|j|ttd�g�|j|ttd�gg�|j	|t�\}}|j|ttd�gg�|j|ttd�g�y)Nc��eZdZy)�nNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_no_derive_no_new_override.<locals>.EGNrKr!rr�EGrd%rMrrer:rmr9r%)r
rr)r�r*rr�)	rre�term�ver�r%r�r�s	         r�<test_split_ExceptionGroup_subclass_no_derive_no_new_overridezbNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_no_derive_no_new_override$s���	��	�	�	
1�-�#�A�,�&�� �-��X��t�,�,��-���
1�1�$�Q�-�'��!�1��T�B��<�0�0��1��
1��
�	��B��	��	
�"�"�2�r�J�q�M�I�a�L�>�+J�K��0�0��W�=���t����%� ��"�"��.�:�a�=�9�Q�<�.�"A�	C��0�0��j�)�5L�M���t��"�"��>�J�q�M�I�a�L�>�#B�	D����$���0�0��Z�@���t��"�"�5�.�:�a�=�/�J��"�"�4��9�Q�<�.�9I�J��0�0��Y�?���t��"�"�5�.�I�a�L�>�:J�K��"�"�4��*�Q�-��IsT��	6�
1�6�9�A+�A
�
	A#�A�A#�#A&�&A+�+A.�.A?�3A:�:A?c��Gd�dt�}	|dtd�td�gd��#|$r}|}Yd}~nd}~wwxYw|j||td�td�g�|j	|t
�\}}|j
|�|j|ttd�td�g�|j	|ttf�\}}|j|ttd�td�g�|j
|�|j	|t�\}}|j|ttd�g�|j|ttd�g�|j	|t�\}}|j|ttd�g�|j|ttd�g�y)Nc���eZdZ�fd�Z�xZS)�oNestedExceptionGroupSubclassSplitTest.test_split_BaseExceptionGroup_subclass_no_derive_new_override.<locals>.EGc�&��t�|�|||�Sr)�super�__new__)�clsr�r>�unused�	__class__s    �rrnzwNestedExceptionGroupSubclassSplitTest.test_split_BaseExceptionGroup_subclass_no_derive_new_override.<locals>.EG.__new__Ps���
�w��s�G�T�:�:r)rrr rn�
__classcell__)rqs@rrerkOs
���
;�
;rrer%r9r:rp)rr)rDr�r*rr�r
)rrer�r%r�r�s      r�=test_split_BaseExceptionGroup_subclass_no_derive_new_overridezcNestedExceptionGroupSubclassSplitTest.test_split_BaseExceptionGroup_subclass_no_derive_new_overrideNs���	;�#�	;�	��T�J�q�M�+<�Q�+?�@�(�K�K���	��B��	��	
�"�"���Z��]�$5�a�$8�9�	;��0�0��W�=���t����%� ��"�"��$�z�!�}�6G��6J�&K�	M��0�0���.�/�1���t��"�"��%�
�1�
�7H��7K�'L�	N����$���0�0��Z�@���t��"�"�5�.�:�a�=�/�J��"�"��$�'8��';�&<�	>��0�0��5F�G���t��"�"��%�(9�!�(<�'=�	?��"�"�4��*�Q�-��Is�/�A�;�Ac���G�fd�dt��			td��#t$r}�d|gd��d}~wwxYw#�$r.}	td��#t$r}�d||gd��d}~wwxYwd}~wwxYw#�$r}|}Yd}~nd}~wwxYw|j|�td�td�gg�|j	|t
�\}}|j
|�|j|�td�td�gg�|j|jd�|j|jdjd�|j	|ttf�\}}|j|�td�td�gg�|j|jd�|j|jdjd�|j
|�|j	|t�\}}|j|�td�g�|j|jd�|j|�td�gg�|j|jd�|j|jd	jd�|j	|t�\}}|j|�td�gg�|j|jd�|j|jd	jd�|j|�td�g�|j|jd�y)
Nc�*���eZdZ�fd�Z�fd�Z�xZS)�mNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_derive_and_new_overrides.<locals>.EGc�8��t�|�|||�}||_|Sr)rmrn�code)ror�r>rx�objrqs     �rrnzuNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_derive_and_new_overrides.<locals>.EG.__new__zs!����g�o�c�7�D�9������
rc�@���|j||j�Sr)r�rx)rr>res  �rr]ztNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_derive_and_new_overrides.<locals>.EG.derives����$�,�,��d�i�i�8�8r)rrr rnr]rr)rqres@�rrervys���
�

9�
9rrer:rm�er9r%r2r)
r
rr)r�r*rr�rorxr�)	rrfrmrgr�r%r�r�res	        @r�;test_split_ExceptionGroup_subclass_derive_and_new_overrideszaNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_derive_and_new_overridesxs����	9��	9�	�	
5�2�#�A�,�&�� �2��X��t�S�1�1��2���
5�5�$�Q�-�'��!�5��T�B��<��4�4��5��
5��
�	��B��	��	
�"�"�2�r�J�q�M�I�a�L�>�+J�K��0�0��W�=���t����%� ��"�"�4��j��m�i��l�^�-L�M�������B�'��������+�0�0�#�6��0�0��j�)�5L�M���t��"�"�5�"�z�!�}�y��|�n�.M�N�������R�(�����)�)�!�,�1�1�3�7����$���0�0��Z�@���t��"�"�5�"�z�!�}�o�>�������R�(��"�"�4��y��|�n�-=�>�������B�'��������+�0�0�#�6��0�0��Y�?���t��"�"�5�"�	�!��~�.>�?�������R�(�����)�)�!�,�1�1�3�7��"�"�4��j��m�_�=�������B�'sU�!�	:�5�:�=�A0�A�	A(�A#�#A(�(A+�+A0�0A3�3B�8A?�?BN)rrr rhrsr|r!rrrara"s��(J�T(J�T6(rra�__main__r)�collections.abcr�r�unittest�test.supportr�TestCaserr#r7rir�r�r�r�r�r�r�r�rr	rr,rar�mainr!rr�<module>r�s1�����*�
I�h�&7�&7�
I� ">��*�*�">�JF�x�(�(�F�R>)�h�'�'�>)�B�@)-�8�,�,�)-�X6�X�.�.�6�29H�"8�9H�xH9�5�H9�V"�h�&7�&7�"�$�:��)�)�:�"�0(!�%;�(!�VB�"8�B�Jt#�$?�t#�nL(�,G�L(�^�z���H�M�M�O�r

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