Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_sys_settrace.cpython-311.pyc
�

�Ke3����ddlmZddlZddlmZddlZddlZddlZddlm	Z	ddl
Z
ddlmZej
d���Gd�d	��ZGd
�d��Zd�Zd
�Zgd�e_d�Zgd�e_d�Zgd�e_d�Zgd�e_d�Zgd�e_d�Zgd�e_d�Zgd�e_d�Zd�Zgd�e_d�Zd�Zgd�e_d �Zd!�Zd"ge_d#�Zd$�Z gd%�e _d&�Z!gd'�e!_d(�Z"gd)�e"_d*�Z#gd+�e#_d,�Z$d-�Z%gd.�d/d0gd1zzd/d2gze%_Gd3�d4��Z&Gd5�d6ej'��Z(gd7�Z)Gd8�d9e(��Z*ej+Gd:�d;e(����Z,Gd<�d=ej'��Z-Gd>�d?��Z.d@�Z/dA�Z0GdB�dCej'��Z1GdD�dEej'��Z2GdF�dGej'��Z3e4dHkrej5��dSdS)I�)�supportN)�	MagicMock��wraps)�
import_helperT)�modulec�$�eZdZdZd�Zd�Zd�ZdS)�tracecontextz/Context manager that traces its enter and exit.c�"�||_||_dS�N��output�value��selfrrs   �@/usr/local/apps/python3/lib/python3.11/test/test_sys_settrace.py�__init__ztracecontext.__init__��������
�
�
�c�D�|j�|j��dSr�r�appendr�rs r�	__enter__ztracecontext.__enter__s ������4�:�&�&�&�&�&rc�F�|j�|j��dSrr�r�exc_infos  r�__exit__ztracecontext.__exit__s"������D�J�;�'�'�'�'�'rN)�__name__�
__module__�__qualname__�__doc__rrr�rrr
r
sG������9�9����'�'�'�(�(�(�(�(rr
c�$�eZdZdZd�Zd�Zd�ZdS)�asynctracecontextz>Asynchronous context manager that traces its aenter and aexit.c�"�||_||_dSrr
rs   rrzasynctracecontext.__init__rrc��HK�|j�|j��dSrrrs r�
__aenter__zasynctracecontext.__aenter__!s$��������4�:�&�&�&�&�&rc��JK�|j�|j��dSrrrs  r�	__aexit__zasynctracecontext.__aexit__$s&��������D�J�;�'�'�'�'�'rN)rr r!r"rr(r*r#rrr%r%sG������H�H����'�'�'�(�(�(�(�(rr%c�K�|D]}|WV��dS)z0Convert an iterable to an asynchronous iterator.Nr#)�iterable�xs  r�	asynciterr.'s,����
�����������rc��dS�N�r#r#rr�basicr2.s���1r)�r�call�r1�line�r1�returnc��d}~	d}dSr0r#�r-s r�arigo_example0r;=���	�A�	�
�	�A�A�Ar)r3r5��r6��r6��r6�rBr8c��d}~	d}dSr0r#r:s r�arigo_example1rEKr<rc��d}~	d}dSr0r#r:s r�arigo_example2rGYs��	�A�	�
�
���4r)r3r5r=r?��r6��r6�rKr8c��d}~d}dSr0r#r:s r�one_instr_linerNls��	�A�	�	�A�A�Ar�r3r5r=r?�r@r8c�<�d}td��D]	}|rd}�d}�
dS�Nr1r>��range)r-�as  r�no_pop_topsrVws<��	�A�
�1�X�X�����	��A�A��A�A�	�r)
r3r5r=r?��r6r=r?rHr=�r>r8c�$�d}|s	t|�	d}dSr0)�bla)�yr-s  r�
no_pop_blocksr]�s'��	�A�������	�A�A�Ar�r3r5r=rH�rIr8c�
�d}dSr0r#r:s r�calledra�s��	�A�A�Arc�"�t��dSr)rar#rrr4r4�s��
�H�H�H�H�Hr)r3r5����r4����r6�rfr8r7c��t�r��	Exceptionr#rr�raisesrk�s��
�Orc�F�	t��dS#t$rYdSwxYwr)rkrjr#rr�
test_raiserm�s6��
���������
�
�
����
���s��
 � )r3r5r=rcre�rf�	exceptionrg�r>ror?rHr_c�h�tj|��|tj��j_dSr)�sys�settrace�	_getframe�f_back�f_trace��	tracefuncs r�_settrace_and_returnry�s)���L�����%.�C�M�O�O��"�"�"rc�$�t|��dSr)ryrws r�settrace_and_returnr{�s����#�#�#�#�#rr7c�r�tj|��|tj��j_t
�r)rrrsrtrurv�RuntimeErrorrws r�_settrace_and_raiser~�s)���L�����%.�C�M�O�O��"�
�rc�H�	t|��dS#t$rYdSwxYwr)r~r}rws r�settrace_and_raiser��s=��
��I�&�&�&�&�&���
�
�
����
���s��
!�!)rpr?rHr_c�(�d}d}||kr|dz}dSdS)NrBr1r#)rU�bs  r�ireturn_exampler��s'��	�A�	�A��A�v�v�
�a�C�����r�r3r5r=r?rHr_c�h�tdd��}	d}	||}|dz
}�#t$rYdSwxYw)Nrr@r1�rT�
IndexError)�items�ir�s   r�tightloop_exampler��sV���!�Q�K�K�E�
�
��	��a��A�!�Q�$�!�	���
�
�
����
���s�#�
1�1)r3r5r=r?rHrArHrArHrArHrA)rBrorWrJrLc�\�tdd��}	d}||}�	#t$rYdSwxYw)Nr1rIrr�)r�r�s  r�tighterloop_exampler�sG���!�Q�K�K�E�
�
���1�X�����
�
�
����
���s��
+�+)r3r5r=r?rHrHrHrH)rIrorArW�rXr8c#� K�	dV�	dS#wxYw)NTr#r#rr�generator_functionr�s%������
�
�
���	��	�	�	�	s��
c�d�tt����}td��D]}|}�dS)N�
)�anyr�rT)r-r\s  r�generator_exampler�s>���� � �!�!�A��2�Y�Y����
����r)
r3r=����r4����r6����r6�r�r8)r�r4�r�ro����r6�r�r8rArWr�rCc�(�eZdZdd�Zd�Zd�Zd�ZdS)�TracerNc�0�||_||_g|_dSr)�trace_line_events�trace_opcode_events�events)rr�r�s   rrzTracer.__init__3s��!2���#6�� �����rc�V�|j�|j|_|j�|j|_dSdSr)r��
f_trace_linesr��f_trace_opcodes)r�frames  r�_reconfigure_framezTracer._reconfigure_frame8s8���!�-�"&�"8�E���#�/�$(�$<�E�!�!�!�0�/rc�|�|�|��|j�|j|f��|jSr�r�r�r�f_lineno�trace�rr��event�args    rr�zTracer.trace>s;������&�&�&�����E�N�E�2�3�3�3��z�rc��|�|��d�dD��|j�|j|f��|jS)Nc3�K�|]}|V��dSrr#)�.0�os  r�	<genexpr>z)Tracer.traceWithGenexp.<locals>.<genexpr>Es"������q�������r�r1r�r�s    r�traceWithGenexpzTracer.traceWithGenexpCsO������&�&�&���C���������E�N�E�2�3�3�3��z�r)NN)rr r!rr�r�r�r#rrr�r�2sU����������
=�=�=����
����rr�c���eZdZd�Zd�Zed���Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d �Z#d!�Z$d"�Z%d#�Z&d$�Z'd%�Z(d&�Z)d'�Z*d(�Z+d)�Z,d*�Z-d+�Z.d,�Z/d-�Z0d.�Z1d/�Z2d0�Z3d1�Z4d2�Z5d3�Z6d4�Z7d5�Z8d6�Z9d7�Z:d8�Z;d9�Z<d:�Z=d;�Z>d<�Z?d=�Z@d>�ZAd?�ZBd@�ZCdA�ZDdB�ZEdC�ZFeGjHdD���ZIdE�ZJdFS)G�
TraceTestCasec��tj��|_tj��|�t
jtj����dSr)�gc�	isenabled�using_gc�disable�
addCleanuprrrs�gettracers r�setUpzTraceTestCase.setUpNs<�������
�
�
���������c�l�n�n�5�5�5�5�5rc�>�|jrtj��dSdSr)r�r��enablers r�tearDownzTraceTestCase.tearDownSs%���=�	��I�K�K�K�K�K�	�	rc��t��S)z@Helper to allow test subclasses to configure tracers differently�r�r#rr�make_tracerzTraceTestCase.make_tracerWs
���x�x�rc
�����fd�|D��}||krT|�dd�tjd�|D��d�|D������z��dSdS)Nc�$��g|]\}}|�z
|f��
Sr#r#)r��l�e�line_offsets   �r�
<listcomp>z0TraceTestCase.compare_events.<locals>.<listcomp>]s&���<�<�<�6�A�q�1�{�?�A�&�<�<�<rz"events did not match expectation:
�
c�,�g|]}t|����Sr#��str�r�r-s  rr�z0TraceTestCase.compare_events.<locals>.<listcomp>as��(I�(I�(I�A��Q���(I�(I�(Irc�,�g|]}t|����Sr#r�r�s  rr�z0TraceTestCase.compare_events.<locals>.<listcomp>bs��(@�(@�(@�A��Q���(@�(@�(@r)�fail�join�difflib�ndiff)rr�r��expected_eventss `  r�compare_eventszTraceTestCase.compare_events\s����<�<�<�<�V�<�<�<���_�$�$��I�I�5��	�	�'�-�(I�(I��(I�(I�(I�(@�(@��(@�(@�(@�B�B�C�C�C�
D�
D�
D�
D�
D�%�$rc���|���}tj|j��|��tjd��|�|jj|j|��dSr)r�rrrsr�r��__code__�co_firstlinenor�)r�funcr��tracers    r�run_and_comparezTraceTestCase.run_and_comparedsp���!�!�#�#����V�\�"�"�"��������T�������D�M�8�"�M�6�	3�	3�	3�	3�	3rc�<�|�||j��dSr)r�r��rr�s  r�run_testzTraceTestCase.run_testls �����T�4�;�/�/�/�/�/rc���|���}||j��tjd��|�|jj|j|j��dSr)r�r�rrrsr�r�r�r�)rr�r�s   r�	run_test2zTraceTestCase.run_test2osg���!�!�#�#����V�\������T�������D�M�8�"�M�4�;�	8�	8�	8�	8�	8rc�X�tjd��tj���J�dSr�rrrsr�rs r�test_set_and_retrieve_nonez(TraceTestCase.test_set_and_retrieve_nonevs*����T�����|�~�~�%�%�%�%�%rc��d�}tj|��	tj��|usJ�	tjd��dS#tjd��wxYw)Nc��dSrr#��argss r�fnz4TraceTestCase.test_set_and_retrieve_func.<locals>.fn{����Drr�)rr�s  r�test_set_and_retrieve_funcz(TraceTestCase.test_set_and_retrieve_funczsn��	�	�	�	��R����	��<�>�>�R�'�'�'�'�'��L��������C�L��������s�A�Ac�:�|�t��dSr)r�r2rs r�
test_01_basiczTraceTestCase.test_01_basic�s���
�
�e�����rc�:�|�t��dSr)r�r;rs r�test_02_arigo0zTraceTestCase.test_02_arigo0�����
�
�n�%�%�%�%�%rc�:�|�t��dSr)r�rErs r�test_02_arigo1zTraceTestCase.test_02_arigo1�r�rc�:�|�t��dSr)r�rGrs r�test_02_arigo2zTraceTestCase.test_02_arigo2�r�rc�:�|�t��dSr)r�rNrs r�test_03_one_instrzTraceTestCase.test_03_one_instr�r�rc�:�|�t��dSr)r�r]rs r�test_04_no_pop_blocksz#TraceTestCase.test_04_no_pop_blocks�s���
�
�m�$�$�$�$�$rc�:�|�t��dSr)r�rVrs r�test_05_no_pop_topsz!TraceTestCase.test_05_no_pop_tops�s���
�
�k�"�"�"�"�"rc�:�|�t��dSr)r�r4rs r�test_06_callzTraceTestCase.test_06_call�s���
�
�d�����rc�:�|�t��dSr)r�rmrs r�
test_07_raisezTraceTestCase.test_07_raise�s���
�
�j�!�!�!�!�!rc�:�|�t��dSr)r�r{rs r�test_08_settrace_and_returnz)TraceTestCase.test_08_settrace_and_return�s�����*�+�+�+�+�+rc�:�|�t��dSr)r�r�rs r�test_09_settrace_and_raisez(TraceTestCase.test_09_settrace_and_raise�s�����)�*�*�*�*�*rc�:�|�t��dSr)r�r�rs r�test_10_ireturnzTraceTestCase.test_10_ireturn�s���
�
�o�&�&�&�&�&rc�:�|�t��dSr)r�r�rs r�test_11_tightloopzTraceTestCase.test_11_tightloop�s���
�
�'�(�(�(�(�(rc�:�|�t��dSr)r�r�rs r�test_12_tighterloopz!TraceTestCase.test_12_tighterloop�s���
�
�)�*�*�*�*�*rc�B�|�t��|���}tj|j��t��tjd��|�tjj|j	tj	��dSr)
r�r�r�rrrsr�r�r�r�r�)rr�s  r�test_13_genexpzTraceTestCase.test_13_genexp�s����
�
�'�(�(�(�
�!�!�#�#����V�+�,�,�,�������T�������-�6�E�"�M�+<�+C�	E�	E�	E�	E�	Erc�<�d�}|�|gd���dS)Nc�
�d}dS)NTFrr#r:s r�onlinersz2TraceTestCase.test_14_onliner_if.<locals>.onliners�s���Q��1r)r3r5r?rP�r�)rrs  r�test_14_onliner_ifz TraceTestCase.test_14_onliner_if�sG��	�	�	�	
����
�
�
�	�	�	�	�	rc�r�d�}|�|gd���d�}|�|gd���dS)Nc�*�td��D]}�dS�Nr>rSr:s r�for_examplez0TraceTestCase.test_15_loops.<locals>.for_example�s$���1�X�X�
�
���
�
r)r3r5r=r5r=r5r7c�0�d}|dkr
|dz}|dk�dSdS)Nr>rr1r#r:s r�
while_examplez2TraceTestCase.test_15_loops.<locals>.while_example�s,���A��a�%�%��Q����a�%�%�%�%�%�%r)r3r=r?rHr?rHr?rPr)rrrs   r�
test_15_loopszTraceTestCase.test_15_loops�s���	�	�	�	
����
�
�
�	�	�	�	�	�	�
	
