AlkantarClanX12

Your IP : 18.119.120.59


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/traceback.cpython-312.pyc

�

�Q�f������dZddlZddlZddlZddlZddlZddlmZgd�Z	d9d�Z
d�Zd:d�Zd9d�Z
d9d	�Zd
ZdZGd�d
�Ze�Zd�Zeedddfd�Zeeddfd�Zefd�Zd�Zefd�Zd;d�Zd<d�Zd;d�Zd=d�Zd:d�Zd:d�Zd�Z Gd�d�Z!d�Z"d�Z#d �Z$d!�Z%d"Z&Gd#�d$e'�Z(d%�Z)ejTd&gd'�d(d)g�*�Z+d+�Z,d,Z-d-�Z.Gd.�d/�Z/Gd0�d1�Z0d2Z1d3Z2d4Z3d5Z4d6�Z5d7�Z6d8�Z7y)>z@Extract, format and print information about Python stack traces.�N)�suppress)�
extract_stack�
extract_tb�format_exception�format_exception_only�format_list�format_stack�	format_tb�	print_exc�
format_exc�print_exception�
print_last�print_stack�print_tb�clear_frames�FrameSummary�StackSummary�TracebackException�
walk_stack�walk_tbc��|�tj}tj|�j	�D]}t||d���y)zyPrint the list of tuples as returned by extract_tb() or
    extract_stack() as a formatted stack trace to the given file.N���file�end)�sys�stderrr�	from_list�format�print)�extracted_listr�items   �0/opt/alt/python312/lib64/python3.12/traceback.py�
print_listr$s=���|��z�z���&�&�~�6�=�=�?��
�d��2�&�@�c�H�tj|�j�S)a�Format a list of tuples or FrameSummary objects for printing.

    Given a list of tuples or FrameSummary objects as returned by
    extract_tb() or extract_stack(), return a list of strings ready
    for printing.

    Each string in the resulting list corresponds to the item with the
    same index in the argument list.  Each string ends in a newline;
    the strings may contain internal newlines as well, for those items
    whose source text line is not None.
    )rrr)r!s r#rrs���!�!�.�1�8�8�:�:r%c�4�tt||��|��y)aPrint up to 'limit' stack trace entries from the traceback 'tb'.

    If 'limit' is omitted or None, all entries are printed.  If 'file'
    is omitted or None, the output goes to sys.stderr; otherwise
    'file' should be an open file or file-like object with a write()
    method.
    ��limit�rN)r$r)�tbr)rs   r#rr/s���z�"�E�*��6r%c�8�t||��j�S)z5A shorthand for 'format_list(extract_tb(tb, limit))'.r()rr�r+r)s  r#r
r
9s���b��&�-�-�/�/r%c�B�tjt|�|��S)a#
    Return a StackSummary object representing a list of
    pre-processed entries from traceback.

    This is useful for alternate formatting of stack traces.  If
    'limit' is omitted or None, all entries are extracted.  A
    pre-processed stack trace entry is a FrameSummary object
    containing attributes filename, lineno, name, and line
    representing the information that is usually printed for a stack
    trace.  The line is a string with leading and trailing
    whitespace stripped; if the source is not available it is None.
    r()r� _extract_from_extended_frame_gen�_walk_tb_with_full_positionsr-s  r#rr=s&���8�8�$�R�(��9�7�7r%zG
The above exception was the direct cause of the following exception:

zF
During handling of the above exception, another exception occurred:

c��eZdZd�Zy)�	_Sentinelc��y)Nz
<implicit>���selfs r#�__repr__z_Sentinel.__repr__[s��r%N)�__name__�
__module__�__qualname__r7r4r%r#r2r2Zs��r%r2c���|tu|tuk7rtd��||cxurturIn||fS|�@t|t�r||jfStdt
|�j�d���y||fS)Nz-Both or neither of value and tb must be givenzException expected for value, z found�NN)�	_sentinel�
ValueError�
isinstance�
BaseException�
__traceback__�	TypeError�typer8)�exc�valuer+s   r#�_parse_value_tbrF`s���
����i��0��H�I�I����i���"�9���?��#�}�-��C�-�-�-�-��<�#�C�y�1�1�2�&�:�;�
;���"�9�r%Tc�|�t|||�\}}tt|�|||d��}|j||��y)a�Print exception up to 'limit' stack trace entries from 'tb' to 'file'.

    This differs from print_tb() in the following ways: (1) if
    traceback is not None, it prints a header "Traceback (most recent
    call last):"; (2) it prints the exception type and value after the
    stack trace; (3) if type is SyntaxError and value has the
    appropriate format, it prints the line where the syntax error
    occurred with a caret on the next line indicating the approximate
    position of the error.
    T�r)�compact�r�chainN)rFrrCr )rDrEr+r)rrK�tes       r#r
r
os<�� ��U�B�/�I�E�2�	�D��K���%��	N�B��H�H�$�e�H�$r%c��t|||�\}}tt|�|||d��}t|j	|���S)azFormat a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    TrH�rK)rFrrC�listr)rDrEr+r)rKrLs      r#rr�sB�� ��U�B�/�I�E�2�	�D��K���%��	N�B���	�	��	�&�'�'r%c�x�|tur|}tt|�|dd��}t|j	��S)a�Format the exception part of a traceback.

    The return value is a list of strings, each ending in a newline.

    The list contains the exception's message, which is
    normally a single string; however, for :exc:`SyntaxError` exceptions, it
    contains several lines that (when printed) display detailed information
    about where the syntax error occurred. Following the message, the list
    contains the exception's ``__notes__``.
    NT)rI)r=rrCrOr)rDrErLs   r#rr�s9��
�	����	�D��K���d�	C�B���(�(�*�+�+r%c�D�t|d�}|�|sd|z}|S|�d|�d�}|S)N�	exceptionz%s
z: �
)�_safe_string)�etyperE�valuestr�lines    r#�_format_final_exc_linerX�s6���E�;�/�H��}�H���~���K�#�H�-���Kr%c�H�	||�S#d|�d|j�d�cYSxYw)N�<� z
() failed>)r8)rE�what�funcs   r#rTrT�s1��4��E�{���4��4�&��$�-�-��
�3�3�s�
�!c�F�ttj�|||��y)zEShorthand for 'print_exception(sys.exception(), limit, file, chain)'.�r)rrKN)r
rrRr_s   r#rr�s���C�M�M�O�5�t�5�Ir%c�`�djttj�||���S)z%Like print_exc() but return a string.r�r)rK)�joinrrrRras  r#rr�s!��
�7�7�#�C�M�M�O�5��N�O�Or%c�(�ttd�sttd�std��ttd�rttj|||�yttj
tjtj|||�y)zLThis is a shorthand for 'print_exception(sys.last_exc, limit, file, chain)'.�last_exc�	last_typezno last exceptionN)�hasattrrr>r
rdre�
last_value�last_tracebackr_s   r#rr�s`���3�
�#�G�C��,E��,�-�-��s�J������e�T�5�9���
�
�s�~�~�s�7I�7I��t�U�	,r%c�t�|�tj�j}tt	||��|��y)z�Print a stack trace from its invocation point.

    The optional 'f' argument can be used to specify an alternate
    stack frame at which to start. The optional 'limit' and 'file'
    arguments have the same meaning as for print_exception().
    Nr(r*)r�	_getframe�f_backr$r)�fr)rs   r#rr�s+��	�y��M�M�O�"�"���}�Q�e�,�4�8r%c�n�|�tj�j}tt	||���S)z5Shorthand for 'format_list(extract_stack(f, limit))'.r()rrjrkrr)rlr)s  r#r	r	�s*���y��M�M�O�"�"���}�Q�e�4�5�5r%c��|�tj�j}tj	t|�|��}|j
�|S)asExtract the raw traceback from the current stack frame.

    The return value has the same format as for extract_tb().  The
    optional 'f' and 'limit' arguments have the same meaning as for
    print_stack().  Each item in the list is a quadruple (filename,
    line number, function name, text), and the entries are in order
    from oldest to newest stack frame.
    r()rrjrkr�extractr�reverse)rlr)�stacks   r#rr�sA��	�y��M�M�O�"�"��� � ��A��e� �<�E�	�M�M�O��Lr%c�|�|�+	|jj�|j}|��*yy#t$rY�wxYw)zEClear all references to local variables in the frames of a traceback.N)�tb_frame�clear�RuntimeError�tb_next�r+s r#rr�sB��
�.�	��K�K�����Z�Z��

�.���	��	�s�/�	;�;c�h�eZdZdZdZddddddd�d�Zd�Zd�Zd	�Zd
�Z	d�Z
ed��Zed
��Z
y)ra>Information about a single frame from a traceback.

    - :attr:`filename` The filename for the frame.
    - :attr:`lineno` The line within filename for the frame that was
      active when the frame was captured.
    - :attr:`name` The name of the function or method that was executing
      when the frame was captured.
    - :attr:`line` The text from the linecache module for the
      of code that was running when the frame was captured.
    - :attr:`locals` Either None if locals were not supplied, or a dict
      mapping the name to the repr() of the variable.
    )�filename�lineno�
end_lineno�colno�	end_colno�name�_line�localsTN)�lookup_liner�rWr{r|r}c
��||_||_||_||_|r|j|r4|j�D�
�cic]\}
}|
t
|dt����c}}
nd|_||_	||_
|	|_ycc}}
w)a�Construct a FrameSummary.

        :param lookup_line: If True, `linecache` is consulted for the source
            code line. Otherwise, the line will be looked up when first needed.
        :param locals: If supplied the frame locals, which will be captured as
            object representations.
        :param line: If provided, use this instead of looking up the line in
            the linecache.
        �local�r]N)ryrzr~rrW�itemsrT�reprr�r{r|r})r6ryrzr~r�r�rWr{r|r}�k�vs            r#�__init__zFrameSummary.__init__	s���!��
������	���
���I�I�+1�����(�&���1��,�q�'��=�=�&�(�7;�	
��$�����
�"����	(s�A>c��t|t�rj|j|jk(xrO|j|jk(xr4|j|jk(xr|j
|j
k(St|t�r1|j|j|j|jf|k(StS�N)	r?rryrzr~r��tuplerW�NotImplemented�r6�others  r#�__eq__zFrameSummary.__eq__!s����e�\�*��M�M�U�^�^�3�0��K�K�5�<�<�/�0��I�I����+�0��K�K�5�<�<�/�
1��e�U�#��M�M�4�;�;��	�	�4�9�9�E��N�N��r%c�d�|j|j|j|jf|Sr�)ryrzr~rW)r6�poss  r#�__getitem__zFrameSummary.__getitem__+s&���
�
�t�{�{�D�I�I�t�y�y�A�#�F�Fr%c�p�t|j|j|j|jg�Sr�)�iterryrzr~rWr5s r#�__iter__zFrameSummary.__iter__.s&���T�]�]�D�K�K����D�I�I�F�G�Gr%c�f�dj|j|j|j��S)Nz7<FrameSummary file {filename}, line {lineno} in {name}>)ryrzr~)rryrzr~r5s r#r7zFrameSummary.__repr__1s0��H�O�O��]�]�4�;�;�T�Y�Y�P�H�	Hr%c��y)N�r4r5s r#�__len__zFrameSummary.__len__5s��r%c�2�|j|jSr�)rWrr5s r#�_original_linezFrameSummary._original_line8s��	
�	�	��z�z�r%c���|j�<|j�ytj|j|j�|_|jj�Sr�)rrz�	linecache�getlinery�stripr5s r#rWzFrameSummary.line>sH���:�:���{�{�"��"�*�*�4�=�=�$�+�+�F�D�J��z�z���!�!r%)r8r9r:�__doc__�	__slots__r�r�r�r�r7r��propertyr�rWr4r%r#rr�si���,�I�?C��d��4�4�#�0�G�H�H������
�"��"r%rc#��K�|�<tj�jjjj}|� ||jf��|j}|��yy�w)z�Walk a stack yielding the frame and line number for each frame.

    This will follow f.f_back from the given frame. If no frame is given, the
    current stack is used. Usually used with StackSummary.extract.
    N)rrjrk�f_lineno)rls r#rrGsS����	�y��M�M�O�"�"�)�)�0�0�7�7��
�-�����m��
�H�H���-�s�AA$�"A$c#�dK�|�*|j|jf��|j}|��)yy�w)z�Walk a traceback yielding the frame and line number for each frame.

    This will follow tb.tb_next (and thus is in the opposite order to
    walk_stack). Usually used with StackSummary.extract.
    N)rs�	tb_linenorvrws r#rrTs0����
�.��k�k�2�<�<�'�'�
�Z�Z��
�.�s�+0�0c#��K�|�qt|jj|j�}|d�"|j|jf|ddzf��n|j|f��|j
}|��pyy�w�Nr�)�_get_code_positionrs�f_code�tb_lastir�rv)r+�	positionss  r#r0r0_ss����
�.�&�r�{�{�'9�'9�2�;�;�G�	��Q�<���+�+����/�)�A�B�-�?�?�?��+�+�y�(�(�
�Z�Z��
�.�s�A2A7�5A7c�t�|dkry|j�}ttj||dzd��S)Nr)NNNN�)�co_positions�next�	itertools�islice)�code�instruction_index�
positions_gens   r#r�r�ms;���1��'��%�%�'�M��	� � ��0A�Q�0F��M�N�Nr%�c�`�eZdZdZedddd�d��Zedddd�d��Zed��Zd	�Zd
�Z	y)rz?A list of FrameSummary objects, representing a stack of frames.NTF�r)�lookup_lines�capture_localsc�B���fd�}|j|�|||��S)aWCreate a StackSummary from a traceback or stack object.

        :param frame_gen: A generator that yields (frame, lineno) tuples
            whose summaries are to be included in the stack.
        :param limit: None to include all frames or the number of frames to
            include.
        :param lookup_lines: If True, lookup lines for each frame immediately,
            otherwise lookup is deferred until the frame is rendered.
        :param capture_locals: If True, the local variables from each frame will
            be captured as object representations into the FrameSummary.
        c3�6�K��D]\}}||dddff���y�wr�r4)rlrz�	frame_gens  �r#�extended_frame_genz0StackSummary.extract.<locals>.extended_frame_gen�s)�����&�	��6��&�$��d�3�3�3�'�s�r�)r/)�klassr�r)r�r�r�s `    r#rozStackSummary.extractys/���	4��5�5�� ��L�)�6�+�	+r%c
�\�|�ttdd�}|�|dkrd}|�4|dk\rtj||�}nt	j
||��}|�}t
�}|D]�\}\}}	}
}|j}|j}
|j}|j|
�tj|
|j�|r
|j}nd}|jt!|
||d||	|
|�����|D]}
tj"|
��|r|D]}|j$�|S)N�tracebacklimitr)�maxlenF)r�r�r{r|r})�getattrrr�r��collections�deque�setr��co_filename�co_name�addr��	lazycache�	f_globals�f_locals�appendr�
checkcacherW)r�r�r)r�r��result�fnamesrlrzr{r|r}�coryr~r�s                r#r/z-StackSummary._extract_from_extended_frame_gen�s+���=��C�!1�4�8�E�� �U�Q�Y�������z�%�,�,�Y��>�	�'�-�-�i���G�	�������9B�5�A�5��
�E�9����B��~�~�H��:�:�D��J�J�x� �����!�+�+�6���:�:�����M�M�,��&�$�E�(�%�U�i�I�
J�:C��H�� � ��*����������
r%c	��t�}|D]I}t|t�r|j|��%|\}}}}|jt||||����K|S)z�
        Create a StackSummary object from a supplied list of
        FrameSummary objects or old-style list of tuples.
        �rW)rr?rr�)r��a_listr��frameryrzr~rWs        r#rzStackSummary.from_list�sW������E��%��.��
�
�e�$�/4�,��&�$���
�
�l�8�V�T��M�N���
r%c�(�g}|jdj|j|j|j��|j
�rM|j
j
�}|jdj|��|j}t|�}t|j
j��}||z
}|j���|j���t||j�}t||j�}	|||	}
d}|j|jk(r$tt�5t!|
�}ddd�nt|j#��}	|	|z
t|�ks |�r|j$|j&z
dkD�rt)||�dz}t)||	�dz}
|jd�|jd||z
z�|r�t)|
|j&�}t)|
|j$�}|j|j*|z�|j|j,||z
z�|j|j*|
|z
|z
z�n|jd|
|z
z�|jd	�|j.rMt1|j.j3��D]'\}}|jd
j||����)dj5|�S#1swY���xYw)
z�Format the lines for a single FrameSummary.

        Returns a string representing one frame involved in the stack. This
        gets called for every frame to be printed in the stack summary.
        z  File "{}", line {}, in {}
�    {}
Nrr�z    r[�^rSz    {name} = {value}
)r~rEr)r�rryrzr~rWr�r��len�lstripr|r}� _byte_offset_to_character_offsetr{r�	Exception�(_extract_caret_anchors_from_line_segment�rstrip�right_start_offset�left_end_offset�_display_width�primary_char�secondary_charr��sortedr�rb)r6�
frame_summary�row�
stripped_linerW�
orig_line_len�frame_line_len�stripped_characters�start_offset�
end_offset�code_segment�anchors�dp_start_offset�
dp_end_offset�dp_left_end_offset�dp_right_start_offsetr~rEs                  r#�format_frame_summaryz!StackSummary.format_frame_summary�s������
�
�2�9�9��"�"�M�$8�$8�-�:L�:L�N�	O����)�.�.�4�4�6�M��J�J�z�(�(��7�8� �/�/�D���I�M� ��!3�!3�!:�!:�!<�=�N�"/�.�"@���#�#�/�!�+�+�7�?��-�-�-� /��=��-�1�1�3�
�#�L��<���� �'�'�=�+C�+C�C�!�)�,�"J�<�"X��-�,�
"%�T�[�[�]�!3�J���,�s�=�/A�A��G�$>�$>��AX�AX�$X�[\�$\�'5�T�<�&H�1�&L�O�$2�4��$D�q�$H�M��J�J�v�&��J�J�s�o�8K�&K�L�M��-;�L�'�Ja�Ja�-b�*�0>�|�W�Mg�Mg�0h�-��
�
�7�#7�#7�:L�#L�M��
�
�7�#9�#9�=R�Ug�=g�#h�i��
�
�7�#7�#7�=�?�;Z�]r�;r�#s�t��
�
�3�-�/�*I�#J�K��J�J�t�$����%�m�&:�&:�&@�&@�&B�C���e��
�
�3�:�:��E�:�R�S� D��w�w�s�|��E-�,�s�>L�Lc��g}d}d}d}d}|D]�}|j|�}|��|�1||jk7s"|� ||jk7s|�||jk7rW|tkDr(|tz}|jd|�d|dkDrdnd�d��|j}|j}|j}d}|dz
}|tkDr��|j|���|tkDr(|tz}|jd|�d|dkDrdnd�d��|S)	aFormat the stack ready for printing.

        Returns a list of strings ready for printing.  Each string in the
        resulting list corresponds to a single frame from the stack.
        Each string ends in a newline; the strings may contain internal
        newlines as well, for those items with source text lines.

        For long sequences of the same frame and line, the first few
        repetitions are shown, followed by a summary line stating the exact
        number of further repetitions.
        Nrz  [Previous line repeated z
 more timer��srz]
)r�ryrzr~�_RECURSIVE_CUTOFFr�)r6r��	last_file�	last_line�	last_name�countr��formatted_frames        r#rzStackSummary.format
sM�����	��	��	���!�M�"�7�7�
�F�O��&���!�Y�-�2H�2H�%H��!�Y�-�2F�2F�%F��!�Y�-�2D�2D�%D��,�,��.�.�E��M�M�4�U�G�<�&+�a�i�s�R�8��=��*�2�2�	�)�0�0�	�)�.�.�	����Q�J�E��(�(���M�M�/�*�)"�,�$�$��&�&�E��M�M�,�U�G�4�#�a�i�s�R�0��5�
��
r%)
r8r9r:r��classmethodror/rr�rr4r%r#rrvs[��I��+/�d� �+��+�*�DH��e�'��'�R����$?�B-r%rc�b�|jd�}t|d|jdd���S)Nzutf-8�replace)�errors)�encoder��decode)�str�offset�as_utf8s   r#r�r�=s2���j�j��!�G��w�w���&�&�w�y�&�A�B�Br%�_Anchors)r�r�r�r��~r�)�defaultsc�t��ddl}	|j��}t|j�dk7ry�fd�}|jd}||j
d�x��S\}|x|jd�x��!\||jj�}||jj�}�||}t|�t|j��z
}	|jj|	z}
|
dz}|	dzt|�kr||	dzj�s|dz
}|
t��krL�|
x}j�s|dvr3|
dz
}
|dz
}|
t��kr�|
x}j�r�.|dvr�3t||
�||��S|jd�x��
\||jj�}
||j jdz�}|
t��krI�|
x}j�s|dk7r/|
dz
}
|
t��kr�|
x}j�r�)|dk7r�/|t��krI�|x}j�s|dk7r/|dz
}|t��kr�|x}j�r�)|dk7r�/|t��kr|dz
}t|
|�Syy#t$rYywxYw)Nrr�c���t�|�Sr�)r�)r�segments �r#�<lambda>z:_extract_caret_anchors_from_line_segment.<locals>.<lambda>Xs
���?���Pr%r4z)#�[�])�ast�parse�SyntaxErrorr��body�Expr�BinOp�left�end_col_offset�right�
col_offsetr��isspacer�	SubscriptrE�slice)
rr�tree�	normalize�	statement�expr�operator_start�operator_end�operator_str�operator_offset�left_anchor�right_anchor�chs
`            r#r�r�Ms�������y�y��!���4�9�9�~����P�I��	�	�!��I�
�
�X�X�^�� �S�Y�Y�[�%.�t�y�y�/G�/G�%H�N�#,�T�Z�Z�-B�-B�#C�L�#*�>�,�#G�L�&)�,�&7�#�l�>Q�>Q�>S�:T�&T�O�"&�)�)�":�":�_�"L�K�#.��?�L�'�!�+�c�,�.?�?� ,�_�q�-@� A� I� I� K�$��)��%��G��4���AU�;U�2�:^�:^�:`�df�jn�dn�#�q�(��$��)��&��G��4���AU�;U�2�:^�:^�:`�df�jn�dn�$�I�k�$:�I�l�<S�T�T�#!�$�]�]�_�"+�D�J�J�,E�,E�"F�K�#,�T�Z�Z�-F�-F��-J�#K�L�%��G��4���AU�;U�2�:^�:^�:`�df�jm�dm�#�q�(��&��G��4���AU�;U�2�:^�:^�:`�df�jm�dm�&��W��5�'�,�BW�<W�B�;`�;`�;b�fh�lo�fo�$��)��'��W��5�'�,�BW�<W�B�;`�;`�;b�fh�lo�fo�#�c�'�l�2�$��)��#�K��>�>�%��?�>��Q����s�J+�+	J7�6J7�WFc�^��|j�r|Sddl�t�fd�|d|D��S)z�Calculate the extra amount of width space the given source
    code segment might take if it were to be displayed on a fixed
    width output device. Supports wide unicode characters and emojis.rNc3�T�K�|]}�j|�tvrdnd���!y�w)r�r�N)�east_asian_width�_WIDE_CHAR_SPECIFIERS)�.0�char�unicodedatas  �r#�	<genexpr>z!_display_width.<locals>.<genexpr>�s1������!�D��
)�
)�$�
/�3H�
H��a�O�!�s�%()�isasciir/�sum)rWrr/s  @r#r�r�~s6����|�|�~��
������&�M���r%c� �eZdZd�Zd�Zdd�Zy)�_ExceptionPrintContextc�>�t�|_d|_d|_y)NrF)r��seen�exception_group_depth�
need_closer5s r#r�z_ExceptionPrintContext.__init__�s���E��	�%&��"���r%c�&�dd|jzzS)Nr[r�)r7r5s r#�indentz_ExceptionPrintContext.indent�s���a�$�4�4�4�5�5r%Nc#��K�|�d}|j�}|jr||dzz
}t|t�rt	j||d����y|D]}t	j||d�����y�w)N�|r[c��y�NTr4r�s r#r
z-_ExceptionPrintContext.emit.<locals>.<lambda>����Tr%c��yr>r4r�s r#r
z-_ExceptionPrintContext.emit.<locals>.<lambda>�r?r%)r:r7r?r�textwrap)r6�text_gen�margin_char�
indent_str�texts     r#�emitz_ExceptionPrintContext.emit�sp�������K��[�[�]�
��%�%��+��+�+�J��h��$��/�/�(�J�8I�J�J� ���o�o�d�J�8I�J�J�!�s�A6A8r�)r8r9r:r�r:rFr4r%r#r4r4�s�� �
6�Kr%r4c�r�eZdZdZdddddddd�d�Zed	��Zd
�Zd�Zd�Z	d
�Z
d�Zddd�d�Zddd�d�Z
y)ra�An exception ready for rendering.

    The traceback module captures enough attributes from the original exception
    to this intermediary form to ensure that no references are held, while
    still being able to fully print or format it.

    max_group_width and max_group_depth control the formatting of exception
    groups. The depth refers to the nesting level of the group, and the width
    refers to the size of a single exception group's exceptions array. The
    formatted output is truncated when either limit is exceeded.

    Use `from_exception` to create TracebackException instances from exception
    objects, or the constructor to create TracebackException instances from
    individual components.

    - :attr:`__cause__` A TracebackException of the original *__cause__*.
    - :attr:`__context__` A TracebackException of the original *__context__*.
    - :attr:`exceptions` For exception groups - a list of TracebackException
      instances for the nested *exceptions*.  ``None`` for other exceptions.
    - :attr:`__suppress_context__` The *__suppress_context__* value from the
      original exception.
    - :attr:`stack` A `StackSummary` representing the traceback.
    - :attr:`exc_type` The class of the original traceback.
    - :attr:`filename` For syntax errors - the filename where the error
      occurred.
    - :attr:`lineno` For syntax errors - the linenumber where the error
      occurred.
    - :attr:`end_lineno` For syntax errors - the end linenumber where the error
      occurred. Can be `None` if not present.
    - :attr:`text` For syntax errors - the text where the error
      occurred.
    - :attr:`offset` For syntax errors - the offset into the text where the
      error occurred.
    - :attr:`end_offset` For syntax errors - the end offset into the text where
      the error occurred. Can be `None` if not present.
    - :attr:`msg` For syntax errors - the compiler error message.
    NTF��
)r)r�r�rI�max_group_width�max_group_depth�_seenc�p	�|
du}|
�
t�}
|
jt|��||_|	|_t
j
t|�|||��|_||_	t|d�|_	t|dd�|_
|r�t!|t"�r�|j$|_|j&}
|
�t)|
�nd|_|j*}|�t)|�nd|_|j,|_|j.|_|j0|_|j2|_�n|rSt!|t4�rCt|dd��6t|dd�}t7|||�}|r�|xjd|�d�z
c_n�|r�t!|t8t:f�r�t|dd���t|dd�}t7|||�}|r|xjd|�d�z
c_t!|t8�rVt|dd�}|�G|t<j>vr5|r|xjd	|�d
�z
c_n|xjd|�d
�z
c_|r|jA�|�|jBnd|_!|�s||fg}|�r
|jE�\}}|ri|jF�]t|jF�|
vrFtItK|jF�|jF|jFjL|||||	|
�
�	}nd}|r|duxr|duxr
|jB}nd}|rk|jN�_|r]t|jN�|
vrFtItK|jN�|jN|jNjL|||||	|
�
�	}nd}|r\tQ|tR�rLg}|jTD]:}tItK|�||jL|||||	|
�
�	}|jW|��<nd}||_#||_'||_*|r'|jW|jF|jFf�|r'|jW|jN|jNf�|r/|jYt[|jT|jT��|r��	yyy#t$r%}dt|dt���g|_
Yd}~��%d}~wwxYw)Nr�rR�	__notes__z!Ignored error getting __notes__: �	name_fromz. Did you mean: 'z'?r~z Or did you forget to import '�'z. Did you forget to import 'F)r)r�r�rJrKrLT).r�r��idrJrKrr/r0rq�exc_typerT�_strr�rNr�r��
issubclassrryrzrr{rErr��msg�ImportError�_compute_suggestion_error�	NameError�AttributeErrorr�stdlib_module_names�_load_lines�__suppress_context__�pop�	__cause__rrCrA�__context__r?�BaseExceptionGroup�
exceptionsr��extend�zip)r6rR�	exc_value�
exc_tracebackr)r�r�rIrJrKrL�is_recursive_call�e�lno�end_lno�
wrong_name�
suggestion�queuerL�cause�need_context�contextrarD�texcs                         r#r�zTracebackException.__init__�so��"��-���=��E�E�
�	�	�"�Y�-� �.���.���!�B�B�(��7��l�)�C�+��
�!��
�!��K�8��	�	Z�$�Y��T�B�D�N�
�
�8�[�9�%�.�.�D�M��"�"�C�&)�o�#�c�(�4�D�K��*�*�G�.5�.A�c�'�l�t�D�O�!���D�I�#�*�*�D�K�'�2�2�D�O� �}�}�D�H�
�*�X�{�;��	�;��5�A� ��K��>�J�2�9�m�Z�X�J���	�	�0���B�?�?�	�
�*�X�	�>�/J�K��	�6�4�0�<� ��F�D�9�J�2�9�m�Z�X�J���	�	�0���B�?�?�	��(�I�.�$�Y���=�
��)�j�C�<S�<S�.S�!��	�	�'E�j�\�QR�%S�S�	��	�	�'C�J�<�q�%Q�Q�	������.7�.C�I�*�*��	
�!�
!��I�&�'�E���	�	����A��!�+�+�1��1�;�;��u�4�.��Q�[�[�)�������1�1�#�%1�'5�(7�(7�#�	%�E�!�E��$)�T�M�%?�$%�T�M�%?�()�(>�(>�$>�!�$(�L��!�-�-�3�$��A�M�M�):�%�)G�0��Q�]�]�+��
�
��
�
�3�3�#�%1�'5�(7�(7�#�	%�G�#�G���A�'9�:�!#�J� �|�|��1� ��I���-�-�"'�)5�+9�,;�,;�"'�	 )��#�)�)�$�/� ,�"&�J�$���!(��� *��
���L�L�"�,�,����!<�=���L�L�"�.�.�!�-�-�!@�A���L�L��R�]�]�A�L�L�!A�B��!��S�	Z�3�L��K�QU�4V�3W�X�Z�D�N�N��	Z�s�9R�	R5�R0�0R5c�D�|t|�||jg|��i|��S)z.Create a TracebackException from an exception.)rCrA)�clsrD�args�kwargss    r#�from_exceptionz!TracebackException.from_exceptionSs'���4��9�c�3�#4�#4�F�t�F�v�F�Fr%c�>�|jD]}|j�y)z7Private API. force all lines in the stack to be loaded.N)rqrW)r6r�s  r#r[zTracebackException._load_linesXs���Z�Z�E��J�J� r%c�`�t|t�r|j|jk(StSr�)r?r�__dict__r�r�s  r#r�zTracebackException.__eq__]s&���e�/�0��=�=�E�N�N�2�2��r%c��|jSr�)rSr5s r#�__str__zTracebackException.__str__bs���y�y�r%c#�4K�|j�td|j���y|jj}|jj}|dvrt|t�sd}|dz|z}t|jt�st||j���n|j|�Ed{���t|jtjj�rht|jttf�sH|jD]8}t|d�}|j!d�D�cgc]}|dz��	c}Ed{����:y|j�.dj#t|jdt$�	����yy7��cc}w7�I�w)
a�Format the exception part of the traceback.

        The return value is a generator of strings, each ending in a newline.

        Generator yields the exception message.
        For :exc:`SyntaxError` exceptions, it
        also yields (before the exception message)
        several lines that (when printed)
        display detailed information about where the syntax error occurred.
        Following the message, generator also yields
        all the exception's ``__notes__``.
        N)�__main__�builtinsz	<unknown>�.�noterSz{}
