Sindbad~EG File Manager

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

�

SԚg�?����ddlmZddlZddlmZddlZddlZddlZddlm	Z	ddl
Z
ddlmZej
d���Gd�d	��ZGd
�d��Zd�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$�Z d%�Z!gd&�e!_d'�Z"gd(�e"_d)�Z#gd*�e#_d+�Z$gd,�e$_d-�Z%d.�Z&gd/�d0d1gd2zzd0d3gze&_Gd4�d5��Z'Gd6�d7ej(��Z)gd8�Z*Gd9�d:e)��Z+ej,Gd;�d<e)����Z-Gd=�d>ej(��Z.Gd?�d@��Z/dA�Z0dB�Z1GdC�dDej(��Z2GdE�dFej(��Z3GdG�dHej(��Z4e5dIkrej6��dSdS)J�)�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   �3/usr/local/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�<��t����fd���}|S)Nc�����K�g��fd�}	�|i|�d|i���d{V��	�r%�������d{V����$SS#�r$�������d{V����$wxYw)Nc�Z��t|��}��|j��|Sr)r.r�aclose)r,�it�cleanupss  �r�wrapped_asynciterz;clean_asynciter.<locals>.wrapper.<locals>.wrapped_asynciter0s)����8�$�$�B��O�O�B�I�&�&�&��Irr.��pop)�args�kwargsr5r4�tests   @�r�wrapperz clean_asynciter.<locals>.wrapper-s���������	�	�	�	�	�	'���t�K�v�K�K�9J�K�K�K�K�K�K�K�K�K�K��
'�$�h�l�l�n�n�&�&�&�&�&�&�&�&�&��
'�
'�
'��(�
'�$�h�l�l�n�n�&�&�&�&�&�&�&�&�&��
'�
'�
'�
'�
's�A�(A/r)r:r;s` r�clean_asynciterr<,s3���
�4�[�[�
'�
'�
'�
'��[�
'��Nrc��dS�N�r#r#rr�basicr@<s���1r)�r�call�r?�line�r?�returnc��d}~	d}dSr>r#�r-s r�arigo_example0rIK���	�A�	�
�	�A�A�Ar)rArC��rD��rD��rD�rPrFc��d}~	d}dSr>r#rHs r�arigo_example1rSYrJrc��d}~	d}dSr>r#rHs r�arigo_example2rUgs��	�A�	�
�
���4r)rArCrKrM��rD��rD�rYrFc��d}~d}dSr>r#rHs r�one_instr_liner\zs��	�A�	�	�A�A�Ar�rArCrKrM�rNrFc�<�d}td��D]	}|rd}�d}�
dS�Nr?rL��range)r-�as  r�no_pop_topsrd�s<��	�A�
�1�X�X�����	��A�A��A�A�	�r)
rArCrKrM��rDrKrMrVrK�rLrFc�$�d}|s	t|�	d}dSr>)�bla)�yr-s  r�
no_pop_blocksrk�s'��	�A�������	�A�A�Ar�rArCrKrV�rWrFc�
�d}dSr>r#rHs r�calledro�s��	�A�A�Arc�"�t��dSr)ror#rrrBrB�s��
�H�H�H�H�Hr)rArC����rB����rD�rtrFrEc��t�r��	Exceptionr#rr�raisesry�s��
�Orc�F�	t��dS#t$rYdSwxYwr)ryrxr#rr�
test_raiser{�s6��
���������
�
�
����
���s��
 � )rArCrKrqrs�rt�	exceptionru�rLr}rMrVrmc�h�tj|��|tj��j_dSr)�sys�settrace�	_getframe�f_back�f_trace��	tracefuncs r�_settrace_and_returnr��s)���L�����%.�C�M�O�O��"�"�"rc�$�t|��dSr)r�r�s r�settrace_and_returnr��s����#�#�#�#�#rrEc�r�tj|��|tj��j_t
�r)r�r�r�r�r��RuntimeErrorr�s r�_settrace_and_raiser��s)���L�����%.�C�M�O�O��"�
�rc�H�	t|��dS#t$rYdSwxYwr)r�r�r�s r�settrace_and_raiser��s=��
��I�&�&�&�&�&���
�
�
����
���s��
!�!)r~rMrVrmc�(�d}d}||kr|dz}dSdS)NrPr?r#)rc�bs  r�ireturn_exampler��s'��	�A�	�A��A�v�v�
�a�C�����r�rArCrKrMrVrmc�h�tdd��}	d}	||}|dz
}�#t$rYdSwxYw)NrrNr?�rb�
IndexError)�items�ir�s   r�tightloop_exampler��sV���!�Q�K�K�E�
�
��	��a��A�!�Q�$�!�	���
�
�
����
���s�#�
1�1)rArCrKrMrVrOrVrOrVrOrVrO)rPr}rerXrZc�\�tdd��}	d}||}�	#t$rYdSwxYw)Nr?rWrr�)r�r�s  r�tighterloop_exampler�sG���!�Q�K�K�E�
�
���1�X�����
�
�
����
���s��
+�+)rArCrKrMrVrVrVrV)rWr}rOre�rfrFc#� K�	dV�	dS#wxYw�NTr#r#rr�generator_functionr�$s%������
�
�
���	��	�	�	�	s��
c�d�tt����}td��D]}|}�dS)N�
)�anyr�rb)r-rjs  r�generator_exampler�*s>���� � �!�!�A��2�Y�Y����
����r)
rArK����rB����rD����rD�r�rF)r�rB�r�r}����rD�r�rFrOrer�rQc�(�eZdZdd�Zd�Zd�Zd�ZdS)�TracerNc�0�||_||_g|_dSr)�trace_line_events�trace_opcode_events�events)rr�r�s   rrzTracer.__init__As��!2���#6�� �����rc�V�|j�|j|_|j�|j|_dSdSr)r��
f_trace_linesr��f_trace_opcodes)r�frames  r�_reconfigure_framezTracer._reconfigure_frameFs8���!�-�"&�"8�E���#�/�$(�$<�E�!�!�!�0�/rc�|�|�|��|j�|j|f��|jSr�r�r�r�f_lineno�trace�rr��event�args    rr�zTracer.traceLs;������&�&�&�����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>Ss"������q�������r�r?r�r�s    r�traceWithGenexpzTracer.traceWithGenexpQsO������&�&�&���C���������E�N�E�2�3�3�3��z�r)NN)rr r!rr�r�r�r#rrr�r�@sU����������
=�=�=����
����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�ZJeGjHdF���ZKdG�ZLdHS)I�
TraceTestCasec��tj��|_tj��|�t
jtj����dSr)�gc�	isenabled�using_gc�disable�
addCleanupr�r��gettracers r�setUpzTraceTestCase.setUp\s<�������
�
�
���������c�l�n�n�5�5�5�5�5rc�>�|jrtj��dSdSr)r�r��enablers r�tearDownzTraceTestCase.tearDownas%���=�	��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_traceres
���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>ks&���<�<�<�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>os��(I�(I�(I�A��Q���(I�(I�(Irc�,�g|]}t|����Sr#r�r�s  rr�z0TraceTestCase.compare_events.<locals>.<listcomp>ps��(@�(@�(@�A��Q���(@�(@�(@r)�fail�join�difflib�ndiff)rr�r��expected_eventss `  r�compare_eventszTraceTestCase.compare_eventsjs����<�<�<�<�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�r�r�r�r��__code__�co_firstlinenor�)r�funcr��tracers    r�run_and_comparezTraceTestCase.run_and_comparersp���!�!�#�#����V�\�"�"�"��������T�������D�M�8�"�M�6�	3�	3�	3�	3�	3rc�<�|�||j��dSr)r�r��rr�s  r�run_testzTraceTestCase.run_testzs �����T�4�;�/�/�/�/�/rc���|���}||j��tjd��|�|jj|j|j��dSr)r�r�r�r�r�r�r�r�)rr�r�s   r�	run_test2zTraceTestCase.run_test2}sg���!�!�#�#����V�\������T�������D�M�8�"�M�4�;�	8�	8�	8�	8�	8rc�X�tjd��tj���J�dSr�r�r�r�rs r�test_set_and_retrieve_nonez(TraceTestCase.test_set_and_retrieve_none�s*����T�����|�~�~�%�%�%�%�%rc��d�}tj|��	tj��|usJ�	tjd��dS#tjd��wxYw)Nc��dSrr#�r8s r�fnz4TraceTestCase.test_set_and_retrieve_func.<locals>.fn�����Drr�)rr�s  r�test_set_and_retrieve_funcz(TraceTestCase.test_set_and_retrieve_func�sn��	�	�	�	��R����	��<�>�>�R�'�'�'�'�'��L��������C�L��������s�A�Ac�:�|�t��dSr)r�r@rs r�
test_01_basiczTraceTestCase.test_01_basic�s���
�
�e�����rc�:�|�t��dSr)r�rIrs r�test_02_arigo0zTraceTestCase.test_02_arigo0�����
�
�n�%�%�%�%�%rc�:�|�t��dSr)r�rSrs r�test_02_arigo1zTraceTestCase.test_02_arigo1�rrc�:�|�t��dSr)r�rUrs r�test_02_arigo2zTraceTestCase.test_02_arigo2�rrc�:�|�t��dSr)r�r\rs r�test_03_one_instrzTraceTestCase.test_03_one_instr�rrc�:�|�t��dSr)r�rkrs r�test_04_no_pop_blocksz#TraceTestCase.test_04_no_pop_blocks�s���
�
�m�$�$�$�$�$rc�:�|�t��dSr)r�rdrs r�test_05_no_pop_topsz!TraceTestCase.test_05_no_pop_tops�s���
�
�k�"�"�"�"�"rc�:�|�t��dSr)r�rBrs r�test_06_callzTraceTestCase.test_06_call�s���
�
�d�����rc�:�|�t��dSr)r�r{rs 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�r�r�r�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#rHs r�onlinersz2TraceTestCase.test_14_onliner_if.<locals>.onliners�s���Q��1r)rArCrMr^�r�)rrs  r�test_14_onliner_ifz TraceTestCase.test_14_onliner_if�sG��	�	�	�	
����
�
�
�	�	�	�	�	rc�r�d�}|�|gd���d�}|�|gd���dS)Nc�*�td��D]}�dS�NrLrarHs r�for_examplez0TraceTestCase.test_15_loops.<locals>.for_example�s$���1�X�X�
�
���
�
r)rArCrKrCrKrCrEc�0�d}|dkr
|dz}|dk�dSdS)NrLrr?r#rHs r�
while_examplez2TraceTestCase.test_15_loops.<locals>.while_example�s,���A��a�%�%��Q����a�%�%�%�%�%�%r)rArKrMrVrMrVrMr^r)rr$r&s   r�
test_15_loopszTraceTestCase.test_15_loops�s���	�	�	�	
����
�
�
�	�	�	�	�	�	�
	