����
�
�
�		�		�		�		�		rc�f�i}td|��|�|dgd���dS)Nadef f():
































































































































































































































































    pass�f)r3)�r6)rr8��execr�)r�	namespaces  r�test_16_blank_linesz!TraceTestCase.test_16_blank_lines�sP���	��
3�Y�?�?�?�����c�N�
�
�
�	�	�	�	�	rc�<�d�}|�|ddg��dS)Nc�:�dtj��_d}dSr)rrrtrv)�linenos rr�z0TraceTestCase.test_17_none_f_trace.<locals>.func�s��&*�C�M�O�O�#��F�F�Frr3r5rr�s  r�test_17_none_f_tracez"TraceTestCase.test_17_none_f_trace�sB��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�\�		t�#t$r}�d}~wwxYw#t$rYdSwxYwrri)r�r-r\s   rr�z4TraceTestCase.test_18_except_with_name.<locals>.func�sW��
�$�#�O�� �$�$�$������$������
�
�
����
���s�
�
����
+�+)
r3r5r=r?�r@rorHrA��r6)�	r6)r*r8rr�s  r�test_18_except_with_namez&TraceTestCase.test_18_except_with_name�sF��		�		�		�	
���T�	
�	
�	
�
	�
	�
	�
	�
	rc�<�d�}|�|gd���dS)Nc�H�		t�#d}wxYw#t$rd}YdSwxYw)N�	Something�ri)r\r�s  rr�z7TraceTestCase.test_19_except_with_finally.<locals>.funcsE��
�$�#�O��#�A�O�O�O�O���
�
�
������
���s�
���!�!)	r3r5r=r?r'rArWrJrLrr�s  r�test_19_except_with_finallyz)TraceTestCase.test_19_except_with_finallysF��	�	�	�	
���T�
�
�
�		�		�		�		�		rc����Gd�d����fd���fd�}|���}gd�}	||j��n#t$rYnwxYw|��jj|j|��dS)Nc� �eZdZd�Zd�Zd�ZdS)�BTraceTestCase.test_20_async_for_loop.<locals>.AsyncIteratorWrapperc�.�t|��|_dSr)�iter�_it)r�objs  rrzKTraceTestCase.test_20_async_for_loop.<locals>.AsyncIteratorWrapper.__init__s����9�9����rc��|Srr#rs r�	__aiter__zLTraceTestCase.test_20_async_for_loop.<locals>.AsyncIteratorWrapper.__aiter__����rc��ZK�	t|j��S#t$rt�wxYwr)�nextr6�
StopIteration�StopAsyncIterationrs r�	__anext__zLTraceTestCase.test_20_async_for_loop.<locals>.AsyncIteratorWrapper.__anext__!s:����-����>�>�)��$�-�-�-�,�,�-���s��*N)rr r!rr9r?r#rr�AsyncIteratorWrapperr3sA������
%�
%�
%�
�
�
�
-�
-�
-�
-�
-rr@c��<�K��d��23d{V��}|}�
6d}dS)N�abc�*r#)�letterr-r\r@s   �r�
doit_asyncz8TraceTestCase.test_20_async_for_loop.<locals>.doit_async'sO����� 4� 4�U� ;� ;�
�
�
�
�
�
�
�f����!<��A�A�As�c�������}	tj|��|�d��tjd��dS#tjd��wxYwr)rrrs�send)r�r-rEs  �r�runz1TraceTestCase.test_20_async_for_loop.<locals>.run,s^����
���A�
#���V�$�$�$����t������T�"�"�"�"�"����T�"�"�"�"���s�)A�A")(r3r5)i�r4)���r6)rIr8�i����r4����r6�rLr8r�r�r�r��r1ror=r5r�r�r�r�rNr=r5r�r�r�r�rNr=r5r�r�r�r��rdr6rernrgrNr?rP)r�r�rjr�r�r�r�)rrHr�r�r@rEs    @@r�test_20_async_for_loopz$TraceTestCase.test_20_async_for_loops�����	-�	-�	-�	-�	-�	-�	-�	-�	�	�	�	�	�
	#�	#�	#�	#�	#��!�!�#�#��(�(�(��R	��C���������	�	�	��D�	�������J�/�>�"�M�6�	3�	3�	3�	3�	3s�A�
A�Ac���d���fd�}|���}|��}	tj|j��|�d��n#t
$rYnwxYwtjd��n#tjd��wxYwgd�}|�|jj|j	|��dS)Nc�8K�t|��D]}|WV��dSrrS)�nr�s  r�arangezGTraceTestCase.test_async_for_backwards_jump_has_no_line.<locals>.arangefs2�����1�X�X�
�
��������
�
rc��F�K��d��23d{V��}|dkrdS�6dS)Nr@�dr#)r�rTs �rrzBTraceTestCase.test_async_for_backwards_jump_has_no_line.<locals>.fisU�����!�6�!�9�9�
�
�
�
�
�
�
�a��s�7�7��E�E��%�9�9s� )r3r5rcrer�r�rNr=r5�r�r4rer�r�rNr=r5rWrer�r�rNr=r5rWrergrNr7)
r�rrrsr�rGrjr�r�r�r�)rrr��coror�rTs     @r�)test_async_for_backwards_jump_has_no_linez7TraceTestCase.test_async_for_backwards_jump_has_no_linees����	�	�	�	�	�	�	�	�
�!�!�#�#���q�s�s��	��L���&�&�&��I�I�d�O�O�O�O���	�	�	��D�	����
�L�������C�L���������
�
�
��<	
���A�J�5�"�M�6�	3�	3�	3�	3�	3s)�.A�A=�
A%�"A=�$A%�%A=�=Bc�<�d�}|�|gd���dS)Nc��	dSrr#r#rrr�z1TraceTestCase.test_21_repeated_pass.<locals>.func�s
����Dr�r3r5r=rYrr�s  r�test_21_repeated_passz#TraceTestCase.test_21_repeated_pass�sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�"�	dD]}�dS#YdSxYw)Nr#r1r>r#�r�s rr�z3TraceTestCase.test_loop_in_try_except.<locals>.func�s)��
��!�!�A�A��q��
��q�q���s�	�rOrr�s  r�test_loop_in_try_exceptz%TraceTestCase.test_loop_in_try_except�sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�B���fd��|��gd���dS)Nc�D��					�jdkr	n#YnxYwdS#wxYw�NF�Fred)r�r�s�rr�z8TraceTestCase.test_try_except_no_exception.<locals>.func�sI���

������=�F�*�*����
������������s�����	r3r5r=rWrJ�r�r6��r6��r6�rlr8rr�s @r�test_try_except_no_exceptionz*TraceTestCase.test_try_except_no_exception��Q���	�	�	�	�	� 	
���T�
�
�
�		�		�		�		�		rc�<�d�}|�|gd���dS)Nc�R�				t�#YnxYw	n#wxYwn#YnxYwdS#wxYwrrir#rrr�z6TraceTestCase.test_try_exception_in_else.<locals>.func�sU��

����#�O��	��A����A�
��B�B�B�B�B��
������������s(�������$��$�&)r3r5r=r?rJr()r)rorhri��r6rkrmrr�s  r�test_try_exception_in_elsez(TraceTestCase.test_try_exception_in_else�sF��	�	�	� 	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�`�td��D]}td��D]}||z}��|dkS)Nr>r1rS)r��jrUs   rr�z-TraceTestCase.test_nested_loops.<locals>.func�sE���1�X�X�
�
���q�����A��A��A�A����6�Mr)r3r5r=r?r=r?r=r5r=r?r=r?r=r5rHr_rr�s  r�test_nested_loopszTraceTestCase.test_nested_loops�sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�H�ddg}|r|���}|rn|�d}|S)Nr1r�c��pop)�seqrSs  rr�z)TraceTestCase.test_if_break.<locals>.funcsA���a�&�C��
��G�G�I�I������
�
���Hr)r3r5r=r?rHr=r?rHrAr(�r)r8rr�s  r�
test_if_breakzTraceTestCase.test_if_breaksF��	�	�	�	
���T�

�

�

�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc��d\}}}}	td��D]}	d}|dkr	d}nd}d}�#d}wxYwn	#d}YnxYw|dkr|dkr|dksJ�dS)	N)r1r1r1r{r@rBrr�r)rsr1rS)rU�c�dr�s    rr�z6TraceTestCase.test_break_through_finally.<locals>.func's���$�J�A�q�!�Q�

��q�����A�����q�5�5�!�����������B��������
����������6�6�a�2�g�g�!�q�&�&�&�&�&�&s �5�-�5�-�5�1�5�;)r3r5r=r?rHrArWr(rhr?rHrArWrJrh��
r6�r�r8rr�s  r�test_break_through_finallyz(TraceTestCase.test_break_through_finally%sF��
	1�
	1�
	1�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc��d\}}}}}	td��D]}	d}|dkr	d}�d}d}�#d}wxYwn	#d}YnxYw||||fdksJ�dS)	N)r1r1r1r1r{r>rBrr�r)rs)rBr)r�r1rS)rUr�r�r�r�s     rr�z9TraceTestCase.test_continue_through_finally.<locals>.funcKs���*�M�A�q�!�Q��

��q�����A�����q�5�5�$����������B��������
���������q�!�Q�<�=�0�0�0�0�0�0s �5�-�5�-�5�1�5�;)r3r5r=r?rHrArWr(rhr?rHrArWrJrhr?r�r�rr�s  r�test_continue_through_finallyz+TraceTestCase.test_continue_through_finallyIsF��
	1�
	1�
	1�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc��		dS#wxYwrr#r#rrr�z7TraceTestCase.test_return_through_finally.<locals>.funcps��
��������s�r^rr�s  r�test_return_through_finallyz)TraceTestCase.test_return_through_finallynsF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�D�	ddzn#t$rYnwxYwdS#YdSxYw)Nr>rrX)r�r#rrr�z;TraceTestCase.test_try_except_with_wrong_type.<locals>.funcsH��
��!������
�
�
���
�����q��q�q�q�q�q�q�qs���
����)r3r5r=rpr?rWr�rr�s  r�test_try_except_with_wrong_typez-TraceTestCase.test_try_except_with_wrong_type}sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�D�d}dg}|r|���|r	�dSr0r|��TRUEr-s  rr�z3TraceTestCase.test_break_to_continue1.<locals>.func�s;���D���A��
�����������	
�
r)
r3r5r=r?rHrArWrJr?rPrr�s  r�test_break_to_continue1z%TraceTestCase.test_break_to_continue1�sF��	�	�	�	
���T�	
�	
�	
�
	�
	�
	�
	�
	rc�<�d�}|�|gd���dS)Nc�L�d}dg}|r|���|rn�|�dSdSr0r|r�s  rr�z3TraceTestCase.test_break_to_continue2.<locals>.func�sO���D���A��
������������
�
�
�
�
r)	r3r5r=r?rHrArWr?rPrr�s  r�test_break_to_continue2z%TraceTestCase.test_break_to_continue2�sF��	�	�	�	
���T�
�
�
�		�		�		�		�		rc�<�d�}|�|gd���dS)Nc��d}|r|r	dSdSr0r#)r�s rr�z/TraceTestCase.test_break_to_break.<locals>.func�s)���D��
������
�
r)r3r5r=r?rHrArCrr�s  r�test_break_to_breakz!TraceTestCase.test_break_to_break�sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�:�dx}}|dkr|dkrd}dSd}dSd}dS)Nr1rIrXr)r#)rUr�r-r\�zs     rr�z+TraceTestCase.test_nested_ifs.<locals>.func�s8���I�A���A�v�v���6�6��A�A�A��A�A�A����rr�rr�s  r�test_nested_ifszTraceTestCase.test_nested_ifs�sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�V�������fd�}dx��d�|�|gd���dS)Nc�V���r�r�r	trdSdSdSdStr	trdSdSdS)NFT)�D�E�F)�A�B�Cs���rr�z4TraceTestCase.test_nested_ifs_with_and.<locals>.func�sk����
��!��)��)�#(�5�)�)�)�)�!�5��
�q�
��t�
�
�
�
rTFrOr)rr�r�r�r�s  @@@r�test_nested_ifs_with_andz&TraceTestCase.test_nested_ifs_with_and�sk�����		�		�		�		�		�		�		����A������T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�d�d}	ddzn$#t$r|dkrt���YnwxYwd}dS)N�hellor@r�raiserK)�ZeroDivisionError�
ValueError)r-rs  rr�z.TraceTestCase.test_nested_try_if.<locals>.func�sW���A�
'��!�����$�
'�
'�
'���<�<�$�,�,�&� �<�
'�����A�A�As�
�+�+�	r3r5r=r?r'rHrArJrLrr�s  r�test_nested_try_ifz TraceTestCase.test_nested_try_if��F��	�	�	�	
���T�
�
�
�		�		�		�		�		rc�\��Gd�d����fd�}|�|gd���dS)Nc��eZdZd�Zd�ZdS)�.TraceTestCase.test_if_false_in_with.<locals>.Cc��|Srr#rs rrz8TraceTestCase.test_if_false_in_with.<locals>.C.__enter__r:rc��dSrr#r�s rrz7TraceTestCase.test_if_false_in_with.<locals>.C.__exit__����rN�rr r!rrr#rrr�r��2������
�
�
�
�
�
�
�
rr�c�P�����5	ddd��dS#1swxYwYdSrr#�r�s�rr�z1TraceTestCase.test_if_false_in_with.<locals>.funcsx�������
�
��
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s���)r3r5�r�r4r�r�r=r5rcrergr7r)rr�r�s  @r�test_if_false_in_withz#TraceTestCase.test_if_false_in_withsy���	�	�	�	�	�	�	�	�	�	�	�	�	�
	
���T�

�

�

�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�8�	dS#t$rtYdSwxYwr)rj�Xr#rrr�z7TraceTestCase.test_if_false_in_try_except.<locals>.func-s7��
�����
�
�
������
���s��r\rr�s  r�test_if_false_in_try_exceptz)TraceTestCase.test_if_false_in_try_except+sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc� �Gd�d��}dS)Nc�&�eZdZddkrdZdSdZdS)�DTraceTestCase.test_implicit_return_in_class.<locals>.func.<locals>.Ar@r*r1r>N)rr r!rUr#rrr�r�=s%�������q�5�5��A�A�A��A�A�Arr�r#)r�s rr�z9TraceTestCase.test_implicit_return_in_class.<locals>.func<s4��
�
�
�
�
�
�
�
�
�
r�r3r5)r1r4r5r=r?rPr7rr�s  r�test_implicit_return_in_classz+TraceTestCase.test_implicit_return_in_class:sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�\�		dS#t$r}Yd}~dSd}~wwxYw#t$rYdSwxYwrri��exs rr�z+TraceTestCase.test_try_in_try.<locals>.funcNs_��
���D�� �����D�D�D�D�D�����������
�
�
����
���s�
����
+�+rOrr�s  r�test_try_in_tryzTraceTestCase.test_try_in_tryMsF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�r�d�}|�|gd���d�}|�|gd���dS)Nc�f�		t�#t$r}Yd}~dSd}~wwxYw#t$rYdSwxYwr)�	TypeErrorr�r�s rr�z:TraceTestCase.test_try_in_try_with_exception.<locals>.func`s_��
��#�O��!�����A�A�A�A�A�����������
�
�
����
�����
�
�"��"�
0�0�	r3r5r=r?r'rHrWrJrLc�f�		t�#t$r}Yd}~dSd}~wwxYw#t$rYdSwxYwr�r�r�r�s rr�z:TraceTestCase.test_try_in_try_with_exception.<locals>.functs`��
��$�$��!�����A�A�A�A�A�����������
�
�
����
���r�)r3r5r=r?r'rHrArCrr�s  r�test_try_in_try_with_exceptionz,TraceTestCase.test_try_in_try_with_exception^s���	�	�	�	
���T�
�
�
�		�		�		�	�	�	�	
���T�
�
�
�	�	�	�	�	rc�>�dd�}|�|gd���dS)Nrr1c��|r
|r|rdSdSdSdSrr#)rU�pr�s   rr�z/TraceTestCase.test_if_in_if_in_if.<locals>.func�s5���
���������	���rr\)rr1r1rr�s  r�test_if_in_if_in_ifz!TraceTestCase.test_if_in_if_in_if�sK��	�	�	�	�	
���T�
�
�
�	�	�	�	�	rc���Gd�d����fd�}�fd�}|�|gd���|�|gd���dS)Nc��eZdZd�Zd�ZdS)�-TraceTestCase.test_early_exit_with.<locals>.Cc��|Srr#rs rrz7TraceTestCase.test_early_exit_with.<locals>.C.__enter__�r:rc��dSrr#r�s rrz6TraceTestCase.test_early_exit_with.<locals>.C.__exit__�r�rNr�r#rrr�r��r�rr�c�Z��dD]&}���5	ddd��n#1swxYwY�'dS)N�r1r>r#)r�r�s �r�
func_breakz6TraceTestCase.test_early_exit_with.<locals>.func_break�s�����
�
���Q�S�S�������������������������Ds��#	�#	c�P�����5	ddd��dS#1swxYwYdSrr#r�s�r�func_returnz7TraceTestCase.test_early_exit_with.<locals>.func_return�sv�������
�
��
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s���)
r3r5r=r�r�r�r?r=rcrergrHr_)r3r5)rIr4)���r6)r�r8r=r5rJrKrMr7r)rr�r�r�s   @r�test_early_exit_withz"TraceTestCase.test_early_exit_with�s����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	
���Z�
�
�
�
	�
	�
	�	