rNr�)rRrXrSr:r9r?rrTr�_format_syntax_errorrNr��abc�Sequence�bytesrT�splitrr�)r6�stype�smodr�ls     r#rz(TracebackException.format_exception_onlyesE�����=�=� �(��t�y�y�9�9���
�
�*�*���}�}�'�'���/�/��d�C�(�"���3�J��&�E��$�-�-��5�(���	�	�:�:��0�0��7�7�7�
�t�~�~�{���'?�'?�@��t�~�~��U�|�<�����#�D�&�1��.2�j�j��.>�?�.>��A��H�.>�?�?�?�'��^�^�
'��-�-��T�^�^�[�t� T�U�U�(�
8��@�?�s2�B7F�9F�:BF�:F�F�F�
AF�Fc#��K�d}|j�-dj|jxsd|j���n'|j�dj|j�}|j}|��|j	d�}|jd�}t
|�t
|�z
}dj|���|j��|j}|jd	vr|jn|}||k(s|d
k(r|dz}|dz
|z
}	|dz
|z
}
|	dk\r8d
�|d|	D�}djdj|�d|
|	z
zdz���|jxsd}dj|||���y�w)z0Format SyntaxError exceptions (internal helper).rNz  File "{}", line {}
z<string>z ({})rSz 
r�>Nr���r�rc3�DK�|]}|j�r|nd���y�w)r[N)r)r-�cs  r#r0z:TracebackException._format_syntax_error.<locals>.<genexpr>�s����!U�}�!��	�	��1��#<�}�s� z    {}{}r�z<no detail available>z	{}: {}{}
)rzrryrEr�r�r�rr�rbrU)
r6r��filename_suffixrE�rtext�ltext�spacesrr�r|r}�
caretspacerUs
             r#r�z'TracebackException._format_syntax_error�sp�������;�;�"�*�1�1��
�
�+��T�[�[�:�
:�
�]�]�
&�%�n�n�T�]�]�;�O��y�y�����K�K��%�E��L�L��)�E���Z�#�e�*�,�F��#�#�E�*�*��{�{�&�����04���y�0P�T�_�_�V\�
��Z�'�:��+;�!'�!��J���
�V�+��&��N�V�3�	��A�:�!U�u�V�e�}�!U�J�$�+�+�B�G�G�J�,?�#��UZ�IZ�B[�^b�Bb�d�d��h�h�1�1���!�!�%��o�>�>�s�E3E5�rK�_ctxc	#�K�|�
t�}g}|}|ri|rz|j�t}|j}n/|j�|jst
}|j}nd}d}|j
||f�|}|r�fn|j
d|f�t|�D�]\}}|�|j|�Ed{���|j�~|jrJ|jd�Ed{���|j|jj��Ed{���|j|j��Ed{�����|j|jkDr(|jd|j�d��Ed{�����|jdk(}|r|xjdz
c_
|jrP|jd|rdnd�	�Ed{���|j|jj��Ed{���|j|j��Ed{���t|j�}	|	|j kr|	}
n|j dz}
d
|_t%|
�D�]}||
dz
k(}|rd|_|j �||j k\}
nd
}
|
s|dz�nd}|j'�|dk(rd
ndzd|�d�z��|xjdz
c_
|
s)|j|j||��Ed{���n8|	|j z
}|dkDrdnd}|jd|�d|�d��Ed{���|r(|j"r|j'�dz��d
|_|xjdzc_
��|s���|jdk(sJ�d|_
��y7���7���7���7��{7��=7���7���7���7��7���w)a�Format the exception.

        If chain is not *True*, *__cause__* and *__context__* will not be formatted.

        The return value is a generator of strings, each ending in a newline and
        some containing internal newlines. `print_exception` is a wrapper around
        this method which just prints the lines to a file.

        The message indicating which exception occurred is always the last
        string in the output.
        Nz#Traceback (most recent call last):
z... (max_group_depth is z)
rr�z3Exception Group Traceback (most recent call last):
�+)rCFTz...z+-z  z+---------------- z ----------------
r�r�rzand z more exceptionrSz&+------------------------------------
)r4r^�_cause_messager_r\�_context_messager��reversedrFrarqrrr7rKr�rJr8�ranger:)r6rKr��outputrD�chained_msg�chained_excrU�is_toplevel�num_excs�n�ird�	truncated�title�	remaining�plurals                 r#rzTracebackException.format�s������<�)�+�D��������=�=�,�"0�K�"%�-�-�K��o�o�2��2�2�"2�K�"%�/�/�K�"&�K�"&�K��
�
�{�C�0�1�!���
�M�M�4��+�&� ��(�H�C�����9�9�S�>�)�)��~�~�%��9�9�#�y�y�)O�P�P�P�#�y�y����)9�)9�);�<�<�<��9�9�S�%>�%>�%@�A�A�A��+�+�d�.B�.B�B��9�9�.�t�/C�/C�.D�C�H�J�J�J� $�9�9�Q�>����.�.�!�3�.��9�9�#�y�y�N�-8�c�d� )� D�D�D� $�y�y����)9�)9�);�<�<�<��9�9�S�%>�%>�%@�A�A�A��s�~�~�.���t�3�3�3� �A��,�,�q�0�A�"'����q��A� !�Q�q�S��H��*.����+�+�7�%&�$�*>�*>�%>�	�$)�	�,5�q��s�e�5�E��;�;�=�$%�q�D�D�d�4�/��w�6I�J�K�L��.�.�!�3�.�$�#&�>�>�!�#4�#;�#;�%�d�#;�#S�S�S�$,�t�/C�/C�$C�	�(1�A�
��2��#'�9�9�"�9�+�_�V�H�B�G�$I�I�I� �D�O�O�#�{�{�}�H� I�J�*/����.�.�!�3�.�7"�:��5�5��:�:�:�12�D�.�})�)��Q��<��A��J��D��=��A��.T��I�s��A:O�=<O�9N4�:0O�*N7�+0O�N:�&O�N=�AO�O�AO�O�0O�O�&O�-O	�.C&O�O�8O�
O�AO�O�7O�:O�=O�O�O�O�	O�O�OrJc�r�|�tj}|j|��D]}t||d���y)z7Print the result of self.format(chain=chain) to 'file'.NrNrr)rrrr )r6rrKrWs    r#r zTracebackException.prints1���<��:�:�D��K�K�e�K�,�D��$�T�r�*�-r%)r8r9r:r�r�r�rur[r�rzrr�rr r4r%r#rr�sq��$�LEI��e�U���$�CC�J�G��G��
�
�%V�N"?�H#��b3�J!��+r%ri��(r�r�c�h�||k(ry|j�|j�k(rtStS)Nr)�lower�
_CASE_COST�
_MOVE_COST)�ch_a�ch_bs  r#�_substitution_costr�#s,���t�|���z�z�|�t�z�z�|�#����r%c��|�t|t�syt|t�r|j}	t	|�}n�t|t�r"	t|j�}t	|�}n�t|t�sJ�|�y|j�|j}|j��|j}t|j�t|j�zt|j�z}d|jvr |jd}t!||�rd|��St#|�t$kDryt#|�}|t&kDry|}	d}
|D]Q}||k(r�	t#|�|zdzt(zdz}t+||	dz
�}t-|||�}
|
|kDr�F|
r|
|	ks�N|}
|
}	�S|
S#t
$rYywxYw#t
$rYywxYw)Nr6zself.r��r�)r?rrY�obj�dirr�rV�
__import__r~rXrvrsrOr�r��
f_builtinsrfr��_MAX_CANDIDATE_ITEMS�_MAX_STRING_SIZEr��min�_levenshtein_distance)rdr+rjr��d�modr�r6�wrong_name_len�
best_distancerk�
possible_name�max_distance�current_distances              r#rWrW+s������J��!<���)�^�,��m�m��	��C��A�
�I�{�	+�	��Y�^�^�,�C��C��A��)�Y�/�/�/�
�:���j�j�$����B��j�j�$��������� ��5�?�?�#�
$��5�#�#�$�
%�	
��U�^�^�#��>�>�&�)�D��t�Z�(��z�l�+�+��1�v�$�$����_�N��(�(��"�M��J��
��J�&���M�*�^�;�a�?�:�M�QR�R���<���):�;��0��]�L�Y���l�*���-�
�=�&�J�,�M�����i�	��	���	��	�s#�F(� F7�(	F4�3F4�7	G�Gc	�
�||k(ryd}||dr+||dr&||||k(r|dz
}||dr||dr||||k(r�||d}||d}d}|d|xsdrC|d|xsdr:||dz
||dz
k(r)|dz}|d|xsdr|d|xsdr||dz
||dz
k(r�)|d|xsd}|d|xsd}|r|stt|�t|�zzSt|�tkDst|�tkDr|dzSt|�t|�kr||}}t|�t|�z
tz|kDr|dzStt	ttt|�dzzt��}d}t	t|��D]�}||}|tzx}	}t
j}
t	t|��D]E}|	t|||�z}||}	t||	�tz}
t|
|�}|||<||
ks�D|}
�G|
|kDs��|dzcS|Sr�)	r�r�r�rOr�r�maxsizer�r�)�a�b�max_cost�pre�postr�r��bindex�bchar�distance�minimum�index�
substitute�
insert_deletes              r#r�r�ise��	�A�v���C�
�C�D�'�a���g�!�C�&�A�c�F�"2��q����C�D�'�a���g�!�C�&�A�c�F�"2�	�#�$��A�	�#�$��A��D�
�M�T�\�T�
�q��$�,�$�/�A�d�1�f�I��4��6��4J���	���M�T�\�T�
�q��$�,�$�/�A�d�1�f�I��4��6��4J�	�-�4�<�4��A�	�-�4�<�4��A��A��S��V�c�!�f�_�-�-�
�1�v� � �C��F�-=�$=��!�|���1�v��A����!�1��	�A���Q���:�%��0��!�|��
�u�Z��s�1�v��z�!:�J�G�
H�C�
�F���A��-���&�	��"�Z�/�/��6��+�+���3�q�6�]�E�!�$6�u�a��h�$G�G�J��5�z�H� ���1�J�>�M���
�3�F� �C��J���� ��#��X���a�<��) �*�Mr%r�r<)NNTr>)NNN)8r��collections.abcr�r�r�rrA�
contextlibr�__all__r$rrr
rr�r�r2r=rFr
rrrXrrTrrrrr	rrrrrr0r�r�rOrr��
namedtuplerr�r,r�r4rr�r�r�r�r�rWr�r4r%r#�<module>r�s���F����
���$��'�;�$7�0�7�*&��
&��
��
�K�	��#,�	���T�%�"$-��$��(�)2�,�&�$'�4�J�P�	,� 	9�6�
� �L"�L"�^
���O���D�4�D�NC�
"�;�!�!����3�Z�	��-�^���$K�K�.s+�s+�l����
�
�
�
��;�|:r%