����
�
�
�		�		�		�		�		rc�f�i}td|��|�|dgd���dS)Nadef f():
































































































































































































































































    pass�f)rA)�rD)r*rF��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#)r�r�r�)�linenos rr�z0TraceTestCase.test_17_none_f_trace.<locals>.func�s��&*�C�M�O�O�#��F�F�FrrArCrr�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rw)r�r-rjs   rr�z4TraceTestCase.test_18_except_with_name.<locals>.func�sW��
�$�#�O�� �$�$�$������$������
�
�
����
���s�
�
����
+�+)
rArCrKrM�rNr}rVrO��rD)�	rD)r8rFrr�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�rw)rjr�s  rr�z7TraceTestCase.test_19_except_with_finally.<locals>.funcsE��
�$�#�O��#�A�O�O�O�O���
�
�
������
���s�
���!�!)	rArCrKrMr5rOrerXrZrr�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)�nextrD�
StopIteration�StopAsyncIterationrs r�	__anext__zLTraceTestCase.test_20_async_for_loop.<locals>.AsyncIteratorWrapper.__anext__/s:����-����>�>�)��$�-�-�-�,�,�-���s��*N)rr r!rrGrMr#rr�AsyncIteratorWrapperrA(sA������
%�
%�
%�
�
�
�
-�
-�
-�
-�
-rrNc��<�K��d��23d{V��}|}�
6d}dS)N�abc�*r#)�letterr-rjrNs   �r�
doit_asyncz8TraceTestCase.test_20_async_for_loop.<locals>.doit_async5sO����� 4� 4�U� ;� ;�
�
�
�
�
�
�
�f����!<��A�A�As�c�������}	tj|��|�d��tjd��dS#tjd��wxYwr)r�r��send)r�r-rSs  �r�runz1TraceTestCase.test_20_async_for_loop.<locals>.run:s^����
���A�
#���V�$�$�$����t������T�"�"�"�"�"����T�"�"�"�"���s�)A�A")(rArC)i�rB)���rD)rWrF�i����rB����rD�rZrFr�r�r�r��r?r}rKrCr�r�r�r�r\rKrCr�r�r�r�r\rKrCr�r�r�r��rrrDrsr|rur\rMr^)r�r�rxr�r�r�r�)rrVr�r�rNrSs    @@r�test_20_async_for_loopz$TraceTestCase.test_20_async_for_loop's�����	-�	-�	-�	-�	-�	-�	-�	-�	�	�	�	�	�
	#�	#�	#�	#�	#��!�!�#�#��(�(�(��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ra)�nr�s  r�arangezGTraceTestCase.test_async_for_backwards_jump_has_no_line.<locals>.arangets2�����1�X�X�
�
��������
�
rc��F�K��d��23d{V��}|dkrdS�6dS)NrN�dr#)r�rbs �rr)zBTraceTestCase.test_async_for_backwards_jump_has_no_line.<locals>.fwsU�����!�6�!�9�9�
�
�
�
�
�
�
�a��s�7�7��E�E��%�9�9s� )rArCrqrsr�r�r\rKrC�r�rBrsr�r�r\rKrCrersr�r�r\rKrCrersrur\rE)
r�r�r�r�rUrxr�r�r�r�)rr)r��coror�rbs     @r�)test_async_for_backwards_jump_has_no_linez7TraceTestCase.test_async_for_backwards_jump_has_no_liness����	�	�	�	�	�	�	�	�
�!�!�#�#���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�rArCrKrgrr�s  r�test_21_repeated_passz#TraceTestCase.test_21_repeated_pass�sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�"�	dD]}�dS#YdSxYw)Nr#r?rLr#�r�s rr�z3TraceTestCase.test_loop_in_try_except.<locals>.func�s)��
��!�!�A�A��q��
��q�q���s�	�r]rr�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�����	rArCrKrerX�r�rD��rD��rD�rzrFrr�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rwr#rrr�z6TraceTestCase.test_try_exception_in_else.<locals>.func�sU��

����#�O��	��A����A�
��B�B�B�B�B��
������������s(�������$��$�&)rArCrKrMrXr6)r7r}rvrw��rDryr{rr�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)NrLr?ra)r��jrcs   rr�z-TraceTestCase.test_nested_loops.<locals>.funcsE���1�X�X�
�
���q�����A��A��A�A����6�Mr)rArCrKrMrKrMrKrCrKrMrKrMrKrCrVrmrr�s  r�test_nested_loopszTraceTestCase.test_nested_loopssF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�H�ddg}|r|���}|rn|�d}|S)Nr?r�cr6)�seqras  rr�z)TraceTestCase.test_if_break.<locals>.funcsA���a�&�C��
��G�G�I�I������
�
���Hr)rArCrKrMrVrKrMrVrOr6�r7rFrr�s  r�
test_if_breakzTraceTestCase.test_if_breaksF��	�	�	�	
���T�

�

�

�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc��d\}}}}	td��D]}	d}|dkr	d}nd}d}�#d}wxYwn	#d}YnxYw|dkr|dkr|dksJ�dS)	N)r?r?r?r�rNrPrr�r7r�r?ra)rc�c�dr�s    rr�z6TraceTestCase.test_break_through_finally.<locals>.func5s���$�J�A�q�!�Q�

��q�����A�����q�5�5�!�����������B��������
����������6�6�a�2�g�g�!�q�&�&�&�0�&�&s �5�-�5�-�5�1�5�;)rArCrKrMrVrOrer6rvrMrVrOrerXrv��
rD�r�rFrr�s  r�test_break_through_finallyz(TraceTestCase.test_break_through_finally3sF��
	1�
	1�
	1�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc��d\}}}}}	td��D]}	d}|dkr	d}�d}d}�#d}wxYwn	#d}YnxYw||||fdksJ�dS)	N)r?r?r?r?r�rLrPrr�r7r�)rPr7r�r?ra)rcr�r�r�r�s     rr�z9TraceTestCase.test_continue_through_finally.<locals>.funcYs���*�M�A�q�!�Q��

��q�����A�����q�5�5�$����������B��������
���������q�!�Q�<�=�0�0�0�0�0�0s �5�-�5�-�5�1�5�;)rArCrKrMrVrOrer6rvrMrVrOrerXrvrMr�r�rr�s  r�test_continue_through_finallyz+TraceTestCase.test_continue_through_finallyWsF��
	1�
	1�
	1�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc��		dS#wxYwr#r#r#rrr�z7TraceTestCase.test_return_through_finally.<locals>.func~s��
��������s�rlrr�s  r�test_return_through_finallyz)TraceTestCase.test_return_through_finally|sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�D�	ddzn#t$rYnwxYwdS#YdSxYw)NrLrrf)r�r#rrr�z;TraceTestCase.test_try_except_with_wrong_type.<locals>.func�sH��
��!������
�
�
���
�����q��q�q�q�q�q�q�qs���
����)rArCrKr~rMrer�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	�dSr>r6��TRUEr-s  rr�z3TraceTestCase.test_break_to_continue1.<locals>.func�s;���D���A��
�����������	
�
r)
rArCrKrMrVrOrerXrMr^rr�s  r�test_break_to_continue1z%TraceTestCase.test_break_to_continue1�sF��	�	�	�	
���T�	
�	
�	
�
	�
	�
	�
	�
	rc�<�d�}|�|gd���dS)Nc�L�d}dg}|r|���|rn�|�dSdSr>r6r�s  rr�z3TraceTestCase.test_break_to_continue2.<locals>.func�sO���D���A��
������������
�
�
�
�
r)	rArCrKrMrVrOrerMr^rr�s  r�test_break_to_continue2z%TraceTestCase.test_break_to_continue2�sF��	�	�	�	
���T�
�
�
�		�		�		�		�		rc�<�d�}|�|gd���dS)Nc��d}|r|r	dSdSr>r#)r�s rr�z/TraceTestCase.test_break_to_break.<locals>.func�s)���D��
������
�
r)rArCrKrMrVrOrQrr�s  r�test_break_to_breakz!TraceTestCase.test_break_to_break�sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�:�dx}}|dkr|dkrd}dSd}dSd}dS)Nr?rWrfr7r#)rcr�r-rj�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�
�
�
�
rTFr]r)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�hellorNr�raiserY)�ZeroDivisionError�
ValueError)r-r)s  rr�z.TraceTestCase.test_nested_try_if.<locals>.funcsW���A�
'��!�����$�
'�
'�
'���<�<�$�,�,�&� �<�
'�����A�A�As�
�+�+�	rArCrKrMr5rVrOrXrZrr�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__"rHrc��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>.func'sx�������
�
��
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s���)rArC�r�rBr�r�rKrCrqrsrurEr)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)rx�Xr#rrr�z7TraceTestCase.test_if_false_in_try_except.<locals>.func;s7��
�����
�
�
������
���s��rjrr�s  r�test_if_false_in_try_exceptz)TraceTestCase.test_if_false_in_try_except9sF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc� �Gd�d��}dS)Nc�&�eZdZddkrdZdSdZdS)�DTraceTestCase.test_implicit_return_in_class.<locals>.func.<locals>.ArNr8r?rLN)rr r!rcr#rrr�r�Ks%�������q�5�5��A�A�A��A�A�Arr�r#)r�s rr�z9TraceTestCase.test_implicit_return_in_class.<locals>.funcJs4��
�
�
�
�
�
�
�
�
�
r�rArC)r?rBrCrKrMr^rErr�s  r�test_implicit_return_in_classz+TraceTestCase.test_implicit_return_in_classHsF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�\�		dS#t$r}Yd}~dSd}~wwxYw#t$rYdSwxYwrrw��exs rr�z+TraceTestCase.test_try_in_try.<locals>.func\s_��
���D�� �����D�D�D�D�D�����������
�
�
����
���s�
����
+�+r]rr�s  r�test_try_in_tryzTraceTestCase.test_try_in_try[sF��	�	�	�	
���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>.funcns_��
��#�O��!�����A�A�A�A�A�����������
�
�
����
�����
�
�"��"�
0�0�	rArCrKrMr5rVrerXrZc�f�		t�#t$r}Yd}~dSd}~wwxYw#t$rYdSwxYwr�r�r�r�s rr�z:TraceTestCase.test_try_in_try_with_exception.<locals>.func�s`��
��$�$��!�����A�A�A�A�A�����������
�
�
����
���r�)rArCrKrMr5rVrOrQrr�s  r�test_try_in_try_with_exceptionz,TraceTestCase.test_try_in_try_with_exceptionls���	�	�	�	
���T�
�
�
�		�		�		�	�	�	�	
���T�
�
�
�	�	�	�	�	rc�>�dd�}|�|gd���dS)Nrr?c��|r
|r|rdSdSdSdSrr#)rc�pr�s   rr�z/TraceTestCase.test_if_in_if_in_if.<locals>.func�s5���
���������	���rrj)rr?r?rr�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__�rHrc��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�r?rLr#)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���)
rArCrKr�r�r�rMrKrqrsrurVrm)rArC)rWrB)���rD)r�rFrKrCrXrYr[rEr)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|Sr>�r�rHs r�fooz;TraceTestCase.test_flow_converges_on_same_line.<locals>.foo�sC���
���q�1�u�I�I�I��(�����D������Hs�
�
�c�B��td��D]
}�|���dSr#ra)r�r�s �rr�z<TraceTestCase.test_flow_converges_on_same_line.<locals>.func�s1����1�X�X�
�
����A�����
�
r)rArCrK�rZrB�i����rDrsrurCrKr�r�)r�rDr�)r�r}r�r]rsrurCrEr)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)Nrr?�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__rHrc��dSrr#)r�excinfos  rrzMTraceTestCase.test_tracing_exception_raised_in_with.<locals>.NullCtx.__exit__r�rNr�r#rr�NullCtxrr�rrc�|��	���5ddzddd��dS#1swxYwYdS#t$rYdSwxYw�Nr?rr�)rs�rr�zATraceTestCase.test_tracing_exception_raised_in_with.<locals>.funcs����
��W�Y�Y����a�C�C�����������������������$�
�
�
����
���s$�
-� �-�$�-�$�-�
;�;)rArCrKr�r�r�rMr5rKrqrsrurVrOrQr)rr�rs  @r�%test_tracing_exception_raised_in_withz3TraceTestCase.test_tracing_exception_raised_in_withsy���	�	�	�	�	�	�	�	�	�	�	�	�	�	
���T�
�
�
�	�	�	�	�	rc�B���fd��|��gd���dS)Nc�v��	n!#xgct%x�n�nn�Xx�YncYwxYw			�jdkr	dS#wxYwrr)rxrrts�rr�z=TraceTestCase.test_try_except_star_no_exception.<locals>.func0sx���

���
�
�
�I�
�
�
�
������
������������������=�F�*�*��������s�6�"�6�8rurr�s @r�!test_try_except_star_no_exceptionz/TraceTestCase.test_try_except_star_no_exception.r}rc�<�d�}|�|gd���dS)Nc�d�	n'#xgct%x�}d}~nd}~�nn�Xx�YncYwxYw	dS#wxYwrrw�r�s rr�zCTraceTestCase.test_try_except_star_named_no_exception.<locals>.funcMsf��
���
�
�
�I�
�
�
�
������������
���������������������s�-�'�	-�/)rArCrKrer6r�rr�s  r�'test_try_except_star_named_no_exceptionz5TraceTestCase.test_try_except_star_named_no_exceptionKsF��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�r�	td���#xgct%x�n�nn�Xx�YncYwxYwdS#wxYwr#�r�r#rrr�zATraceTestCase.test_try_except_star_exception_caught.<locals>.funcasc��
� ��m�m�#��
�
�
�J�
�
�
�
������
��������������
������s��/�4�6�rArCrKr~rMrVr6r�rr�s  r�%test_try_except_star_exception_caughtz3TraceTestCase.test_try_except_star_exception_caught_�F��	�	�	�	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc�~�	td���#xgct%x�}d}~nd}~�nn�Xx�YncYwxYwdS#wxYwr#rrs rr�zGTraceTestCase.test_try_except_star_named_exception_caught.<locals>.funcwsl��
� ��m�m�#��
�
�
�J�
�
�
�
������������
��������������
������s��5�:�<rrr�s  r�+test_try_except_star_named_exception_caughtz9TraceTestCase.test_try_except_star_named_exception_caughturrc�<�d�}|�|gd���dS)Nc��		td���#xgct%x�n�nn�Xx�YdScYwxYw#t$rYdSwxYw�NrNr�r#rrr�zETraceTestCase.test_try_except_star_exception_not_caught.<locals>.func�s��
��$�Q�-�-�'�����	���������A������������������
�
�
����
���s��1�4�4�
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�}d}~nd}~�nn�Xx�YdScYwxYw#t$rYdSwxYwrr�rs rr�zKTraceTestCase.test_try_except_star_named_exception_not_caught.<locals>.func�s���
��$�Q�-�-�'�����	������A�A�A�������A������������������
�
�
����
���s��7�:�:�
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�}d}~nd}~�nnt%x�n�nnt%x���n�Xx�YncYwxYwnh#xgct%x�M	td���#xgct%x�n�nnt%x�}d}~nd}~�nn�Xx�YncYwxYwn�nn�Xx�YncYwxYwdS)N�egrPzbad typerzr)�ExceptionGroupr�r��OSErrorrs rr�z7TraceTestCase.test_try_except_star_nested.<locals>.func�s���
�	�(��#�A���	�*�(=�(=�>�@�@�@�����	������A�A�A�������A�����������A��"�������������������������
�
�
�J�
�
�
�
��#�B�-�-�'��������������B��!������B�B�B�������B��������������������
���������������1s9�,/�4A2�#A$	�$	A2�-A6�6C�B�/C�C	�C)rArCrKrMrVrOrMr5rerXr6rvrwr�r�ry)rzr})�rD)�rD)�rD)�rD)r(rFrr�s  r�test_try_except_star_nestedz)TraceTestCase.test_try_except_star_nested�sF��	�	�	�*	
���T�
�
�
�	�	�	�	�	rc�<�d�}|�|gd���dS)Nc��	d�dS)Nc��dSr#r#rHs 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�
�Arr]rr�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. 4rPN)rcrs rrzYTraceTestCase.test_class_creation_with_docstrings.<locals>.func.<locals>.Class_1.__init__�s
���D�F�F�FrN)rr r!r"rr#rr�Class_1r2�s)������'�'�����rr4r#)r4s 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�dSr>r#r#rr�genzFTraceTestCase.test_no_line_event_after_creating_generator.<locals>.gens�����G�G�G�G�Grc�"�����D]}�dSrr#)�_r9s �rr�zGTraceTestCase.test_no_line_event_after_creating_generator.<locals>.funcs'�������
�
���
�
r)rArKrCrqrsrurVrC)rtrBrurEc�<��g|]\}}}|�z
t|f��Sr#)�EVENT_NAMES)r��whatrDr��
start_lines    �rr�zMTraceTestCase.test_no_line_event_after_creating_generator.<locals>.<listcomp>,s=���
�
�
�!��t�S��*�_�k�$�/�0�
�
�
r)	r�
import_module�settrace_to_recordr�r�r�r��assertEqualr�)rr7r��EXPECTED_EVENTSr�r9r?s     @@r�+test_no_line_event_after_creating_generatorz9TraceTestCase.test_no_line_event_after_creating_generators�����
"�/��<�<�	�	�	�	�	�	�	�	�	�
�
�
�� ���$�$�V�,�,�,�d�d�f�f�f�c�l�4�6H�6H�6H��]�1�
�
�
�
�
�%+�
�
�
��	
�����1�1�1����T�?�3�3�3�3�3rc���d��fd�}	|tj��_tj|��t	g��|�d��n|#t$ro}d}|j}|r#|jj	j
dkr|dz
}|j}|�#|dkr|�d��n|dkr|�d��Yd}~nd}~wwxYwtjd��dS#tjd��wxYw)	NFc�(���s	d�t�tSr�)rxr�)r�r�r��raiseds   �r�
error_oncez5TraceTestCase.test_settrace_error.<locals>.error_once7s����
 ������Lr�No exception raisedr�test_settrace_errorr?�Traceback is missing frame�"Traceback has frame more than once)r�r�r�r��lenr�rx�
__traceback__�tb_frame�f_code�co_name�tb_next)rrHr��count�tbrGs     @rrJz!TraceTestCase.test_settrace_error4s?�����	�	�	�	�	�	�&0�C�M�O�O�#��L��$�$�$���G�G�G�
�I�I�+�,�,�,�,���
	@�
	@�
	@��E��!�B��
 ��;�%�-�1F�F�F��Q�J�E��Z���
 ���z�z��	�	�6�7�7�7�7������	�	�>�?�?�?����������
	@����
�L��������C�L��������s0�;A�C-�
C�%A%C�
C-�C�C-�-Dc��tjd��}	|�g��tg��|�d��n|#t
$ro}d}|j}|r#|jjj	dkr|dz
}|j
}|�#|dkr|�d��n|dkr|�d��Yd}~nd}~wwxYwtjd��dS#tjd��wxYw)Nr7rIr�test_testcapi_settrace_errorr?rKrL)
rr@�settrace_to_errorrMr�rxrNrOrPrQrRr�r�)rr7r�rSrTs     rrVz*TraceTestCase.test_testcapi_settrace_errorRs(��"�/��<�<�	�	��'�'��+�+�+���G�G�G�
�I�I�+�,�,�,�,���
	@�
	@�
	@��E��!�B��
 ��;�%�-�1O�O�O��Q�J�E��Z���
 ���z�z��	�	�6�7�7�7�7������	�	�>�?�?�?����������
	@����
�L��������C�L��������s/�$A�C"�
C	�A%C�?C"�C	�	C"�"C8c�|�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))rArCrK)irD)�rD)rYrFr+)rr�r)rCs    r�test_very_large_functionz&TraceTestCase.test_very_large_functionkso������
��)�)�)�,�
./�	0�	0�	0�
�c�F��
�
�
��	
���Q��0�0�0�0�0rN)Mrr r!r�r��staticmethodr�r�r�r�r�r�r�r�rrrrr	rr
rrrrrrrr r'r.r2r9r>r^rgrkror|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr)r.r5r�cpython_onlyrDrJrVrZr#rrr�r�Xs}������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�V���<
�������01�1�1�1�1rr�)rBr}rDrFc�8��eZdZdZ�fd�Zed���Z�xZS)�SkipLineEventsTraceTestCasez8Repeat the trace tests, but with per-line events skippedc�f��d�|D��}t���|||��dS)Nc�*�g|]}|ddk�|��SrCr#�r�r�s  rr�z>SkipLineEventsTraceTestCase.compare_events.<locals>.<listcomp>�s!��I�I�I�!�!�A�$�&�.�.�A�.�.�.r)�superr�)rr�r�r��skip_line_events�	__class__s     �rr�z*SkipLineEventsTraceTestCase.compare_events�s:���I�I��I�I�I��
�����{�F�4D�E�E�E�E�Erc�"�td���S)NF)r�r�r#rrr�z'SkipLineEventsTraceTestCase.make_tracer�s����.�.�.�.r�rr r!r"r�r[r��
__classcell__�rds@rr^r^�s^�������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)r?�opcoder#ras  rr�z7TraceOpcodesTestCase.compare_events.<locals>.<listcomp>�s&��D�D�D�A�1�Q�4�8�3C�3C�a�3C�3C�3Crr?z)No 'opcode' events received by the tracer)�msg)rM�
assertLessrbr�)rr�r�r��skip_opcode_eventsrds     �rr�z#TraceOpcodesTestCase.compare_events�s}���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���$�/�/�/�/rrfrhs@rrjrj�s^�������E�E�Q�Q�Q�Q�Q��0�0��\�0�0�0�0�0rrjc�P�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
dS)
�RaisingTraceFuncTestCasec�h�|�tjtj����dSr�r�r�r�r�rs rr�zRaisingTraceFuncTestCase.setUp�s$�������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.trace�s ���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.r}rr?N)rw)rr-rjs   rr)zRaisingTraceFuncTestCase.f�s)�����+�+��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.r?zexception not raised!zrecursion counter not resetN)
rwrbr��getrecursionlimitr�r�r)r�r�r�)rr�r�s   r�run_test_for_eventz+RaisingTraceFuncTestCase.run_test_for_event�s���"���
	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)NrB�r{rs r�	test_callz"RaisingTraceFuncTestCase.test_call��������'�'�'�'�'rc�0�|�d��dS�NrDr}rs r�	test_linez"RaisingTraceFuncTestCase.test_line�rrc�0�|�d��dS)NrFr}rs r�test_returnz$RaisingTraceFuncTestCase.test_return�s������)�)�)�)�)rc�0�|�d��dS�Nr}r}rs r�test_exceptionz'RaisingTraceFuncTestCase.test_exception�s������,�,�,�,�,rc�����d����fd��tj���	���|�d��dS#t$rddl}|j��YdSwxYw)Nc�H�td��D]}t|���dS)NrP)rb�printrns rr)z4RaisingTraceFuncTestCase.test_trash_stack.<locals>.f�s.���1�X�X�
�
���a�����
�
rc�b��|dkr'|j�jjdzkrtd����S)NrDrLz
i am crashing)r�r�r�r�)r��why�extrar)�gs   ��rr�z4RaisingTraceFuncTestCase.test_trash_stack.<locals>.g�s6����v�
�
���!�*�";�a�"?�?�?�"�?�3�3�3��Hrzexception not propagatedr)r�r�r�r�r��collect)rr�r)r�s  @@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_attrrHs rr)z<RaisingTraceFuncTestCase.test_exception_arguments.<locals>.f�s���A�
�N�N�N�Nrc�V��|dkr!|\}}}��|t���Sr�)�assertIsInstancerx)r�r�r��typer}r�r�rs      ��rr�z<RaisingTraceFuncTestCase.test_exception_arguments.<locals>.g�s5�����$�$�),�&��i���%�%�i��;�;�;��Hr)r�r�r��AttributeError)rr)�existingr�s`  @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)NrDT)r�)r�r�r�r}r�s   ��rr�zRRaisingTraceFuncTestCase.test_line_event_raises_before_opcode_event.<locals>.traces���������$(�E�!��Lrc��dSrr#r#rrr)zNRaisingTraceFuncTestCase.test_line_event_raises_before_opcode_event.<locals>.fr�r)r��assertRaisesr�r��assertIsr})rr)�caughtr}r�s   @@r�*test_line_event_raises_before_opcode_eventzCRaisingTraceFuncTestCase.test_line_event_raises_before_opcode_events������w�'�'�	�	�	�	�	�	�	�
	�	�	�
�
�
�z�
*�
*�	�f��L�����
�A�C�C�C�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	
�
�
�f�&�	�2�2�2�2�2s�A � A$�'A$N)rr r!r�r�r)r{r~r�r�r�r�r�r�r#rrrsrs�s�������6�6�6�������5�5�5�"(�(�(�(�(�(�*�*�*�-�-�-�2�2�2�,#�#�#�,3�3�3�3�3rrsc�$�eZdZdZ		dd�Zd�ZdS)�
JumpTracerz>Defines a trace function that jumps from one place to another.rDFc��|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)NrDr?T)r�r�rPr�r�r�r�r�r�r�r�)rr�r�r�r)s     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)rDF)rr r!r"rr�r#rrr�r�sC������H�H�9?� ���������rr�c��	|�d��dS#t$r/}|�dt|��v��Yd}~dSd}~wwxYw)NrL�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�)r�r�r�r��AssertionErrorr�r�)�previous_framer�s  r�no_jump_without_trace_functionr�Bs}��
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
ed
ddg��d���Zeddgd���d���Zed
ddg��d���Z
eddgd���d���Zeddd
dg��d���Zedd
gd���d���Zeddddg��ed�����Zedd
gd���ed�����Zed
d
dg��d���Zed
d
gd ���d!���Zedd"d
d"g��d#���Zedd$d
d$ged%f��d&���Zedd'd
d'ged%f��d(���Zedd'd
dged)f��d*���Zeddd
ged+f��d,���Zed
dddg��d-���Zeddgd.���d/���Zed
dd
dg��d0���Zed
dd
dg��d1���Z edd
gd2���d3���Z!edd
gd2���d4���Z"ed
ddg��d5���Z#edd
gd6���d7���Z$ed
ddg��d8���Z%edd
gd9���d:���Z&edd$gd;���d<���Z'edd$gd;���d=���Z(eddgd>���d?���Z)edd
gd@���dA���Z*ed
dgdB���dC���Z+ed
dgdB���dD���Z,eddgdE���dF���Z-eddgdE���dG���Z.eddgdH���dI���Z/eddgdH���dJ���Z0eddgdK���dL���Z1eddgdK���dM���Z2edNd'gdO���dP���Z3eddgdQ���dR���Z4eddgdQ���dS���Z5eddgdT���dU���Z6eddNgdV���dW���Z7ed
d$d$dNg��dX���Z8ed
d$d$dNg��dY���Z9ed
dd
ged+f��dZ���Z:ed
d[d
ged\f��d]���Z;ed
ddged^f��d_���Z<ed
ddged^f��d`���Z=ed
ddged^f��da���Z>ed
ddged^f��db���Z?ed
dgedcf��dd���Z@ed
dgedcf��de���ZAedd
d
d
gedcf��df���ZBedd
d
d
gedgf��dh���ZCed
dgedif��dj���ZDed
dgedif��dk���ZEedd
gdl�edif��dm���ZFedd
gdl�edif��dn���ZGed
dddg��do���ZHedd
gdp���dq���ZIed
ddg��dr���ZJedd
gds���dt���ZKedd$gd;���du���ZLed
ddg��dv���ZMeddgdw���dx���ZNedd
gdy���dz���ZOed
dged{f��d|���ZPed
dged{f��d}���ZQeddgd~�ed{f��d���ZReddd
ged{f��d����ZSed$d
gd����d����ZTed$d
gd����d����ZUeddgd����d����ZVeddgd����d����ZWedd$d
dged+f��d����ZXed$dd
dgedcf��d����ZYed$dd
dgedcf��d����ZZd��Z[d��Z\d��Z]d��Z^ed
dd
gd�ed�f����d����Z_ed
d
d
gd�ed�f����d����Z`ed
d
d
gd)ed�f����d����Zaedd
d
dgd�����d����Zbed
dd
dg��d����Zcedd
g��d����ZdedNd
gd����d����Zeed
dd
dg��d����Zfedd
g��d����ZgedNd
gd����d����Zhedd$gedif����d����ZieddNgedif����d����Zjedd$gedif����d����Zked
dd
dg��d����Zleddgd����d����Zmenjod���d����Zped
dd
dg��d����ZqdS)��JumpTestCasec��|�tjtj����tjd��dSrrurs rr�zJumpTestCase.setUpQ�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_outputUsf���x����I�I�$�&*�8�n�n�5�7;�<�#�$�&*�8�n�n�5�
6�
6�
6�
6�
6� �rNrDFc�~�|}t|d��r|j}t|d���t|||||��}	tj|	j��g}
|�||
��n-|j|�5||
��ddd��n#1swxYwYtjd��|�||
��dS�N�__wrapped__)�hasattrr�r�r�r�r��assertRaisesRegexr��rr�r�r�r�r�r�r��wrappedr�rs           rr�zJumpTestCase.run_test[s�����g�}�-�-�	*��)�G��g�}�-�-�	*��G�X�v�u�i�H�H����V�\�"�"�"����=��D��L�L�L�L�'��'��/�
�
���V����
�
�
�
�
�
�
�
�
�
�
����
�
�
�
���T����� � ��6�2�2�2�2�2s�0B�B�Bc���|}t|d��r|j}t|d���t|||||��}	tj|	j��g}
|�t
j||
����n?|j|�5t
j||
����ddd��n#1swxYwYtjd��t
j	d��|�
||
��dSr�)r�r�r�r�r�r��asynciorVr��set_event_loop_policyr�r�s           r�run_async_testzJumpTestCase.run_async_testls=�����g�}�-�-�	*��)�G��g�}�-�-�	*��G�X�v�u�i�H�H����V�\�"�"�"����=��K���V���%�%�%�%�'��'��/�
*�
*���D�D��L�L�)�)�)�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*�
*����
*�
*�
*�
*���T�����%�d�+�+�+�� � ��6�2�2�2�2�2s�B,�,B0�3B0c�"�����������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 ������rr:z7JumpTestCase.jump_test.<locals>.decorator.<locals>.test�s<����
�
�d�H�f�h�$)��$��H�H�H�H�Hrr�r�r:r�r�r�r�r�s` �����r�	decoratorz)JumpTestCase.jump_test.<locals>.decorator��W����
�4�[�[�
H�
H�
H�
H�
H�
H�
H�
H�
H��[�
H��Krr#�r�r�r�r�r�r�s````` r�	jump_testzJumpTestCase.jump_test~�<�������	�	�	�	�	�	�	�	�	��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>.test�s>����#�#�D�(�F�H�$)��$�$�H�H�H�H�Hrrr�s` �����rr�z/JumpTestCase.async_jump_test.<locals>.decorator�r�rr#r�s````` r�async_jump_testzJumpTestCase.async_jump_test�r�rr?rNc��|�d��|�d��|�d��dS�Nr?rLrN�r�rs r�test_jump_simple_forwardsz&JumpTestCase.test_jump_simple_forwards��>���
�
�a�����
�
�a�����
�
�a�����rrL)r?r?rLc�Z�|�d��|�d��dSr`r�r�s r�test_jump_simple_backwardsz'JumpTestCase.test_jump_simple_backwards��,���
�
�a�����
�
�a�����rrWrPc�f�d}|�|�d��dS|�d��dS�NrNrPr��rr-s  r�test_jump_is_none_forwardsz'JumpTestCase.test_jump_is_none_forwards�s<�����9��M�M�!�������M�M�!�����rrf)rNrPrfc��d}|�|�d��n|�d��|�d��dS�NrNrPrfr�r�s  r�test_jump_is_none_backwardsz(JumpTestCase.test_jump_is_none_backwards�sK�����9��M�M�!������M�M�!�����
�
�a�����rc�f�d}|�|�d��dS|�d��dSr�r�r�s  r�test_jump_is_not_none_forwardsz+JumpTestCase.test_jump_is_not_none_forwards�s<�����=��M�M�!�������M�M�!�����r)rPrPrfc��d}|�|�d��n|�d��|�d��dSr�r�r�s  r�test_jump_is_not_none_backwardsz,JumpTestCase.test_jump_is_not_none_backwards�sK�����=��M�M�!������M�M�!�����
�
�a�����rc��dD]1}|�d��dD]}|�d����2|�d��dS)Nr�rL�rNrWrPr��rr�r�s   r�test_jump_out_of_block_forwardsz,JumpTestCase.test_jump_out_of_block_forwards�sd���	!�	!�A��M�M�!�����
!�
!���
�
�a� � � � �
!��
�
�a�����r)r?rNrPr?rNrPrfrYc���|�d��dD]F}|�d��dD]}|�d���|�d���G|�d��dS)Nr?r�rN)rLrPrfrYr�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�����rc��K�dD]W}|ddg��23d{V��}|�d��|�d���26|�d���XdS)Nr�r?rLrNrWrPr��rr.r�s   r�)test_jump_out_of_async_for_block_forwardsz6JumpTestCase.test_jump_out_of_async_for_block_forwards�s������	�	�A�$�9�a��V�,�,�
!�
!�
!�
!�
!�
!�
!�a��
�
�a� � � ��
�
�a� � � � �-�
�M�M�!�����		�	s�A)rLrWrLrWrPrfc���K�dD]k}|�d��|dg��23d{V��}|�d��|�d���26|�d���ldS)Nr�rLr?rWrPrfr�r�s   r�*test_jump_out_of_async_for_block_backwardsz7JumpTestCase.test_jump_out_of_async_for_block_backwards�s������	�	�A��M�M�!����$�9�a�S�>�>�
!�
!�
!�
!�
!�
!�
!�a��
�
�a� � � ��
�
�a� � � � �*�
�M�M�!�����	�	s�Ac�Z�|�d��|�d��dS)Nr?rNr�r�s r�test_jump_to_codeless_linez'JumpTestCase.test_jump_to_codeless_line�s,���
�
�a�����
�
�a�����r)r?rLrNc��|�d��|�d��|�d��dSr�r�r�s r�test_jump_to_same_linez#JumpTestCase.test_jump_to_same_line�r�rr8c��	|�d��|�d��	|�d��|�d��n#|�d��wxYw|�d��dS#|�d��	|�d��|�d��n#|�d��wxYw|�d��wxYw)NrLrWrfr7r8r�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;rY�c���	|�d��ddz	|�d��|�d��dS#|�d��|�d��wxYw)NrLr?rrfrYr�r�s r�test_jump_in_nested_finally_2z*JumpTestCase.test_jump_in_nested_finally_2s|��	��M�M�!����
�a�C�C���M�M�!�����M�M�!�������
�M�M�!�����M�M�!�������s�A	�	,A5rxc��	|�d��ddz	|�d��	|�d��|�d��n#|�d��wxYw|�d��dS#|�d��	|�d��|�d��n#|�d��wxYw|�d��wxYw)NrLr?rrfr7r�rxr�r�s r�test_jump_in_nested_finally_3z*JumpTestCase.test_jump_in_nested_finally_3s��
	��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(�(Dr}c���	|�d��|�d��|�d��dS#|�d��|�d��YdSxYw�NrLrWrPr�r�s r�5test_no_jump_over_return_try_finally_in_finally_blockzBJumpTestCase.test_no_jump_over_return_try_finally_in_finally_blocks{��
	��M�M�!�����M�M�!�����M�M�!�����F��
�M�M�!�����M�M�!�����F�F�F�

�D�D��A�,A2�afterc�Z�|�d��	|�d���)Nr?TrNr�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)Nr?rLrWr��rr�s  r�#test_jump_forwards_into_while_blockz0JumpTestCase.test_jump_forwards_into_while_block3sP��
���
�
�a�����1�f�f��M�M�!����
��F�A��1�f�f�f�f�f�fr)rNrNrNrPc��d}|dkr |�d��|dz
}|dk� |�d��dS)Nr?rLrNrPr�rs  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_blockC���
�&�!�
$�
$�	�	��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_blockI������$�V�Q�/�/�	�	�	�	�	�	�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��
�
�a�������A�
A�A)r?rLr?rLrNrtc��|�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_blockO����
�
�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_blockU������
�
�a����$�V�Q�/�/�	�	�	�	�	�	�	�	��M�M�!����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	��A�
A!�$A!c��	|�d��|�d��n#|�d��wxYw|�d��dSrr�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)r?r?rNrPc��|�d��	|�d��|�d��dS#|�d��wxYw�Nr?rNrPr�r�s r�,test_jump_backwards_out_of_try_finally_blockz9JumpTestCase.test_jump_backwards_out_of_try_finally_blockc�[���
�
�a����	��M�M�!�����M�M�!�������F�M�M�!���������A�Ac��	|�d��n#|�d���xYw|�d��dS�NrLrWrfr�r�s r�*test_jump_forwards_out_of_try_except_blockz7JumpTestCase.test_jump_forwards_out_of_try_except_blockk�R��	��M�M�!������	��M�M�!���������
�
�a��������0)r?r?rNc��|�d��	|�d��dS#|�d���xYwr%r�r�s r�+test_jump_backwards_out_of_try_except_blockz8JumpTestCase.test_jump_backwards_out_of_try_except_blockt�O���
�
�a����	��M�M�!�������	��M�M�!��������	�.�A)rWrYr7c���	ddznZ#t$r-|�d��|�d��Yn$t$r|�d��YnwxYw|�d��dS�Nr?rrWrPrYr7�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��dSr3)r�rr�s r� test_jump_from_except_to_finallyz-JumpTestCase.test_jump_from_except_to_finally�s���	�
�a�C�C�C�� �	�	�	��M�M�!�����M�M�!������	����
�M�M�!������F�M�M�!���������
�
�a�����s!��A�4?�A�?�A�A/)rWrfrYc���	ddznF#|�d��|�d��|�d��YnxYw|�d��dS)Nr?rrWrPrfrYr�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)r?rPr?rPc��|�d��	ddzn,#t$r}|�d��Yd}~nd}~wwxYwd}dS)Nr?rrPrQ�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)r?rWrPr�c�&�|�d��t|d��5|�d��ddd��n#1swxYwYt|d��5|�d��ddd��dS#1swxYwYdS�Nr?rLrNrWrPrr�s r�test_jump_across_withz"JumpTestCase.test_jump_across_with�����
�
�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��swxYwYdSr?rr�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)r?rNrPrfc��|�d��dD]T}t|d��5|�d��ddd��n#1swxYwY|�d���U|�d��dS�Nr?r�rNrWrPrfrrs  r�,test_jump_out_of_with_block_within_for_blockz9JumpTestCase.test_jump_out_of_with_block_within_for_block�s����
�
�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��dSrHrrs  r�2test_jump_out_of_async_with_block_within_for_blockz?JumpTestCase.test_jump_out_of_async_with_block_within_for_block�s%�����
�
�a�����	�	�A�(���3�3�
!�
!�
!�
!�
!�
!�
!�
!��
�
�a� � � �
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!�
!����
!�
!�
!�
!��M�M�!������
�
�a�����s�A�
A$	�'A$	)r?rLrNrPrtrfc�N�|�d��t|d��5t|d��5|�d��ddd��n#1swxYwY|�d��ddd��n#1swxYwY|�d��dS�Nr?rLrNrWrPrfrr�s r�-test_jump_out_of_with_block_within_with_blockz:JumpTestCase.test_jump_out_of_with_block_within_with_block�s���
�
�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��dSrM)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)rLrWrfrYc��	|�d��t|d��5|�d��ddd��n#1swxYwY|�d��nW#t|d��5|�d��ddd��n#1swxYwY|�d��wxYw|�d��dS�NrLrWrPrfrYrr�s r�0test_jump_out_of_with_block_within_finally_blockz=JumpTestCase.test_jump_out_of_with_block_within_finally_block�sO��	��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��dSrRrr�s r�6test_jump_out_of_async_with_block_within_finally_blockzCJumpTestCase.test_jump_out_of_async_with_block_within_finally_block�s����	��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$r7)r?rNrPrxr�c��|�d��dD]�}|�d��dD]b}|�d��	dD]}|�d���	|�d���I#|�d��wxYw|�d����|�d	��dS)
Nr?r�rNr�rPr7r�rxr�r�)rr�r��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)r?rLrPc���|�d��t|d��5}|�d��ddd��n#1swxYwY|�d��dS�Nr?rLrWrPrr�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��dSrZrr�s  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!)r?rfr7r8c�D�|�d��	|�d��|s	|�d��dS|�d��|�d��n#|�d��wxYw|�d��dS)Nr?rNr7rfr8r�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)r?rNr7r�rxr�c��|�d��	|�d��	|�d��|s	|�d��n[|�d��|�d��n#|�d��wxYw|�d��	|�d��dS)	Nr?TrNrPr�r7rxr�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�Nr?r�rWrfrYr7r�rs  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�Nr?rNrWrfrYr7�rr.rs  r�*test_jump_over_async_for_block_before_elsez7JumpTestCase.test_jump_over_async_for_block_before_else4	������
�
�a�����	�$�a�S�>�>�
!�
!�
!�
!�
!�
!�
!�a��
�
�a� � � � �*�>�
�M�M�!�����M�M�!�����
�
�a�������Ac�Z�|�d��|�d��dSr`r�r�s r�test_no_jump_too_far_forwardsz*JumpTestCase.test_no_jump_too_far_forwardsA	r�rrt�beforec�Z�|�d��|�d��dSr`r�r�s r�test_no_jump_too_far_backwardsz+JumpTestCase.test_no_jump_too_far_backwardsF	r�r�exceptc�h�	|�d��dS#|�d���xYw�NrLrWr�r�s r�test_no_jump_to_except_1z%JumpTestCase.test_no_jump_to_except_1L	s=��	��M�M�!�������	��M�M�!�������s��1c�z�	|�d��dS#t$r|�d���wxYwrs�rr�r�s r�test_no_jump_to_except_2z%JumpTestCase.test_no_jump_to_except_2T	sO��	��M�M�!��������	�	�	��M�M�!�����	���s��!:c��	|�d��dS#t$r}|�d��|�d}~wwxYwrsrvr�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}~wwxYwrs)rr�r�r�s  r�test_no_jump_to_except_4z%JumpTestCase.test_no_jump_to_except_4d	sZ��	��M�M�!��������L�)�	�	�	��M�M�!�����G�����	���s��A�A�A�intoc�d�|�d��dD]}|�d���dS)Nr?r�rNr�rs  r�$test_no_jump_forwards_into_for_blockz1JumpTestCase.test_no_jump_forwards_into_for_blockl	sB���
�
�a�����	�	�A��M�M�!�����	�	rc��K�|�d��tddg��23d{V��}|�d���6dSr�rhrs  r�*test_no_jump_forwards_into_async_for_blockz7JumpTestCase.test_no_jump_forwards_into_async_for_blockr	sk�����
�
�a���� �!�Q��(�(�	�	�	�	�	�	�	�!��M�M�!�����)��s�Ac�d�dD]}|�d���|�d��dS)Nr�rLrNr�rs  r�%test_no_jump_backwards_into_for_blockz2JumpTestCase.test_no_jump_backwards_into_for_blocky	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.rrs  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�rr�s r�%test_no_jump_forwards_into_with_blockz2JumpTestCase.test_no_jump_forwards_into_with_block�	rrc���K�|�d��t|d��4�d{V��|�d��ddd���d{V��dS#1�d{V��swxYwYdSr�rr�s r�+test_no_jump_forwards_into_async_with_blockz8JumpTestCase.test_no_jump_forwards_into_async_with_block�	rr)r?rLr�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�	rrc���K�t|d��4�d{V��|�d��ddd���d{V��n#1�d{V��swxYwY|�d��dSr�rr�s r�,test_no_jump_backwards_into_async_with_blockz9JumpTestCase.test_no_jump_backwards_into_async_with_block�	rrc��|�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()rLrWrLrWrPc��	|�d��|�d��n#|�d��wxYw|�d��dSrr�r�s r�*test_jump_backwards_into_try_finally_blockz7JumpTestCase.test_jump_backwards_into_try_finally_block�	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�	r0r1)rLrLrfc��	|�d��n#|�d���xYw|�d��dSr*r�r�s r�)test_jump_backwards_into_try_except_blockz6JumpTestCase.test_jump_backwards_into_try_except_block�	r,r-c��	ddzna#t$r-|�d��|�d��Yn+t$r}|�d��Yd}~nd}~wwxYw|�d��dSr3r4r�s  r�!test_jump_between_except_blocks_2z.JumpTestCase.test_jump_between_except_blocks_2�	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_block�	r'r()rLrfrYc�:�	|�d��|�d��|�d��|�d��n/#|�d��|�d��wxYw|�d��dS)NrLrNrPrfrYr�r�s r�+test_jump_into_finally_block_from_try_blockz8JumpTestCase.test_jump_into_finally_block_from_try_block�	s���	��M�M�!�����M�M�!�����M�M�!�����M�M�!������
�M�M�!�����M�M�!���������
�
�a�����s�*A�,B)r?rNr?rNrPc��|�d��	|�d��|�d��dS#|�d��wxYwr%r�r�s r�test_jump_out_of_finally_blockz+JumpTestCase.test_jump_out_of_finally_block�	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_block�	sU���
�
�a����	��M�M�!�������	��M�M�!���������s	�.�Ac��|�d��	|�d��dS#t$r|�d��YdSwxYwr%�rrxr�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)rLrPrfc���	|�d��|�d��n0#|�d��|�d���xYw|�d��dS�NrLrNrPrfr7r�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��dSr�r<r�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#)r?rNrfr?rNrfrYc���|�d��	|�d��ddzdS#|�d��|�d��YdSxYw�Nr?rNrrfrYr�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��YdSwxYwr�r�r�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+)r?rLrPrtc�&�|�d��t|d��5|�d��ddd��n#1swxYwYt|d��5|�d��ddd��dS#1swxYwYdSr?rr�s r�test_jump_between_with_blocksz*JumpTestCase.test_jump_between_with_blocks
rArBc��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��swxYwYdSr?rr�s r�#test_jump_between_async_with_blocksz0JumpTestCase.test_jump_between_async_with_blocks'
rErFc���	|�d��|�d��|�d��dS#|�d��|�d��YdSxYwrr�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�Frc���|�d��|sdD]}|�d���n*|�d��|�d��|�d��dSrcr�rs  r�'test_no_jump_into_for_block_before_elsez4JumpTestCase.test_no_jump_into_for_block_before_else9
rerc��K�|�d��|s/tdg��23d{V��}|�d���6n*|�d��|�d��|�d��dSrgrhrs  r�-test_no_jump_into_async_for_block_before_elsez:JumpTestCase.test_no_jump_into_async_for_block_before_elseD
rjrkc�B�|�tdddg��dS)NrL�SpamT)r�r�rs r�test_no_jump_to_non_integersz)JumpTestCase.test_no_jump_to_non_integersO
s#���
�
�-�q�&�4�&�A�A�A�A�Arc�"�t��dSr)r�rs r�#test_no_jump_without_trace_functionz0JumpTestCase.test_no_jump_without_trace_functionR
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�







































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































r)rLi�r)r,r�)rr�r)s   r�test_large_functionz JumpTestCase.test_large_functionW
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>r,c���eZdZ�ZdS)�<JumpTestCase.test_jump_to_firstlineno.<locals>.fake_functionN)rr r!r�)r�s�r�
fake_functionr�o
s��������H�H�Hrr�rWr?r)rLrNrLrNrW)�compiler�r�r�r�r,r�)rr�r�r-r�s    @r�test_jump_to_firstlinenoz%JumpTestCase.test_jump_to_firstlinenoe
s������
�f����	�	�	�	�	�	�	�	�	�	��M�1�a�0�0����V�\�"�"�"��r�N�	��T�9������T����� � ����)�H�2E�F�F�F�F�FrrBz5can't jump from the 'call' trace event of a new frame)r�r�c�z����d���fd�}|����d��dS)Nr?c�2����d��dSrr�r�s�r�nestedz3JumpTestCase.test_no_jump_from_call.<locals>.nested|
s����M�M�!�����rrPr�)rr�s` r�test_no_jump_from_callz#JumpTestCase.test_no_jump_from_callx
sS���	�
�
�a����	�	�	�	�	�������
�
�a�����rrFz'can only jump from a 'line' trace eventc�0�|�d��dSr>r�r�s r�test_no_jump_from_return_eventz+JumpTestCase.test_no_jump_from_return_event�
s��	�
�
�a�����rc�:�|�d��ddzdSrr�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)NrLrNr�r�s�rr9z.JumpTestCase.test_jump_from_yield.<locals>.gen�
s&������M�M�!�����G�G�G�G�GrrP)rJr)rr9s` r�test_jump_from_yieldz!JumpTestCase.test_jump_from_yield�
sG���	�	�	�	�	�	
�S�S�U�U�����
�
�a�����rc��|�d��d�td��D��}|�d��dS)Nr?c��g|]}|��Sr#r#�r�r�s  rr�z@JumpTestCase.test_jump_forward_over_listcomp.<locals>.<listcomp>�
���"�"�"�1�Q�"�"�"rr�rN�rrbr�s  r�test_jump_forward_over_listcompz,JumpTestCase.test_jump_forward_over_listcomp�
sE���
�
�a����"�"��b�	�	�"�"�"���
�
�a�����rc�@�d}d�td��D��}d}dS)Nr?c��g|]}|��Sr#r#r�s  rr�zAJumpTestCase.test_jump_backward_over_listcomp.<locals>.<listcomp>�
r�rr�rNra�rrcr-r�s    r� test_jump_backward_over_listcompz-JumpTestCase.test_jump_backward_over_listcomp�
s)��
��"�"��b�	�	�"�"�"��
���r)rLrYrLc���d}|�d��|rdSd�td��D��}d}|�d��|�d��dS)NFrLc��g|]}|��Sr#r#r�s  rr�zDJumpTestCase.test_jump_backward_over_listcomp_v2.<locals>.<listcomp>�
s��!�!�!�1�Q�!�!�!rrPrfrYr7r��r�flagr-s   r�#test_jump_backward_over_listcomp_v2z0JumpTestCase.test_jump_backward_over_listcomp_v2�
sn�����
�
�a�����	��F�!�!��a���!�!�!�����
�
�a�����
�
�a�����rc��K�|�d��d�ttd����2���d{V��}|�d��dS)Nr?c��"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�rN�rr.rbr�s  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)Nr?c��"K�g|3d{V��}|��
6Srr#r�s  rr�zGJumpTestCase.test_jump_backward_over_async_listcomp.<locals>.<listcomp>�
r�r�r�rN)r.rbr�s    r�&test_jump_backward_over_async_listcompz3JumpTestCase.test_jump_backward_over_async_listcomp�
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)NFrLc��"K�g|3d{V��}|��
6Srr#r�s  rr�zJJumpTestCase.test_jump_backward_over_async_listcomp_v2.<locals>.<listcomp>�
s.����2�2�2�2�2�2�2�2��Q�2�2�2�2r�rPrfrYr7r�r�s   r�)test_jump_backward_over_async_listcomp_v2z6JumpTestCase.test_jump_backward_over_async_listcomp_v2�
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�Nr?rNrPr�r�r%�r�r�rrcs  r�(test_jump_with_null_on_stack_load_globalz5JumpTestCase.test_jump_with_null_on_stack_load_global�
sr��
��
��M�M�!���	
�	
�	
�	�
�
�a�������

�

�
�	�
�
�b�����rc��d}t}||�d����|�d��|dzdz|�d��dS)Nr?rWrfrxrz�r�)rrcr)s   r�&test_jump_with_null_on_stack_push_nullz3JumpTestCase.test_jump_with_null_on_stack_push_null�
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�Nr?rLr�rNr��rr;s  r�(test_jump_extended_args_unpack_ex_simplez5JumpTestCase.test_jump_extended_args_unpack_ex_simple�
sH���
�
�a�����=�=��#�#�-�v���A�q��
�
�a�����r)r?rWrWrPc��|�d��|�d��pd�^}}}|�d��dS)Nr?rWr�rPr�r�s  r�(test_jump_extended_args_unpack_ex_trickyz5JumpTestCase.test_jump_extended_args_unpack_ex_trickysN���
�
�a����
�M�M�!���&��	
�
��1��
�
�a�����r�cpuc���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�
GrrNi��z    output.append(100_000)r�r)rLr?)rbr,r�r�)r�sourcer-r)s    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_popsB���
�
�a�����M�M�!���'����
�
�a�����r)NrDFr�)rrr 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	rrrrrr!r&r+r/r6r8r:r=r@rDrIrKrNrPrSrUrXr[r]r_rardrirmrprtrwryr{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�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�requires_resourcerrr#rrr�r�Ps���������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�S���������Y�q�!�Y�Y�Y����� ����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�!�\�\�\�"�"���#�"���W��u�%�%�
4�
4�&�%�
4��Y�q�!�a��V���������rr�c�&�eZdZd�Zd�Zd�Zd�ZdS)�TestExtendedArgsc��|�tjtj����tjd��dSrrurs rr�zTestExtendedArgs.setUp&r�rc����td��D]}|���
dddd����fd��tj���|��tjd���S)N�r�rBrDrFc�(���|xxdz
cc<�Sr>r#)r�r�r��countsr�s   ��rr�z,TestExtendedArgs.count_traces.<locals>.trace0s����5�M�M�M�Q��M�M�M��Lr)rbr�r�)rr�r;rr�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)r)r?i-r	)r,rrB)r�nsr�rs    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>Gs*����A�A���a����A�A�A�A�A�Ari�c��i|]}d|��|��	S)rr#r�s  r�
<dictcomp>z?TestExtendedArgs.test_trace_lots_of_globals.<locals>.<dictcomp>Hs ��
0�
0�
0�q�i�A�i�i��
0�
0�
0rr)r?i�r	)�formatr�rbr,rrB)rr�rrs    r�test_trace_lots_of_globalsz+TestExtendedArgs.test_trace_lots_of_globalsAs����

�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rrr#rrrr$sX������������ H�H�H�
I�
I�
I�
I�
Irrc� �eZdZd�Zd�Zd�ZdS)�
TestEdgeCasesc��|�tjtj����tjd��dSrrurs rr�zTestEdgeCases.setUpPr�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>.fooU����Crc��dSrr#r�s r�barz*TestEdgeCases.test_reentrancy.<locals>.barXrrc� ��eZdZd�Z�fd�ZdS)�(TestEdgeCases.test_reentrancy.<locals>.Ac��dSrr#)rr8s  r�__call__z1TestEdgeCases.test_reentrancy.<locals>.A.__call__\r�rc�0��tj���dSr)r�r�)rrs �r�__del__z0TestEdgeCases.test_reentrancy.<locals>.A.__del___s�����S�!�!�!�!�!rN)rr r!r"r$)rs�rr�r [s=�������
�
�
�
"�
"�
"�
"�
"�
"�
"rr�)r�r�r�catch_unraisable_exceptionrB�
unraisable�objectr$r��	exc_valuer�r�)rr�r��cmrs    @r�test_reentrancyzTestEdgeCases.test_reentrancyTsH���	�	�	�	�	�	�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	��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>.foolrrr�)rr�s  r�test_same_objectzTestEdgeCases.test_same_objectksB��	�	�	�	��S�������S�\�^�^�$�$�$�$�$rN)rr r!r�r*r-r#rrrrNsA���������.�.�.�.%�%�%�%�%rr�__main__)7r:r�unittest�
unittest.mockrr�r�r��	functoolsrr��test.supportr�requires_working_socketr
r%r.r<r@r�rIrSrUr\rdrkrorBryr{r�r�r�r�r�r�r�r�r�r��TestCaser�r=r^r\rjrsr�r�r�r�rrr�mainr#rr�<module>r6s�������������#�#�#�#�#�#�
�
�
�
�����	�	�	�	�����������&�&�&�&�&�&����t�,�,�,�,�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(����

�
�
� 
�
�
������
�
�
�'�'�'���
�
�
�'�'�'������'�'�'���
�
�
�
(�(�(������	%�	%�	%���
�
�
�'�'�'�
��
�
�
�
�
�
���������
�
�
�
$�
$�
$�
��/�/�/�$�$�$�,�_������
�
�
�,�,�,���
�
�
�)�)�)���
�
�
�+�+�+���"
�
�
�+�+�+���������	-�	-�	-�)�+�6��;�
<�)�-�8�9�����������0g1�g1�g1�g1�g1�H�%�g1�g1�g1�T)����	/�	/�	/�	/�	/�-�	/�	/�	/�	��0�0�0�0�0�=�0�0���0�g3�g3�g3�g3�g3�x�0�g3�g3�g3�\#�#�#�#�#�#�#�#�L+�+�+�H�H�H�Q�Q�Q�Q�Q�8�$�Q�Q�Q�h'I�'I�'I�'I�'I�x�(�'I�'I�'I�T#%�#%�#%�#%�#%�H�%�#%�#%�#%�L�z����H�M�O�O�O�O�O��r

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