���[�

�

�

�	�	�	�	�	rc�H��d���fd�}|�|gd���dS)Nc�>�|r	d|dz
zn#t$rYnwxYw|Sr0�r�r:s r�fooz;TraceTestCase.test_flow_converges_on_same_line.<locals>.foo�sC���
���q�1�u�I�I�I��(�����D������Hs�
�
�c�B��td��D]
}�|���dSrrS)r�r�s �rr�z<TraceTestCase.test_flow_converges_on_same_line.<locals>.func�s1����1�X�X�
�
����A�����
�
r)r3r5r=�rLr4�i����r6rergr5r=r�r�)r�r6r�)r�ror�rOrergr5r7r)rr�r�s  @r� test_flow_converges_on_same_linez.TraceTestCase.test_flow_converges_on_same_line�s`���	�	�	�	�	�	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�L�d}	d|zn#t$r
}|r�Yd}~nd}~wwxYwdS)Nrr1�doner�)r-�errors  rr�zCTraceTestCase.test_no_tracing_of_named_except_cleanup.<locals>.func�sa���A�
��!�����$�
�
�
�������������
�����6s�
�
!��!r�rr�s  r�'test_no_tracing_of_named_except_cleanupz5TraceTestCase.test_no_tracing_of_named_except_cleanup�sF��	�	�	�	
���T�	�	�	�		�		�		�		�		rc�\��Gd�d����fd�}|�|gd���dS)Nc��eZdZd�Zd�ZdS)�DTraceTestCase.test_tracing_exception_raised_in_with.<locals>.NullCtxc��|Srr#rs rrzNTraceTestCase.test_tracing_exception_raised_in_with.<locals>.NullCtx.__enter__r:rc��dSrr#)r�excinfos  rrzMTraceTestCase.test_tracing_exception_raised_in_with.<locals>.NullCtx.__exit__r�rNr�r#rr�NullCtxr�r�rr�c�|��	���5ddzddd��dS#1swxYwYdS#t$rYdSwxYw�Nr1rr�)r�s�rr�zATraceTestCase.test_tracing_exception_raised_in_with.<locals>.funcs����
��W�Y�Y����a�C�C�����������������������$�
�
�
����
���s$�
-� �-�$�-�$�-�
;�;)r3r5r=r�r�r�r?r'r=rcrergrHrArCr)rr�r�s  @r�%test_tracing_exception_raised_in_withz3TraceTestCase.test_tracing_exception_raised_in_withsy���	�	�	�	�	�	�	�	�	�	�	�	�	�	
���T�
�
�
�	�	�	�	�	rc�B���fd��|��gd���dS)Nc�t��	n #xgct%x�nn��Xx�YncYwxYw			�jdkr	dS#wxYwrd)rjrrfs�rr�z=TraceTestCase.test_try_except_star_no_exception.<locals>.func"sx���

���
�
�
�I�
�
�
�
�
�
���������������������=�F�*�*��������s�5�!�5�7rgrr�s @r�!test_try_except_star_no_exceptionz/TraceTestCase.test_try_except_star_no_exception rorc�<�d�}|�|gd���dS)Nc�b�	n&#xgct%x�n
}d}~nd}~��Xx�YncYwxYw	dS#wxYwrri�r�s rr�zCTraceTestCase.test_try_except_star_named_no_exception.<locals>.func?sf��
���
�
�
�I�
�
�
�
�
�
������������������������������s�,�&�	,�.)r3r5r=rWr(rrr�s  r�'test_try_except_star_named_no_exceptionz5TraceTestCase.test_try_except_star_named_no_exception=sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�p�	td���#xgct%x�nn��Xx�YncYwxYwdS#wxYwr�r�r#rrr�zATraceTestCase.test_try_except_star_exception_caught.<locals>.funcSse��
� ��m�m�#��
�
�
�J�
�
�
�
�
�
�����������������������s��.�3�5�r3r5r=rpr?rHr(rrr�s  r�%test_try_except_star_exception_caughtz3TraceTestCase.test_try_except_star_exception_caughtQ�F��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�|�	td���#xgct%x�n
}d}~nd}~��Xx�YncYwxYwdS#wxYwrrrs rr�zGTraceTestCase.test_try_except_star_named_exception_caught.<locals>.funcisn��
� ��m�m�#��
�
�
�J�
�
�
�
�
�
�����������������������������s��4�9�;rrr�s  r�+test_try_except_star_named_exception_caughtz9TraceTestCase.test_try_except_star_named_exception_caughtgr	rc�<�d�}|�|gd���dS)Nc��		td���#xgct%x�nn��Xx�YdScYwxYw#t$rYdSwxYw�Nr@r�r#rrr�zETraceTestCase.test_try_except_star_exception_not_caught.<locals>.funcs���
��$�Q�-�-�'�����	��������������������������
�
�
����
���s��0�3�3�
A�Ar�rr�s  r�)test_try_except_star_exception_not_caughtz7TraceTestCase.test_try_except_star_exception_not_caught}r�rc�<�d�}|�|gd���dS)Nc��		td���#xgct%x�n
}d}~nd}~��Xx�YdScYwxYw#t$rYdSwxYwrr�rs rr�zKTraceTestCase.test_try_except_star_named_exception_not_caught.<locals>.func�s���
��$�Q�-�-�'�����	��������A�A�A����������������������
�
�
����
���s��6�9�9�
A�Ar�rr�s  r�/test_try_except_star_named_exception_not_caughtz=TraceTestCase.test_try_except_star_named_exception_not_caught�r�rc�<�d�}|�|gd���dS)Nc��		tdtd��td��g���#xgct%x�n
}d}~nd}~�t%x�nn�t%x�n���Xx�YncYwxYwne#xgct%x�nI	td���#xgct%x�nn�t%x�n
}d}~nd}~��Xx�YncYwxYwn��Xx�YncYwxYwdS)N�egrBzbad typerlr)�ExceptionGroupr�r��OSErrorrs rr�z7TraceTestCase.test_try_except_star_nested.<locals>.func�s���
�	�(��#�A���	�*�(=�(=�>�@�@�@�����	��������A�A�A����������������"�������������������������
�
�
�J�
�
�
�
�
�
��#�B�-�-�'���������������!��������B�B�B������������������������������������1s9�,/�4A0�#A$	�$A0�+A4�4C�B�-C�C
	�	C)r3r5r=r?rHrAr?r'rWrJr(rhrirrr�rk)rlro)�r6)�r6)�r6)�r6)rr8rr�s  r�test_try_except_star_nestedz)TraceTestCase.test_try_except_star_nested�sF��	�	�	�*	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc��	d�dS)Nc��dSrr#r:s r�<lambda>zATraceTestCase.test_notrace_lambda.<locals>.func.<locals>.<lambda>�s��a�rr#r#rrr�z/TraceTestCase.test_notrace_lambda.<locals>.func�s��
��K�K�
�ArrOrr�s  r�test_notrace_lambdaz!TraceTestCase.test_notrace_lambda�sF��	�	�	�
	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc� �Gd�d��}dS)Nc��eZdZdZd�ZdS)�PTraceTestCase.test_class_creation_with_docstrings.<locals>.func.<locals>.Class_1z the docstring. 2c��d|_dS)z Another docstring. 4rBN)rUrs rrzYTraceTestCase.test_class_creation_with_docstrings.<locals>.func.<locals>.Class_1.__init__�s
���D�F�F�FrN)rr r!r"rr#rr�Class_1r&�s)������'�'�����rr(r#)r(s rr�z?TraceTestCase.test_class_creation_with_docstrings.<locals>.func�s4��
�
�
�
�
�
�
�
�
�
rr�rr�s  r�#test_class_creation_with_docstringsz1TraceTestCase.test_class_creation_with_docstrings�sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�@���tjd��}d���fd�}gd�}g}|�|��|��tjd��|jj��fd�|D��}|�||��|�||��dS)N�	_testcapic3�K�dV�dSr0r#r#rr�genzFTraceTestCase.test_no_line_event_after_creating_generator.<locals>.gens�����G�G�G�G�Grc�"�����D]}�dSrr#)�_r-s �rr�zGTraceTestCase.test_no_line_event_after_creating_generator.<locals>.funcs'�������
�
���
�
r)r3r=r5rcrergrHr5)rfr4rgr7c�<��g|]\}}}|�z
t|f��Sr#)�EVENT_NAMES)r��whatr6r��
start_lines    �rr�zMTraceTestCase.test_no_line_event_after_creating_generator.<locals>.<listcomp>s=���
�
�
�!��t�S��*�_�k�$�/�0�
�
�
r)	r�
import_module�settrace_to_recordrrrsr�r��assertEqualr�)rr+r��EXPECTED_EVENTSr�r-r3s     @@r�+test_no_line_event_after_creating_generatorz9TraceTestCase.test_no_line_event_after_creating_generator�s�����
"�/��<�<�	�	�	�	�	�	�	�	�	�
�
�
�� ���$�$�V�,�,�,�d�d�f�f�f�c�l�4�6H�6H�6H��]�1�
�
�
�
�
�%+�
�
�
��	
�����1�1�1����T�?�3�3�3�3�3rc�|�i}tdddz�d�|��|d}gd�}|�||��dS)Nz�def f():              # line 0
            x = 0                     # line 1
            y = 1                     # line 2
            r�izn                        # lines 3 through (1 << 16)
            x += 1                    #
            returnr)r3r5r=)ir6)�r6)r:r8r)rr�rr7s    r�test_very_large_functionz&TraceTestCase.test_very_large_function&so������
��)�)�)�,�
./�	0�	0�	0�
�c�F��
�
�
��	
���Q��0�0�0�0�0rN)Krr r!r�r��staticmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	rr
rrr r$r+r0rPrYr]rarnrtrxr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr"r)r�cpython_onlyr8r;r#rrr�r�JsO������6�6�6�
�������\��D�D�D�3�3�3�0�0�0�8�8�8�&�&�&�������&�&�&�&�&�&�&�&�&�&�&�&�%�%�%�#�#�#����"�"�"�,�,�,�+�+�+�'�'�'�)�)�)�+�+�+�E�E�E�
�
�
����>���������0���*J3�J3�J3�X23�23�23�h	�	�	����"���:���@���4���2"�"�"�H#�#�#�J
�
�
����&���.���.���$���(���.���,���4
�
�
����&���"'�'�'�R���",�,�,�\"�"�"�H���,���@���:���(���,���,���,���,-�-�-�^
�
�
����&
��)4�)4���)4�V1�1�1�1�1rr�)r4ror6r8c�8��eZdZdZ�fd�Zed���Z�xZS)�SkipLineEventsTraceTestCasez8Repeat the trace tests, but with per-line events skippedc�f��d�|D��}t���|||��dS)Nc�*�g|]}|ddk�|��Sr5r#�r�r�s  rr�z>SkipLineEventsTraceTestCase.compare_events.<locals>.<listcomp>Is!��I�I�I�!�!�A�$�&�.�.�A�.�.�.r)�superr�)rr�r�r��skip_line_events�	__class__s     �rr�z*SkipLineEventsTraceTestCase.compare_eventsHs:���I�I��I�I�I��
�����{�F�4D�E�E�E�E�Erc�"�td���S)NF)r�r�r#rrr�z'SkipLineEventsTraceTestCase.make_tracerLs����.�.�.�.r�rr r!r"r�r<r��
__classcell__�rEs@rr?r?Es^�������B�B�F�F�F�F�F��/�/��\�/�/�/�/�/rr?c�8��eZdZdZ�fd�Zed���Z�xZS)�TraceOpcodesTestCasez;Repeat the trace tests, but with per-opcodes events enabledc����d�|D��}t|��dkr2|�t|��t|��d���t���|||��dS)Nc�*�g|]}|ddk�|��S)r1�opcoder#rBs  rr�z7TraceOpcodesTestCase.compare_events.<locals>.<listcomp>Vs&��D�D�D�A�1�Q�4�8�3C�3C�a�3C�3C�3Crr1z)No 'opcode' events received by the tracer)�msg)�len�
assertLessrCr�)rr�r�r��skip_opcode_eventsrEs     �rr�z#TraceOpcodesTestCase.compare_eventsUs}���D�D��D�D�D���v�;�;��?�?��O�O�C� 2�3�3�S��[�[� K�
�
M�
M�
M�
�����{�,>��P�P�P�P�Prc�"�td���S)NT)r�r�r#rrr�z TraceOpcodesTestCase.make_tracer\s���$�/�/�/�/rrGrIs@rrKrKQs^�������E�E�Q�Q�Q�Q�Q��0�0��\�0�0�0�0�0rrKc�P�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
dS)
�RaisingTraceFuncTestCasec�h�|�tjtj����dSr�r�rrrsr�rs rr�zRaisingTraceFuncTestCase.setUpbs$�������c�l�n�n�5�5�5�5�5rc�4�||jkrt�|jS)zXA trace function that raises an exception in response to a
        specific trace event.)�raiseOnEventr�r�r�s    rr�zRaisingTraceFuncTestCase.tracees ���D�%�%�%����:�rc�.�|jdkr	d}d|z}dSdS)zThe function to trace; raises an exception if that's the case
        we're testing, so that the 'exception' trace event fires.rorr1N)rY)rr-r\s   rrzRaisingTraceFuncTestCase.fms)�����+�+��A��!��A�A�A��1rc�T�||_	ttj��dz��D]U}tj|j��	|���|�d���F#t$rY�RwxYwdS#t$r|�d��YdSwxYw)zTTests that an exception raised in response to the given event is
        handled OK.r1zexception not raised!zrecursion counter not resetN)
rYrTrr�getrecursionlimitrsr�rr�r�r})rr�r�s   r�run_test_for_eventz+RaisingTraceFuncTestCase.run_test_for_eventvs���"���
	5��3�0�2�2�Q�6�7�7�
7�
7����T�Z�(�(�(�7��F�F�H�H�H��I�I�5�6�6�6�6��"�����D�����	
7�
7���	5�	5�	5��I�I�3�4�4�4�4�4�4�	5���s5�>B�A2�B�2
A?�<B�>A?�?B�B'�&B'c�0�|�d��dS)Nr4�r]rs r�	test_callz"RaisingTraceFuncTestCase.test_call��������'�'�'�'�'rc�0�|�d��dS�Nr6r_rs r�	test_linez"RaisingTraceFuncTestCase.test_line�rarc�0�|�d��dS)Nr8r_rs r�test_returnz$RaisingTraceFuncTestCase.test_return�s������)�)�)�)�)rc�0�|�d��dS�Nror_rs r�test_exceptionz'RaisingTraceFuncTestCase.test_exception�s������,�,�,�,�,rc�����d����fd��tj���	���|�d��dS#t$rddl}|j��YdSwxYw)Nc�H�td��D]}t|���dS)NrB)rT�printr`s rrz4RaisingTraceFuncTestCase.test_trash_stack.<locals>.f�s.���1�X�X�
�
���a�����
�
rc�b��|dkr'|j�jjdzkrtd����S)Nr6r>z
i am crashing)r�r�r�r})r��why�extrar�gs   ��rrpz4RaisingTraceFuncTestCase.test_trash_stack.<locals>.g�s6����v�
�
���!�*�";�a�"?�?�?�"�?�3�3�3��Hrzexception not propagatedr)rrrsr�r}r��collect)rr�rrps  @@r�test_trash_stackz)RaisingTraceFuncTestCase.test_trash_stack�s�����	�	�	�	�	�	�	�	�	�	��Q����	2�
�A�C�C�C�
�I�I�0�1�1�1�1�1���	�	�	��I�I�I��B�J�L�L�L�L�L�L�	���s�
A�A#�"A#c����d�}��fd��tj��}	tj���	|��n#t$rYnwxYwtj|��dS#tj|��wxYw)Nc��d}|jdS)Nr)�no_such_attrr:s rrz<RaisingTraceFuncTestCase.test_exception_arguments.<locals>.f�s���A�
�N�N�N�Nrc�V��|dkr!|\}}}��|t���Srh)�assertIsInstancerj)r�r�r��typeror�rprs      ��rrpz<RaisingTraceFuncTestCase.test_exception_arguments.<locals>.g�s5�����$�$�),�&��i���%�%�i��;�;�;��Hr)rrr�rs�AttributeError)rr�existingrps`  @r�test_exception_argumentsz1RaisingTraceFuncTestCase.test_exception_arguments�s�����	�	�	�	�	�	�	�	�	��<�>�>��	#��L��O�O�O�
��������!�
�
�
���
����
�L��"�"�"�"�"��C�L��"�"�"�"���s-�A&�
A�A&�
A
�
A&�A
�
A&�&A<c����td�����fd��d�}|�t��5}tj���|��ddd��n#1swxYwY|�|j���dS)NzBOOM!c�&��|dkr��d|_�S)Nr6T)r�)r�r�r�ror�s   ��rr�zRRaisingTraceFuncTestCase.test_line_event_raises_before_opcode_event.<locals>.trace�s���������$(�E�!��Lrc��dSrr#r#rrrzNRaisingTraceFuncTestCase.test_line_event_raises_before_opcode_event.<locals>.f�r�r)r��assertRaisesrrrs�assertIsro)rr�caughtror�s   @@r�*test_line_event_raises_before_opcode_eventzCRaisingTraceFuncTestCase.test_line_event_raises_before_opcode_event�s������w�'�'�	�	�	�	�	�	�	�
	�	�	�
�
�
�z�
*�
*�	�f��L�����
�A�C�C�C�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	
�
�
�f�&�	�2�2�2�2�2s�A � A$�'A$N)rr r!r�r�rr]r`rdrfrirrr{r�r#rrrUrUas�������6�6�6�������5�5�5�"(�(�(�(�(�(�*�*�*�-�-�-�2�2�2�,#�#�#�,3�3�3�3�3rrUc�$�eZdZdZ		dd�Zd�ZdS)�
JumpTracerz>Defines a trace function that jumps from one place to another.r6Fc��|j|_||_||_||_|rdn|jj|_d|_dS)NF)r��code�jumpFrom�jumpTor�r��	firstLiner�)r�functionr�r�r��	decorateds      rrzJumpTracer.__init__�sA���%��	� ��
������
�!*�H����	�0H�����	�	�	rc��|jrdS|j�%|j|jkr|dkr|jdz
|_||jkr�|j��|j|j|jzkrh|}|�)|j|jkr|j}|�|j|jk�|�9	|j|jz|_n#t$r|j|_YnwxYwd|_|j
S)Nr6r1T)r�r��f_coder�r�r�r�rur�r�r�)rr�r�r�rs     rr�zJumpTracer.trace�s����9�	��F�

�N�"�u�|�t�y�'@�'@�����"�^�a�/�D�N��T�Z���D�N�$>���$�.�4�=�"@�@�@��A��-�A�H��	�$9�$9��H���-�A�H��	�$9�$9��}�1�%)�^�d�k�%A�E�N�N�� �1�1�1�%)�[�E�N�N�N�1���� ��	��z�s�B%�%B>�=B>N)r6F)rr r!r"rr�r#rrr�r��sC������H�H�9?� ���������rr�c��	|�d��dS#t$r/}|�dt|��v��Yd}~dSd}~wwxYw)Nr>�integer)rr�r��rr�s  r�no_jump_to_non_integersr��sm��+��
�
�a��������+�+�+��
�
�i�3�q�6�6�)�*�*�*�*�*�*�*�*�*�����+���s��
A�$A
�
Ac��	tj��j}|j|_t	d���#t
$r}dt
|��vr�Yd}~dSd}~wwxYw)Nz'Trace-function-less jump failed to failr�)rrrtrur��AssertionErrorr�r�)�previous_framer�s  r�no_jump_without_trace_functionr��s}��
H�����/��"0�"9����F�G�G�G�������#�a�&�&� � ��!� � � � � ��������s�$5�
A�A�Ac���eZdZd�Zd�Z		d�d�Z		d�d�Zd�d�Zd�d	�Zed
ddg��d���Z	ed
d
gd���d���Z
eddd
dg��d���Zedd
gd���d���Zeddddg��d���Z
edd
gd���d���Zed
d
dg��d���Zed
d
gd���d���Zeddd
dg��d���Zeddd
dgedf��d ���Zedd!d
d!gedf��d"���Zedd!d
dged#f��d$���Zeddd
ged%f��d&���Zed
dddg��d'���Zeddgd(���d)���Zed
dd
dg��d*���Zed
dd
dg��d+���Zedd
gd,���d-���Zedd
gd,���d.���Zed
ddg��d/���Zedd
gd0���d1���Zed
ddg��d2���Z edd
gd3���d4���Z!eddgd5���d6���Z"eddgd5���d7���Z#eddgd8���d9���Z$edd
gd:���d;���Z%ed
dgd<���d=���Z&ed
dgd<���d>���Z'eddgd?���d@���Z(eddgd?���dA���Z)eddgdB���dC���Z*eddgdB���dD���Z+eddgdE���dF���Z,eddgdE���dG���Z-edHd!gdI���dJ���Z.eddgdK���dL���Z/eddgdK���dM���Z0eddgdN���dO���Z1eddHgdP���dQ���Z2ed
dddHg��dR���Z3ed
dddHg��dS���Z4ed
dd
ged%f��dT���Z5ed
dUd
gedVf��dW���Z6ed
ddgedXf��dY���Z7ed
ddgedXf��dZ���Z8ed
ddgedXf��d[���Z9ed
ddgedXf��d\���Z:ed
dged]f��d^���Z;ed
dged]f��d_���Z<edd
d
d
ged]f��d`���Z=edd
d
d
gedaf��db���Z>ed
dgedcf��dd���Z?ed
dgedcf��de���Z@edd
gdf�edcf��dg���ZAedd
gdf�edcf��dh���ZBed
dddg��di���ZCedd
gdj���dk���ZDed
ddg��dl���ZEedd
gdm���dn���ZFeddgd5���do���ZGed
ddg��dp���ZHeddgdq���dr���ZIedd
gds���dt���ZJed
dgeduf��dv���ZKed
dgeduf��dw���ZLeddgdx�eduf��dy���ZMeddd
geduf��dz���ZNedd
gd{���d|���ZOedd
gd{���d}���ZPeddgd~���d���ZQeddgd~���d����ZReddd
dged%f��d����ZSeddd
dged]f��d����ZTeddd
dged]f��d����ZUd��ZVd��ZWd��ZXd��ZYed
dd
gd�ed�f����d����ZZed
d
d
gd�ed�f����d����Z[ed
d
d
gd#ed�f����d����Z\edd
d
dgd�����d����Z]ed
dd
dg��d����Z^edd
g��d����Z_edHd
gd����d����Z`ed
dd
dg��d����Zaedd
g��d����ZbedHd
gd����d����Zceddgedcf����d����ZdeddHgedcf����d����Zeeddgedcf����d����Zfed
dd
dg��d����Zgeddgd����d����Zhd��Zied
dd
dg��d����ZjdS)��JumpTestCasec��|�tjtj����tjd��dSrrWrs rr�zJumpTestCase.setUp�4�������c�l�n�n�5�5�5���T�����rc��||kr=|�dt|��zdzdzt|��z��dSdS)NzOutputs don't match:
Expected: r�z
Received: )r��repr)r�expected�receiveds   r�compare_jump_outputz JumpTestCase.compare_jump_outputsf���x����I�I�$�&*�8�n�n�5�7;�<�#�$�&*�8�n�n�5�
6�
6�
6�
6�
6� �rNr6Fc�,�t|||||��}tj|j��g}	|�||	��n-|j|�5||	��ddd��n#1swxYwYtjd��|�||	��dSr)r�rrrsr��assertRaisesRegexr��
rr�r�r�r�r�r�r�r�rs
          rr�zJumpTestCase.run_tests����D�(�F�E�9�E�E����V�\�"�"�"����=��D��L�L�L�L�'��'��/�
�
���V����
�
�
�
�
�
�
�
�
�
�
����
�
�
�
���T����� � ��6�2�2�2�2�2s�A�A#�&A#c��t|||||��}tj|j��g}	|�t	j||	����n?|j|�5t	j||	����ddd��n#1swxYwYtjd��t	jd��|�||	��dSr)	r�rrrsr��asynciorHr��set_event_loop_policyr�r�s
          r�run_async_testzJumpTestCase.run_async_test#s���D�(�F�E�9�E�E����V�\�"�"�"����=��K���V���%�%�%�%�'��'��/�
*�
*���D�D��L�L�)�)�)�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*���T�����%�d�+�+�+�� � ��6�2�2�2�2�2s�B�B�
Bc�"�����������fd�}|S)zqDecorator that creates a test that makes a jump
        from one place to another in the following code.
        c�H���t���������fd���}|S)Nc	�@��|�������d���dS�NT)r�r�r�)r��rr�r�r�r�r�r�s ������r�testz7JumpTestCase.jump_test.<locals>.decorator.<locals>.test6s<����
�
�d�H�f�h�$)��$��H�H�H�H�Hrr�r�r�r�r�r�r�r�s` �����r�	decoratorz)JumpTestCase.jump_test.<locals>.decorator5�W����
�4�[�[�
H�
H�
H�
H�
H�
H�
H�
H�
H��[�
H��Krr#�r�r�r�r�r�r�s````` r�	jump_testzJumpTestCase.jump_test1�<�������	�	�	�	�	�	�	�	�	��rc�"�����������fd�}|S)z~Decorator that creates a test that makes a jump
        from one place to another in the following asynchronous code.
        c�H���t���������fd���}|S)Nc	�@��|�������d���dSr�)r�r�s ������rr�z=JumpTestCase.async_jump_test.<locals>.decorator.<locals>.testBs>����#�#�D�(�F�H�$)��$�$�H�H�H�H�Hrrr�s` �����rr�z/JumpTestCase.async_jump_test.<locals>.decoratorAr�rr#r�s````` r�async_jump_testzJumpTestCase.async_jump_test=r�rr1r@c��|�d��|�d��|�d��dS�Nr1r>r@�r�rs r�test_jump_simple_forwardsz&JumpTestCase.test_jump_simple_forwardsK�>���
�
�a�����
�
�a�����
�
�a�����rr>)r1r1r>c�Z�|�d��|�d��dSrRr�r�s r�test_jump_simple_backwardsz'JumpTestCase.test_jump_simple_backwardsQ�,���
�
�a�����
�
�a�����rrBc��dD]1}|�d��dD]}|�d����2|�d��dS)Nr�r>�r@rIrBr��rr�rws   r�test_jump_out_of_block_forwardsz,JumpTestCase.test_jump_out_of_block_forwardsVsd���	!�	!�A��M�M�!�����
!�
!���
�
�a� � � � �
!��
�
�a�����rrX)r1r@rBr1r@rBrXrKc���|�d��dD]F}|�d��dD]}|�d���|�d���G|�d��dS)Nr1r�r@)r>rBrXrKr�r�s   r� test_jump_out_of_block_backwardsz-JumpTestCase.test_jump_out_of_block_backwards^s����
�
�a�����	�	�A��M�M�!�����
!�
!���
�
�a� � � � ��M�M�!������
�
�a�����rrIc���K�dD][}tddg��23d{V��}|�d��|�d���26|�d���\dS)Nr�r1r>r@rIrB�r.r�rr�s  r�)test_jump_out_of_async_for_block_forwardsz6JumpTestCase.test_jump_out_of_async_for_block_forwardshs������	�	�A�$�a��V�,�,�
!�
!�
!�
!�
!�
!�
!�a��
�
�a� � � ��
�
�a� � � � �-�
�M�M�!�����		�	s�A
)r>rIr>rIrBrXc���K�dD]o}|�d��tdg��23d{V��}|�d��|�d���26|�d���pdS)Nr�r>r1rIrBrX�rr.r�s  r�*test_jump_out_of_async_for_block_backwardsz7JumpTestCase.test_jump_out_of_async_for_block_backwardsps������	�	�A��M�M�!����$�a�S�>�>�
!�
!�
!�
!�
!�
!�
!�a��
�
�a� � � ��
�
�a� � � � �*�
�M�M�!�����	�	s�Ac�Z�|�d��|�d��dS)Nr1r@r�r�s r�test_jump_to_codeless_linez'JumpTestCase.test_jump_to_codeless_lineys,���
�
�a�����
�
�a�����r)r1r>r@c��|�d��|�d��|�d��dSr�r�r�s r�test_jump_to_same_linez#JumpTestCase.test_jump_to_same_liner�rr*c��	|�d��|�d��	|�d��|�d��n#|�d��wxYw|�d��dS#|�d��	|�d��|�d��n#|�d��wxYw|�d��wxYw)Nr>rIrXr)r*r�r�s r�test_jump_in_nested_finallyz(JumpTestCase.test_jump_in_nested_finally�s���	��M�M�!�����M�M�!����
!��
�
�a� � � ��
�
�a� � � � ���
�
�a� � � � �����M�M�!�������
�M�M�!����
!��
�
�a� � � ��
�
�a� � � � ���
�
�a� � � � �����M�M�!�������s.�B	�A�A/�	C;� C�5C;�C"�"C;rK�c���	|�d��ddz	|�d��|�d��dS#|�d��|�d��wxYw)Nr>r1rrXrKr�r�s r�test_jump_in_nested_finally_2z*JumpTestCase.test_jump_in_nested_finally_2�s|��	��M�M�!����
�a�C�C���M�M�!�����M�M�!�������
�M�M�!�����M�M�!�������s�A	�	,A5rjc��	|�d��ddz	|�d��	|�d��|�d��n#|�d��wxYw|�d��dS#|�d��	|�d��|�d��n#|�d��wxYw|�d��wxYw)Nr>r1rrXr)r�rjr�r�s r�test_jump_in_nested_finally_3z*JumpTestCase.test_jump_in_nested_finally_3�s��
	��M�M�!����
�a�C�C���M�M�!����
"��
�
�a� � � ��
�
�b�!�!�!�!���
�
�b�!�!�!�!�����M�M�"�������
�M�M�!����
"��
�
�a� � � ��
�
�b�!�!�!�!���
�
�b�!�!�!�!�����M�M�"�������s.�B�A�A5�D�&C�;D�C(�(Droc���	|�d��|�d��|�d��dS#|�d��|�d��YdSxYw�Nr>rIrBr�r�s r�5test_no_jump_over_return_try_finally_in_finally_blockzBJumpTestCase.test_no_jump_over_return_try_finally_in_finally_block�s{��
	��M�M�!�����M�M�!�����M�M�!�����F��
�M�M�!�����M�M�!�����F�F�F�

�D�D��A�,A2�afterc�Z�|�d��	|�d���)Nr1Tr@r�r�s r� test_no_jump_infinite_while_loopz-JumpTestCase.test_no_jump_infinite_while_loop�s0���
�
�a����	��M�M�!����	rc��d}|�d��|dkr"|�d��|dz
}|dk� dSdS)Nr1r>rIr�r�s  r�#test_jump_forwards_into_while_blockz0JumpTestCase.test_jump_forwards_into_while_block�sP��
���
�
�a�����1�f�f��M�M�!����
��F�A��1�f�f�f�f�f�fr)r@r@r@rBc��d}|dkr |�d��|dz
}|dk� |�d��dS)Nr1r>r@rBr�r�s  r�$test_jump_backwards_into_while_blockz1JumpTestCase.test_jump_backwards_into_while_block�sP��
���1�f�f��M�M�!����
��F�A��1�f�f�	�
�
�a�����rc��t|d��5|�d��ddd��n#1swxYwY|�d��dSr��r
rr�s r�$test_jump_forwards_out_of_with_blockz1JumpTestCase.test_jump_forwards_out_of_with_block����
�&�!�
$�
$�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��
�
�a�������3�7�7c���K�t|d��4�d{V��|�d��ddd���d{V��n#1�d{V��swxYwY|�d��dSr��r%rr�s r�*test_jump_forwards_out_of_async_with_blockz7JumpTestCase.test_jump_forwards_out_of_async_with_block�������$�V�Q�/�/�	�	�	�	�	�	�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��
�
�a�������A�
A�A)r1r>r1r>r@rfc��|�d��t|d��5|�d��ddd��dS#1swxYwYdSr��rr
r�s r�%test_jump_backwards_out_of_with_blockz2JumpTestCase.test_jump_backwards_out_of_with_block�����
�
�a����
�&�!�
$�
$�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	��A	�	A
�A
c���K�|�d��t|d��4�d{V��|�d��ddd���d{V��dS#1�d{V��swxYwYdSr��rr%r�s r�+test_jump_backwards_out_of_async_with_blockz8JumpTestCase.test_jump_backwards_out_of_async_with_block�������
�
�a����$�V�Q�/�/�	�	�	�	�	�	�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	��A�
A!�$A!c��	|�d��|�d��n#|�d��wxYw|�d��dSr�r�r�s r�+test_jump_forwards_out_of_try_finally_blockz8JumpTestCase.test_jump_forwards_out_of_try_finally_block��^��	��M�M�!�����M�M�!������F�M�M�!���������
�
�a������	�-�A)r1r1r@rBc��|�d��	|�d��|�d��dS#|�d��wxYw�Nr1r@rBr�r�s r�,test_jump_backwards_out_of_try_finally_blockz9JumpTestCase.test_jump_backwards_out_of_try_finally_block��[���
�
�a����	��M�M�!�����M�M�!�������F�M�M�!���������A�Ac��	|�d��n#|�d���xYw|�d��dS�Nr>rIrXr�r�s r�*test_jump_forwards_out_of_try_except_blockz7JumpTestCase.test_jump_forwards_out_of_try_except_block��R��	��M�M�!������	��M�M�!���������
�
�a��������0)r1r1r@c��|�d��	|�d��dS#|�d���xYwr�r�r�s r�+test_jump_backwards_out_of_try_except_blockz8JumpTestCase.test_jump_backwards_out_of_try_except_block�O���
�
�a����	��M�M�!�������	��M�M�!��������	�.�A)rIrKr)c���	ddznZ#t$r-|�d��|�d��Yn$t$r|�d��YnwxYw|�d��dS�Nr1rrIrBrKr)�r�r�FloatingPointErrorr�s r�test_jump_between_except_blocksz,JumpTestCase.test_jump_between_except_blockss���	�
�a�C�C�C�� �	�	�	��M�M�!�����M�M�!������!�	�	�	��M�M�!������	�����
�
�a�����s��4A�A�Ac��	ddzn:#t$r-|�d��|�d��YnwxYw|�d��n#|�d��wxYw|�d��dSr	)r�rr�s r� test_jump_from_except_to_finallyz-JumpTestCase.test_jump_from_except_to_finallys���	�
�a�C�C�C�� �	�	�	��M�M�!�����M�M�!������	����
�M�M�!������F�M�M�!���������
�
�a�����s!��A�4?�A�?�A�A/)rIrXrKc���	ddznF#|�d��|�d��|�d��YnxYw|�d��dS)Nr1rrIrBrXrKr�r�s r�test_jump_within_except_blockz*JumpTestCase.test_jump_within_except_block"so��	�
�a�C�C�C��	��M�M�!�����M�M�!�����M�M�!����������
�
�a�����s
��AA)r1rBr1rBc��|�d��	ddzn,#t$r}|�d��Yd}~nd}~wwxYwd}dS)Nr1rrBrC�rr�)rr�r-s   r�test_jump_over_try_exceptz&JumpTestCase.test_jump_over_try_except,sm���
�
�a����	�
��E�E�E�� �	�	�	��M�M�!�������������	�������s��
A�A�A)r1rIrBr�c�&�|�d��t|d��5|�d��ddd��n#1swxYwYt|d��5|�d��ddd��dS#1swxYwYdS�Nr1r>r@rIrBr�r�s r�test_jump_across_withz"JumpTestCase.test_jump_across_with5����
�
�a����
�&�!�
$�
$�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�&�!�
$�
$�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	�#�A�A�A�#B�B
�
B
c��rK�|�d��t|d��4�d{V��|�d��ddd���d{V��n#1�d{V��swxYwYt|d��4�d{V��|�d��ddd���d{V��dS#1�d{V��swxYwYdSrr�r�s r�test_jump_across_async_withz(JumpTestCase.test_jump_across_async_with=�������
�
�a����$�V�Q�/�/�	�	�	�	�	�	�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�$�V�Q�/�/�	�	�	�	�	�	�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	�#�A�
A �#A �=B&�&
B0�3B0)r1r@rBrXc��|�d��dD]T}t|d��5|�d��ddd��n#1swxYwY|�d���U|�d��dS�Nr1r�r@rIrBrXr�r�s  r�,test_jump_out_of_with_block_within_for_blockz9JumpTestCase.test_jump_out_of_with_block_within_for_blockEs����
�
�a�����	�	�A��f�a�(�(�
!�
!��
�
�a� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!��M�M�!������
�
�a�����s�A�A	�A	c��0K�|�d��dD]f}t|d��4�d{V��|�d��ddd���d{V��n#1�d{V��swxYwY|�d���g|�d��dSrr�r�s  r�2test_jump_out_of_async_with_block_within_for_blockz?JumpTestCase.test_jump_out_of_async_with_block_within_for_blockNs%�����
�
�a�����	�	�A�(���3�3�
!�
!�
!�
!�
!�
!�
!�
!��
�
�a� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!��M�M�!������
�
�a�����s�A�
A$	�'A$	)r1r>r@rBrfrXc�N�|�d��t|d��5t|d��5|�d��ddd��n#1swxYwY|�d��ddd��n#1swxYwY|�d��dS�Nr1r>r@rIrBrXr�r�s r�-test_jump_out_of_with_block_within_with_blockz:JumpTestCase.test_jump_out_of_with_block_within_with_blockWs���
�
�a����
�&�!�
$�
$�	�	��f�a�(�(�
!�
!��
�
�a� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!��M�M�!����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�
�
�a�����s4�B�A�
B�A	�B� A	�!B�B	�B	c��vK�|�d��t|d��5t|d��4�d{V��|�d��ddd���d{V��n#1�d{V��swxYwY|�d��ddd��n#1swxYwY|�d��dSr#)rr
r%r�s r�3test_jump_out_of_async_with_block_within_with_blockz@JumpTestCase.test_jump_out_of_async_with_block_within_with_block`sz�����
�
�a����
�&�!�
$�
$�	�	�(���3�3�
!�
!�
!�
!�
!�
!�
!�
!��
�
�a� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!��M�M�!����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�
�
�a�����s4�B�A'�B�'
A1	�1B�4A1	�5B�B� B)r>rIrXrKc��	|�d��t|d��5|�d��ddd��n#1swxYwY|�d��nW#t|d��5|�d��ddd��n#1swxYwY|�d��wxYw|�d��dS�Nr>rIrBrXrKr�r�s r�0test_jump_out_of_with_block_within_finally_blockz=JumpTestCase.test_jump_out_of_with_block_within_finally_blockisO��	��M�M�!�����f�a�(�(�
!�
!��
�
�a� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!��M�M�!�������f�a�(�(�
!�
!��
�
�a� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!��M�M�!���������
�
�a�����s@�A*�A	�	A
�A
�*B>�;B�B>�B!�!B>�$B!�%B>c��K�	|�d��t|d��4�d{V��|�d��ddd���d{V��n#1�d{V��swxYwY|�d��ni#t|d��4�d{V��|�d��ddd���d{V��n#1�d{V��swxYwY|�d��wxYw|�d��dSr(r�r�s r�6test_jump_out_of_async_with_block_within_finally_blockzCJumpTestCase.test_jump_out_of_async_with_block_within_finally_blockss����	��M�M�!����(���3�3�
!�
!�
!�
!�
!�
!�
!�
!��
�
�a� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!��M�M�!������)���3�3�
!�
!�
!�
!�
!�
!�
!�
!��
�
�a� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!��M�M�!���������
�
�a�����s@�A>�A�
A!�$A!�>C$�B=�+C$�=
C�C$�
C�C$r))r1r@rBrjrsc��|�d��dD]�}|�d��dD]b}|�d��	dD]}|�d���	|�d���I#|�d��wxYw|�d����|�d	��dS)
Nr1r�r@r�rBr)r�rjrsr�)rr�rw�ks    r�&test_jump_out_of_complex_nested_blocksz3JumpTestCase.test_jump_out_of_complex_nested_blocks}s����
�
�a�����		�		�A��M�M�!�����
&�
&���
�
�a� � � �&�#�)�)���
�
�a�(�(�(�(�)��M�M�"�%�%�%�%��F�M�M�"�%�%�%�%�����M�M�"������
�
�b�����s�	A:�:B)r1r>rBc���|�d��t|d��5}|�d��ddd��n#1swxYwY|�d��dS�Nr1r>rIrBr��rr-s  r� test_jump_out_of_with_assignmentz-JumpTestCase.test_jump_out_of_with_assignment�s����
�
�a����
�&�!�
$�
$�	���M�M�!����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�
�
�a�����s�A�A�Ac��K�|�d��t|d��4�d{V��	}|�d��ddd���d{V��n#1�d{V��swxYwY|�d��dSr0r�r1s  r�&test_jump_out_of_async_with_assignmentz3JumpTestCase.test_jump_out_of_async_with_assignment�s�����
�
�a����$�V�Q�/�/�	�	�	�	�	�	�	�	���M�M�!����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�
�
�a�����s�A�
A!�$A!)r1rXr)r*c�D�|�d��	|�d��|s	|�d��dS|�d��|�d��n#|�d��wxYw|�d��dS)Nr1r@r)rXr*r�r�s r�*test_jump_over_return_in_try_finally_blockz7JumpTestCase.test_jump_over_return_in_try_finally_block�s����
�
�a����	��M�M�!�����
��
�M�M�!������
�M�M�!�����M�M�!������F�M�M�!���������
�
�a�����s�A1�A1�1B)r1r@r)r�rjr�c��|�d��	|�d��	|�d��|s	|�d��n[|�d��|�d��n#|�d��wxYw|�d��	|�d��dS)	Nr1Tr@rBr�r)rjr�r�r�s r�)test_jump_over_break_in_try_finally_blockz6JumpTestCase.test_jump_over_break_in_try_finally_block�s����
�
�a����
	��M�M�!����
"��
�
�a� � � �����
�
�b�!�!�!�!��
�
�a� � � ��
�
�b�!�!�!�!���
�
�b�!�!�!�!�����M�M�"������
�
�b�����s�B�B�Bc���|�d��|sdD]}|�d���n*|�d��|�d��|�d��dS�Nr1r�rIrXrKr)r�r�s  r�$test_jump_over_for_block_before_elsez1JumpTestCase.test_jump_over_for_block_before_else�����
�
�a�����	��
!�
!���
�
�a� � � � �
!�
�M�M�!�����M�M�!�����
�
�a�����rc��K�|�d��|s/tdg��23d{V��}|�d���6n*|�d��|�d��|�d��dS�Nr1r@rIrXrKr)r�r�s  r�*test_jump_over_async_for_block_before_elsez7JumpTestCase.test_jump_over_async_for_block_before_else�������
�
�a�����	�$�a�S�>�>�
!�
!�
!�
!�
!�
!�
!�a��
�
�a� � � � �*�>�
�M�M�!�����M�M�!�����
�
�a�������Ac�Z�|�d��|�d��dSrRr�r�s r�test_no_jump_too_far_forwardsz*JumpTestCase.test_no_jump_too_far_forwards�r�rrf�beforec�Z�|�d��|�d��dSrRr�r�s r�test_no_jump_too_far_backwardsz+JumpTestCase.test_no_jump_too_far_backwards�r�r�exceptc�h�	|�d��dS#|�d���xYw�Nr>rIr�r�s r�test_no_jump_to_except_1z%JumpTestCase.test_no_jump_to_except_1�s=��	��M�M�!�������	��M�M�!�������s��1c�z�	|�d��dS#t$r|�d���wxYwrI�rr�r�s r�test_no_jump_to_except_2z%JumpTestCase.test_no_jump_to_except_2�sO��	��M�M�!��������	�	�	��M�M�!�����	���s��!:c��	|�d��dS#t$r}|�d��|�d}~wwxYwrIrLr�s  r�test_no_jump_to_except_3z%JumpTestCase.test_no_jump_to_except_3�sU��	��M�M�!��������	�	�	��M�M�!�����G�����	���s��
?�:�?c��	|�d��dS#ttf$r}|�d��|�d}~wwxYwrI)rr�r}r�s  r�test_no_jump_to_except_4z%JumpTestCase.test_no_jump_to_except_4�sZ��	��M�M�!��������L�)�	�	�	��M�M�!�����G�����	���s��A�A�A�intoc�d�|�d��dD]}|�d���dS)Nr1r�r@r�r�s  r�$test_no_jump_forwards_into_for_blockz1JumpTestCase.test_no_jump_forwards_into_for_block�sB���
�
�a�����	�	�A��M�M�!�����	�	rc��K�|�d��tddg��23d{V��}|�d���6dSr�r�r�s  r�*test_no_jump_forwards_into_async_for_blockz7JumpTestCase.test_no_jump_forwards_into_async_for_block	sk�����
�
�a���� �!�Q��(�(�	�	�	�	�	�	�	�!��M�M�!�����)��s�Ac�d�dD]}|�d���|�d��dS)Nr�r>r@r�r�s  r�%test_no_jump_backwards_into_for_blockz2JumpTestCase.test_no_jump_backwards_into_for_block	s>���	�	�A��M�M�!������
�
�a�����rz&can't jump into the body of a for loopc��K�tddg��23d{V��}|�d���6|�d��dSr�r�r�s  r�+test_no_jump_backwards_into_async_for_blockz8JumpTestCase.test_no_jump_backwards_into_async_for_block	sl���� �!�Q��(�(�	�	�	�	�	�	�	�!��M�M�!�����)��
�
�a�����s�1�stackc��|�d��t|d��5|�d��ddd��dS#1swxYwYdSr�r�r�s r�%test_no_jump_forwards_into_with_blockz2JumpTestCase.test_no_jump_forwards_into_with_block	r�r�c���K�|�d��t|d��4�d{V��|�d��ddd���d{V��dS#1�d{V��swxYwYdSr�r�r�s r�+test_no_jump_forwards_into_async_with_blockz8JumpTestCase.test_no_jump_forwards_into_async_with_block	r�r�)r1r>r�c��t|d��5|�d��ddd��n#1swxYwY|�d��dSr�r�r�s r�&test_no_jump_backwards_into_with_blockz3JumpTestCase.test_no_jump_backwards_into_with_block 	r�r�c���K�t|d��4�d{V��|�d��ddd���d{V��n#1�d{V��swxYwY|�d��dSr�r�r�s r�,test_no_jump_backwards_into_async_with_blockz9JumpTestCase.test_no_jump_backwards_into_async_with_block&	r�r�c��|�d��	|�d��|�d��dS#|�d��wxYwr�r�r�s r�)test_jump_forwards_into_try_finally_blockz6JumpTestCase.test_jump_forwards_into_try_finally_block,	r�r�)r>rIr>rIrBc��	|�d��|�d��n#|�d��wxYw|�d��dSr�r�r�s r�*test_jump_backwards_into_try_finally_blockz7JumpTestCase.test_jump_backwards_into_try_finally_block4	r�r�c��|�d��	|�d��dS#|�d���xYwr�r�r�s r�(test_jump_forwards_into_try_except_blockz5JumpTestCase.test_jump_forwards_into_try_except_block<	rr)r>r>rXc��	|�d��n#|�d���xYw|�d��dSrr�r�s r�)test_jump_backwards_into_try_except_blockz6JumpTestCase.test_jump_backwards_into_try_except_blockE	rrc��	ddzna#t$r-|�d��|�d��Yn+t$r}|�d��Yd}~nd}~wwxYw|�d��dSr	r
r�s  r�!test_jump_between_except_blocks_2z.JumpTestCase.test_jump_between_except_blocks_2O	s���	�
�a�C�C�C�� �	�	�	��M�M�!�����M�M�!������!�	�	�	��M�M�!�������������	�����
�
�a�����s��4A&�	A&�A!�!A&c��|�d��	|�d��|�d��dS#|�d��wxYwr�r�r�s r�test_jump_into_finally_blockz)JumpTestCase.test_jump_into_finally_blockZ	r�r�)r>rXrKc�:�	|�d��|�d��|�d��|�d��n/#|�d��|�d��wxYw|�d��dS)Nr>r@rBrXrKr�r�s r�+test_jump_into_finally_block_from_try_blockz8JumpTestCase.test_jump_into_finally_block_from_try_blockb	s���	��M�M�!�����M�M�!�����M�M�!�����M�M�!������
�M�M�!�����M�M�!���������
�
�a�����s�*A�,B)r1r@r1r@rBc��|�d��	|�d��|�d��dS#|�d��wxYwr�r�r�s r�test_jump_out_of_finally_blockz+JumpTestCase.test_jump_out_of_finally_blockl	r�r�z9can't jump into an 'except' block as there's no exceptionc��|�d��	|�d��dS#|�d��YdSxYwr�r�r�s r�#test_no_jump_into_bare_except_blockz0JumpTestCase.test_no_jump_into_bare_except_blockt	sU���
�
�a����	��M�M�!�������	��M�M�!���������s	�.�Ac��|�d��	|�d��dS#t$r|�d��YdSwxYwr��rrjr�s r�(test_no_jump_into_qualified_except_blockz5JumpTestCase.test_no_jump_into_qualified_except_block|	sg���
�
�a����	��M�M�!��������	�	�	��M�M�!�������	���s�.�A�A)r>rBrXc���	|�d��|�d��n0#|�d��|�d���xYw|�d��dS�Nr>r@rBrXr)r�r�s r�2test_no_jump_into_bare_except_block_from_try_blockz?JumpTestCase.test_no_jump_into_bare_except_block_from_try_block�	sv��	��M�M�!�����M�M�!������	��M�M�!�����M�M�!���������
�
�a�����s	�*-�-Ac��	|�d��|�d��n9#t$r,|�d��|�d���wxYw|�d��dSrzrr�s r�7test_no_jump_into_qualified_except_block_from_try_blockzDJumpTestCase.test_no_jump_into_qualified_except_block_from_try_block�	s���	��M�M�!�����M�M�!������ �	�	�	��M�M�!�����M�M�!�����	����	�
�
�a�����s	�*-�6A#)r1r@rXr1r@rXrKc���|�d��	|�d��ddzdS#|�d��|�d��YdSxYw�Nr1r@rrXrKr�r�s r�"test_jump_out_of_bare_except_blockz/JumpTestCase.test_jump_out_of_bare_except_block�	sn���
�
�a����	��M�M�!����
�a�C�C�C�C��	��M�M�!�����M�M�!���������s	�3�,A"c���|�d��	|�d��ddzdS#t$r.|�d��|�d��YdSwxYwrrwr�s r�'test_jump_out_of_qualified_except_blockz4JumpTestCase.test_jump_out_of_qualified_except_block�	s����
�
�a����	��M�M�!����
�a�C�C�C�C���	�	�	��M�M�!�����M�M�!�������	���s�3�4A+�*A+)r1r>rBrfc�&�|�d��t|d��5|�d��ddd��n#1swxYwYt|d��5|�d��ddd��dS#1swxYwYdSrr�r�s r�test_jump_between_with_blocksz*JumpTestCase.test_jump_between_with_blocks�	rrc��rK�|�d��t|d��4�d{V��|�d��ddd���d{V��n#1�d{V��swxYwYt|d��4�d{V��|�d��ddd���d{V��dS#1�d{V��swxYwYdSrr�r�s r�#test_jump_between_async_with_blocksz0JumpTestCase.test_jump_between_async_with_blocks�	rrc���	|�d��|�d��|�d��dS#|�d��|�d��YdSxYwr�r�r�s r�-test_no_jump_over_return_out_of_finally_blockz:JumpTestCase.test_no_jump_over_return_out_of_finally_block�	sx��	��M�M�!�����M�M�!�����M�M�!�����F��
�M�M�!�����M�M�!�����F�F�F�F�F�Fr�c���|�d��|sdD]}|�d���n*|�d��|�d��|�d��dSr:r�r�s  r�'test_no_jump_into_for_block_before_elsez4JumpTestCase.test_no_jump_into_for_block_before_else�	r<rc��K�|�d��|s/tdg��23d{V��}|�d���6n*|�d��|�d��|�d��dSr>r�r�s  r�-test_no_jump_into_async_for_block_before_elsez:JumpTestCase.test_no_jump_into_async_for_block_before_else�	r@rAc�B�|�tdddg��dS)Nr>�SpamT)r�r�rs r�test_no_jump_to_non_integersz)JumpTestCase.test_no_jump_to_non_integers�	s#���
�
�-�q�&�4�&�A�A�A�A�Arc�"�t��dSr)r�rs r�#test_no_jump_without_trace_functionz0JumpTestCase.test_no_jump_without_trace_function�	s��	'�(�(�(�(�(rc�r�i}tddz|��|d}|�|dddg��dS)Na�def f(output):        # line 0
            x = 0                     # line 1
            y = 1                     # line 2
            '''                       # line 3
            %s                        # lines 4-1004
            '''                       # line 1005
            x += 1                    # line 1006
            output.append(x)          # line 1007
            return)a�







































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































rr>i�r)rr�)rr�rs   r�test_large_functionz JumpTestCase.test_large_function�	sX������'�'�)*�	+�	+�	+�
�c�F���
�
�a��D�1�#�&�&�&�&�&rc�(��tddd���G�fd�d��}t|dd��}tj|j��dgi}t�|��tjd��|�gd	�|d��dS)
Nzd
# Comments don't count.
output.append(2)  # firstlineno is here.
output.append(3)
output.append(4)
z
<fake module>rc���eZdZ�ZdS)�<JumpTestCase.test_jump_to_firstlineno.<locals>.fake_functionN)rr r!r�)r�s�r�
fake_functionr��	s��������H�H�Hrr�rIr1r)r>r@r>r@rI)�compiler�rrrsr�rr�)rr�r�rr�s    @r�test_jump_to_firstlinenoz%JumpTestCase.test_jump_to_firstlineno�	s������
�f����	�	�	�	�	�	�	�	�	�	��M�1�a�0�0����V�\�"�"�"��r�N�	��T�9������T����� � ����)�H�2E�F�F�F�F�Frr4z5can't jump from the 'call' trace event of a new frame)r�r�c�z����d���fd�}|����d��dS)Nr1c�2����d��dSrr�r�s�r�nestedz3JumpTestCase.test_no_jump_from_call.<locals>.nested
s����M�M�!�����rrBr�)rr�s` r�test_no_jump_from_callz#JumpTestCase.test_no_jump_from_call
sS���	�
�
�a����	�	�	�	�	�������
�
�a�����rr8z'can only jump from a 'line' trace eventc�0�|�d��dSr0r�r�s r�test_no_jump_from_return_eventz+JumpTestCase.test_no_jump_from_return_event
s��	�
�
�a�����rc�:�|�d��ddzdSr�r�r�s r�!test_no_jump_from_exception_eventz.JumpTestCase.test_no_jump_from_exception_event
s#��	�
�
�a����	�A����r)r�c�j���fd�}t|������d��dS)Nc3�>�K���d��dV�dS)Nr>r@r�r�s�rr-z.JumpTestCase.test_jump_from_yield.<locals>.gen
s&������M�M�!�����G�G�G�G�GrrB)r<r)rr-s` r�test_jump_from_yieldz!JumpTestCase.test_jump_from_yield
sG���	�	�	�	�	�	
�S�S�U�U�����
�
�a�����rc��|�d��d�td��D��}|�d��dS)Nr1c��g|]}|��Sr#r#�r�r�s  rr�z@JumpTestCase.test_jump_forward_over_listcomp.<locals>.<listcomp>'
���"�"�"�1�Q�"�"�"rr�r@�rrTr1s  r�test_jump_forward_over_listcompz,JumpTestCase.test_jump_forward_over_listcomp$
sE���
�
�a����"�"��b�	�	�"�"�"���
�
�a�����rc�@�d}d�td��D��}d}dS)Nr1c��g|]}|��Sr#r#r�s  rr�zAJumpTestCase.test_jump_backward_over_listcomp.<locals>.<listcomp>/
r�rr�r@rS�rrUr-r�s    r� test_jump_backward_over_listcompz-JumpTestCase.test_jump_backward_over_listcomp,
s)��
��"�"��b�	�	�"�"�"��
���r)r>rKr>c���d}|�d��|rdSd�td��D��}d}|�d��|�d��dS)NFr>c��g|]}|��Sr#r#r�s  rr�zDJumpTestCase.test_jump_backward_over_listcomp_v2.<locals>.<listcomp>8
s��!�!�!�1�Q�!�!�!rrBrXrKr)r��r�flagr-s   r�#test_jump_backward_over_listcomp_v2z0JumpTestCase.test_jump_backward_over_listcomp_v22
sn�����
�
�a�����	��F�!�!��a���!�!�!�����
�
�a�����
�
�a�����rc��K�|�d��d�ttd����2���d{V��}|�d��dS)Nr1c��"K�g|3d{V��}|��
6Srr#r�s  rr�zFJumpTestCase.test_jump_forward_over_async_listcomp.<locals>.<listcomp>@
�.����3�3�3�3�3�3�3�3��Q�3�3�3�3��r�r@�rr.rTr1s  r�%test_jump_forward_over_async_listcompz2JumpTestCase.test_jump_forward_over_async_listcomp=
sc�����
�
�a����3�3�i��b�	�	�2�2�3�3�3�3�3�3�3�3�3���
�
�a�����rc��jK�d}d�ttd����2���d{V��}d}dS)Nr1c��"K�g|3d{V��}|��
6Srr#r�s  rr�zGJumpTestCase.test_jump_backward_over_async_listcomp.<locals>.<listcomp>F
r�r�r�r@)r.rTr�s    r�&test_jump_backward_over_async_listcompz3JumpTestCase.test_jump_backward_over_async_listcompC
sG����
��3�3�i��b�	�	�2�2�3�3�3�3�3�3�3�3�3��
���rc���K�d}|�d��|rdSd�ttd����2���d{V��}d}|�d��|�d��dS)NFr>c��"K�g|3d{V��}|��
6Srr#r�s  rr�zJJumpTestCase.test_jump_backward_over_async_listcomp_v2.<locals>.<listcomp>O
s.����2�2�2�2�2�2�2�2��Q�2�2�2�2r�rBrXrKr)r�r�s   r�)test_jump_backward_over_async_listcomp_v2z6JumpTestCase.test_jump_backward_over_async_listcomp_v2I
s��������
�
�a�����	��F�2�2�i��a���1�1�2�2�2�2�2�2�2�2�2�����
�
�a�����
�
�a�����r)r�c��d}t|�d����|�d��|dzdz|�d��dS�Nr1r@rBr�r�r�rlr�rrUs  r�(test_jump_with_null_on_stack_load_globalz5JumpTestCase.test_jump_with_null_on_stack_load_globalU
sr��
��
��M�M�!���	
�	
�	
�	�
�
�a�������

�

�
�	�
�
�b�����rc��d}t}||�d����|�d��|dzdz|�d��dS)Nr1rIrXrjrl�r�)rrUrs   r�&test_jump_with_null_on_stack_push_nullz3JumpTestCase.test_jump_with_null_on_stack_push_nullh
sy��
����	���M�M�!���	
�	
�	
�	�
�
�a�������

�

�
�	�
�
�b�����rc��d}t�|d��|�d��|dzdz|�d��dSr�)�listrr�s  r�&test_jump_with_null_on_stack_load_attrz3JumpTestCase.test_jump_with_null_on_stack_load_attr|
sl��
������A�	
�	
�	
�	�
�
�a�������

�

�
�	�
�
�b�����rc��|�d��|�d��pd�^}}}|�d��dS�Nr1r>r�r@r��rr/s  r�(test_jump_extended_args_unpack_ex_simplez5JumpTestCase.test_jump_extended_args_unpack_ex_simple�
sH���
�
�a�����=�=��#�#�-�v���A�q��
�
�a�����r)r1rIrIrBc��|�d��|�d��pd�^}}}|�d��dS)Nr1rIr�rBr�r�s  r�(test_jump_extended_args_unpack_ex_trickyz5JumpTestCase.test_jump_extended_args_unpack_ex_tricky�
sN���
�
�a����
�M�M�!���&��	
�
��1��
�
�a�����rc���dddgd�tdd��D���d�}i}td�|��|��|d	}|�|d
dddg��dS)Nzdef f(output):z    output.append(1)z    for _ in spam:c3�"K�|]
}d|�d�V��dS)z        output.append(�)Nr#r�s  rr�z@JumpTestCase.test_jump_extended_args_for_iter.<locals>.<genexpr>�
s.����
G�
G��+�q�+�+�+�
G�
G�
G�
G�
G�
Grr@i��z    output.append(100_000)r�rr>r1)rTrr�r�)r�sourcerrs    r� test_jump_extended_args_for_iterz-JumpTestCase.test_jump_extended_args_for_iter�
s���
�"� �
�H�
G�U�1�g�5F�5F�
G�
G�
G�	
�

*�
���	��T�Y�Y�v�
�
�	�*�*�*��c�N���
�
�a�!�W�q�'�l�3�3�3�3�3rc��|�d��|�d��od}|�d��dSr�r�r�s  r�test_jump_or_popzJumpTestCase.test_jump_or_pop�
sB���
�
�a�����M�M�!���'����
�
�a�����r)Nr6Frc)krr r!r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr!r$r&r)r+r.r2r4r6r8r;r?rCrFrJrMrOrQrTrVrXrZr]r_rarcrergrirkrmrorqrsrurxr{r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r#rrr�r�s6���������6�6�6�@D�).�3�3�3�3�FJ�).�3�3�3�3�
�
�
�
�
�
�
�
��Y�q�!�a�S��������
�Y�q�!�Y�Y�Y����� ����Y�q�!�a��V���������Y�q�!�-�-�-�.�.���/�.���_�Q��A�q�6�"�"���#�"���_�Q��-�-�-�.�.���/�.���Y�q�!�a�S��������
�Y�q�!�Y�Y�Y����� ����Y�q�!�a��V���	�	���	��Y�q�!�a��V�/��4�5�5���6�5���Y�q�"�q�"�g� 1�2�6�7�7���8�7���Y�q�"�q�!�f�z�;�7�8�8���9�8���Y�q�!�a�S�:�w�/�0�0���1�0���Y�q�!�a��V���������Y�q�!�\�\�\�"�"���#�"���Y�q�!�a��V��������
�_�Q��A�q�6�"�"���#�"��
�Y�q�!�(�(�(�)�)���*�)��
�_�Q��.�.�.�/�/���0�/��
�Y�q�!�a�S���������Y�q�!�\�\�\�"�"���#�"���Y�q�!�a�S���������Y�q�!�Y�Y�Y����� ����Y�q�!�Y�Y�Y����� ����Y�q�!�Y�Y�Y����� ����Y�q�!�Y�Y�Y����� ����Y�q�!�\�\�\�"�"���#�"���Y�q�!�]�]�]�#�#���$�#���_�Q��=�=�=�)�)���*�)���Y�q�!�\�\�\�"�"���#�"���_�Q��<�<�<�(�(���)�(���Y�q�!�(�(�(�)�)���*�)���_�Q��.�.�.�/�/���0�/���Y�q�!�\�\�\�"�"���#�"���_�Q��<�<�<�(�(���)�(���Y�q�"�'�'�'�(�(���)�(���Y�q�!�Y�Y�Y����� ����_�Q��9�9�9�%�%���&�%���Y�q�!�\�\�\�"�"�	�	�#�"�	��Y�q�!�*�*�*�+�+�
�
�,�+�
��Y�q�!�a��V���������_�Q��A�q�6�"�"���#�"���Y�q�!�a�S�:�w�/�0�0���1�0���Y�q�"�q�c�J��1�2�2���3�2��
�Y�q�!�a�S�:�x�0�1�1���2�1���Y�q�!�a�S�:�x�0�1�1���2�1���Y�q�!�a�S�:�x�0�1�1���2�1���Y�q�!�a�S�:�x�0�1�1���2�1���Y�q�!�R�*�f�-�.�.���/�.��
�_�Q��2�
�F�3�4�4�
�
�5�4�
��Y�q�!�a��V�j�&�1�2�2���3�2��
�_�Q��A�q�6�J�0X�#Y�Z�Z���[�Z��
�Y�q�!�R�*�g�.�/�/���0�/��
�_�Q��2�
�G�4�5�5���6�5��
�Y�q�!�Z�Z�Z�*�g�!6�7�7���8�7��
�_�Q��:�:�:�
�G�'<�=�=���>�=��
�Y�q�!�a��V���������Y�q�!�_�_�_�%�%���&�%���Y�q�!�a�S���������Y�q�!�Y�Y�Y����� ����Y�q�!�Y�Y�Y����� ����Y�q�!�a�S���������Y�q�!�Y�Y�Y����� ����Y�q�!�_�_�_�%�%���&�%���Y�q�!�R�*�&a�b�c�c���d�c���Y�q�!�R�*�&a�b�c�c���d�c���Y�q�!�Y�Y�Y��-h� i�j�j���k�j���Y�q�!�a�S�:�'b�c�d�d���e�d���Y�q�!�*�*�*�+�+���,�+���Y�q�!�*�*�*�+�+���,�+���Y�q�!�]�]�]�#�#���$�#���_�Q��=�=�=�)�)���*�)���Y�q�!�a��V�j�'�2�3�3���4�3���Y�q�!�a��V�j�&�1�2�2���3�2���_�Q��A�q�6�J��#7�8�8���9�8��B�B�B�)�)�)�
'�'�'�G�G�G�&�Y�q�!�a�S��z�<8�/9�:�:�:���:�:���Y�q�!�a�S���8�1:�;�;�;���;�;���Y�q�!�a�S��J�8�4:�;�;�;���;�;���Y�q�!�a��V�8�,�,�,���-�,���Y�q�!�a��V���������Y�q�!�R��������
�Y�q�!�Y�Y�Y����� ����_�Q��A�q�6�"�"���#�"��
�_�Q��2��������
�_�Q��9�9�9�%�%���&�%���Y�q�!�R�
�G�4�5�5�5���6�5��$�Y�q�!�R�
�G�4�5�5�5���6�5��&�Y�q�!�R�
�G�4�5�5�5���6�5��"�Y�q�!�a��V��������
�Y�q�!�\�\�\�"�"���#�"��
4�
4�
4��Y�q�!�a��V���������rr�c�&�eZdZd�Zd�Zd�Zd�ZdS)�TestExtendedArgsc��|�tjtj����tjd��dSrrWrs rr�zTestExtendedArgs.setUp�
r�rc����td��D]}|���
dddd����fd��tj���|��tjd���S)N�r�r4r6r8c�(���|xxdz
cc<�Sr0r#)r�r�r��countsr�s   ��rr�z,TestExtendedArgs.count_traces.<locals>.trace�
s����5�M�M�M�Q��M�M�M��Lr)rTrrrs)rr�r/r�r�s   @@r�count_traceszTestExtendedArgs.count_traces�
s������r���	�	�A��D�F�F�F�F��Q�!�4�4��	�	�	�	�	�	�	��U�����������T�����
rc��i}d}t||��|�|d��}|�|dddd���dS)Na"def f():
  (y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   y,
   ) = range(300)rr1i-r�)rr�r6)r�nsr�r�s    r�test_trace_unpack_long_sequencez0TestExtendedArgs.test_trace_unpack_long_sequence�
sV��
��A���T�2�����"�"�2�c�7�+�+������!�S�A�!F�!F�G�G�G�G�Grc�@�d�d�d�td��D������}d�td��D��}t||��|�|d��}|�|dddd	���dS)
Nzeif 1:
            def f():
                return (
                    {}
                )
        z
+
c3�"K�|]
}d|�d�V��dS)�varr�Nr#r�s  rr�z>TestExtendedArgs.test_trace_lots_of_globals.<locals>.<genexpr>�
s*����A�A���a����A�A�A�A�A�Ari�c��i|]}d|��|��	S)r�r#r�s  r�
<dictcomp>z?TestExtendedArgs.test_trace_lots_of_globals.<locals>.<dictcomp>�
s ��
0�
0�
0�q�i�A�i�i��
0�
0�
0rrr1i�r�)�formatr�rTrr�r6)rr�r�r�s    r�test_trace_lots_of_globalsz+TestExtendedArgs.test_trace_lots_of_globals�
s����

�F�7�<�<�A�A�U�4�[�[�A�A�A�A�A�B�B�	
�1�
0�E�$�K�K�
0�
0�
0���T�2�����"�"�2�c�7�+�+������!�T�Q�!G�!G�H�H�H�H�HrN)rr r!r�r�r�r�r#rrr�r��
sX������������ H�H�H�
I�
I�
I�
I�
Irr�c� �eZdZd�Zd�Zd�ZdS)�
TestEdgeCasesc��|�tjtj����tjd��dSrrWrs rr�zTestEdgeCases.setUp�
r�rc����d�}d��G�fd�d��}tj|����tj��5}tj|��|�|jj|j��|�|jj	t��ddd��n#1swxYwY|�tj��|��dS)Nc��dSrr#r�s rr�z*TestEdgeCases.test_reentrancy.<locals>.foo�
����Crc��dSrr#r�s r�barz*TestEdgeCases.test_reentrancy.<locals>.bar�
r�rc� ��eZdZd�Z�fd�ZdS)�(TestEdgeCases.test_reentrancy.<locals>.Ac��dSrr#)rr�s  r�__call__z1TestEdgeCases.test_reentrancy.<locals>.A.__call__�
r�rc�0��tj���dSr)rrrs)rr�s �r�__del__z0TestEdgeCases.test_reentrancy.<locals>.A.__del__�
s�����S�!�!�!�!�!rN)rr r!r�r�)r�s�rr�r��
s=�������
�
�
�
"�
"�
"�
"�
"�
"�
"rr�)rrrsr�catch_unraisable_exceptionr6�
unraisable�objectr�rw�	exc_valuer}r�)rr�r��cmr�s    @r�test_reentrancyzTestEdgeCases.test_reentrancy�
sH���	�	�	�	�	�	�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	��Q�Q�S�S����
�
/�
1�
1�	I�R��L��������R�]�1�1�9�=�=�=��!�!�"�-�"9�<�H�H�H�	I�	I�	I�	I�	I�	I�	I�	I�	I�	I�	I����	I�	I�	I�	I�
	
��������-�-�-�-�-s�AB1�1B5�8B5c��d�}tj|��~tjtj����dS)Nc��dSrr#r�s rr�z+TestEdgeCases.test_same_object.<locals>.foo�
r�rr�)rr�s  r�test_same_objectzTestEdgeCases.test_same_object�
sB��	�	�	�	��S�������S�\�^�^�$�$�$�$�$rN)rr r!r�r�rr#rrr�r��
sA���������.�.�.�.%�%�%�%�%rr��__main__)6r�r�unittest�
unittest.mockrrrr�r��	functoolsrr��test.supportr�requires_working_socketr
r%r.r2r�r;rErGrNrVr]rar4rkrmryr{r~r�r�r�r�r�r�r��TestCaser�r1r?r=rKrUr�r�r�r�r�r�r�mainr#rr�<module>r
sz������������#�#�#�#�#�#�
�
�
�
�����	�	�	�	�����������&�&�&�&�&�&����t�,�,�,�,�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(����
�
�
������
�
�
�'�'�'���
�
�
�'�'�'������'�'�'���
�
�
�
(�(�(������	%�	%�	%���
�
�
�'�'�'�
��
�
�
�
�
�
���������
�
�
�
$�
$�
$�
��/�/�/�$�$�$�,�_������
�
�
�,�,�,���
�
�
�)�)�)���
�
�
�+�+�+���"
�
�
�+�+�+���������	-�	-�	-�)�+�6��;�
<�)�-�8�9�����������0p1�p1�p1�p1�p1�H�%�p1�p1�p1�f'����	/�	/�	/�	/�	/�-�	/�	/�	/�	��0�0�0�0�0�=�0�0���0�g3�g3�g3�g3�g3�x�0�g3�g3�g3�\#�#�#�#�#�#�#�#�L+�+�+�H�H�H�d�d�d�d�d�8�$�d�d�d�N'I�'I�'I�'I�'I�x�(�'I�'I�'I�T#%�#%�#%�#%�#%�H�%�#%�#%�#%�L�z����H�M�O�O�O�O�O��r