Sindbad~EG File Manager

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

�

'Μg�f��.�dZddlZddlZddlZddlZddlZddlZddlZddlZ	ddl	Z	ddlmZm
Z
mZmZddlmZddlmZddlmZmZedZd�Zd	�Zd
�ZGd�dej4�Zd
�ZGd�dej4�ZGd�dej4�Zd�Zd�Z d�Z!d�Z"d�Z#e$�fd�Z%d�Z&d�Z'd�Z(Gd�dej4�Z)e
d���re	��e	jTZ+e	jXde	jZ�Z.e+j^Z0e.fe0_1e	jde0_3e+jhZ5e	jle	jde	jZfe5_1e	jne5_3e+jpZ9e	jle	jde	jte	jZ�fe9_1e	jne9_3da;d�Z<e.e<�Z=e0e=�Z>Gd �d!ej4�Z?d"�Z@eAd#k(rej��yy#e
$rdZ	Y���wxYw)$a�This module includes tests of the code object representation.

>>> def f(x):
...     def g(y):
...         return x + y
...     return g
...

>>> dump(f.__code__)
name: f
argcount: 1
posonlyargcount: 0
kwonlyargcount: 0
names: ()
varnames: ('x', 'g')
cellvars: ('x',)
freevars: ()
nlocals: 2
flags: 3
consts: ('None', '<code object g>')

>>> dump(f(4).__code__)
name: g
argcount: 1
posonlyargcount: 0
kwonlyargcount: 0
names: ()
varnames: ('y',)
cellvars: ()
freevars: ('x',)
nlocals: 1
flags: 19
consts: ('None',)

>>> def h(x, y):
...     a = x + y
...     b = x - y
...     c = a * b
...     return c
...

>>> dump(h.__code__)
name: h
argcount: 2
posonlyargcount: 0
kwonlyargcount: 0
names: ()
varnames: ('x', 'y', 'a', 'b', 'c')
cellvars: ()
freevars: ()
nlocals: 5
flags: 3
consts: ('None',)

>>> def attrs(obj):
...     print(obj.attr1)
...     print(obj.attr2)
...     print(obj.attr3)

>>> dump(attrs.__code__)
name: attrs
argcount: 1
posonlyargcount: 0
kwonlyargcount: 0
names: ('print', 'attr1', 'attr2', 'attr3')
varnames: ('obj',)
cellvars: ()
freevars: ()
nlocals: 1
flags: 3
consts: ('None',)

>>> def optimize_away():
...     'doc string'
...     'not a docstring'
...     53
...     0x53

>>> dump(optimize_away.__code__)
name: optimize_away
argcount: 0
posonlyargcount: 0
kwonlyargcount: 0
names: ()
varnames: ()
cellvars: ()
freevars: ()
nlocals: 0
flags: 3
consts: ("'doc string'", 'None')

>>> def keywordonly_args(a,b,*,k1):
...     return a,b,k1
...

>>> dump(keywordonly_args.__code__)
name: keywordonly_args
argcount: 2
posonlyargcount: 0
kwonlyargcount: 1
names: ()
varnames: ('a', 'b', 'k1')
cellvars: ()
freevars: ()
nlocals: 3
flags: 3
consts: ('None',)

>>> def posonly_args(a,b,/,c):
...     return a,b,c
...

>>> dump(posonly_args.__code__)
name: posonly_args
argcount: 3
posonlyargcount: 2
kwonlyargcount: 0
names: ()
varnames: ('a', 'b', 'c')
cellvars: ()
freevars: ()
nlocals: 3
flags: 3
consts: ('None',)

�N)�cpython_only�check_impl_detail�requires_debug_ranges�
gc_collect)�assert_python_ok)�threading_helper)�opmap�opname�COPY_FREE_VARSc#�~K�|D]4}t|�}|jd�rd|jz���1|���6y�w)z.Yield a doctest-safe sequence of object reprs.z<code objectz<code object %s>N)�repr�
startswith�co_name)�t�elt�rs   �+/usr/local/lib/python3.12/test/test_code.py�constsr�s9��������I���<�<��'�$�s�{�{�2�2��G��s�;=c
��dD]}t|�dt|d|z�����!tdtt|j���y)z1Print out a text representation of a code object.)
�name�argcount�posonlyargcount�kwonlyargcount�names�varnames�cellvars�freevars�nlocals�flagsz: �co_zconsts:N)�print�getattr�tupler�	co_consts)�co�attrs  r�dumpr'�sB��=��	�$���E�D�L� 9�:�;�=�
�)�U�6�"�,�,�/�0�1�c�:�dt�j|���S)NzForeign getitem: )�super�__getitem__)�self�is  r�external_getitemr.�s��
�u�w�2�2�1�5�6�7�7r(c���eZdZed��Zed��Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
e�d��Zd�Zd
�Ze�d��Zd�Zd�Zd�Zd�Zed��Zy)�CodeTestc�D�ddl}|jddd�}|j|jd�|j|jd�|j|j
d�|j
t�5t|�ddd�y#1swYyxYw)Nr�filename�funcname�)	�	_testcapi�
code_newempty�assertEqual�co_filenamer�co_firstlineno�assertRaises�	Exception�exec)r,r5r%s   r�
test_newemptyzCodeTest.test_newempty�sx���
�
$�
$�Z��R�
@���������4�������Z�0�����*�*�B�/�
�
�
�y�
)���H�*�
)�
)�s�B�Bc�����ddlm�d��d�����fd�}Gd�dt�}||dt�|j}|j
dj}|j||�|gd	��}|j|dd
�y)Nr)�FunctionTypec�"���fd�jS)Nc����S�N���	__class__s�r�<lambda>zICodeTest.test_closure_injection.<locals>.create_closure.<locals>.<lambda>�s���Ir()�__closure__rDs`r�create_closurez7CodeTest.test_closure_injection.<locals>.create_closure�s���%�2�2�2r(c�z�|j|jdzttdg�|jz��S)z9A new code object with a __class__ cell added to freevarsrD�)�co_freevars�co_code)�replacerK�bytesrrL)�cs r�new_codez1CodeTest.test_closure_injection.<locals>.new_code�s7���9�9�����)G�QV�Xf�hi�Wj�Qk�lm�lu�lu�Qu�9�v�vr(c����|j�}|jrJ��|�}|j}t||�|t	�|||��yrB)�__code__rG�__defaults__�setattr�globals)	�clsr�f�code�closure�defaultsr?rHrPs	      ���r�add_foreign_methodz;CodeTest.test_closure_injection.<locals>.add_foreign_method�sL����A�J�J�'�D��}�}�$�$�$�S�)�G��~�~�H��C��|�D�'�)�T�8�W�U�Vr(c��eZdZy)�-CodeTest.test_closure_injection.<locals>.ListN)�__name__�
__module__�__qualname__rCr(r�Listr]�s��r(rar+)rJ��zForeign getitem: 1)	�typesr?�listr.r+rG�
cell_contents�assertIsr7)	r,r[ra�function�	class_ref�objr?rHrPs	      @@@r�test_closure_injectionzCodeTest.test_closure_injection�s����	'�	3�	w�	W�	�4�	�	�4��0@�A��#�#���(�(��+�9�9�	��
�
�i��&��9�o������Q��!5�6r(c���d�}|j}t|�}||j|j|j|j
|j|j|j|j|j|j|j|j|j|j|j |j"|j$|j&�y)Nc��yrBrCrCr(r�funcz'CodeTest.test_constructor.<locals>.func�s��Dr()rR�type�co_argcount�co_posonlyargcount�co_kwonlyargcount�
co_nlocals�co_stacksize�co_flagsrLr$�co_names�co_varnamesr8r�co_qualnamer9�co_linetable�co_exceptiontablerK�co_cellvars)r,rnr%�CodeTypes    r�test_constructorzCodeTest.test_constructor�s����
�]�]����8��	�����-�-��,�,��
�
��������
�
��������������
�
�����)�)�����,�,�������#	(r(c��|jtjjjtjj
�yrB)r7r0�
test_qualnamerRrxr`�r,s rrzCodeTest.test_qualname�s4������"�"�+�+�7�7��"�"�/�/�	
r(c��d�}|j}d�}|j}dddddd|jtjzfd	d
|jfd|j
fdd
ddddd|jffD]Q\}}|j||��5|jdi||i��}|jt||�|�ddd��S|j|j|j��}|j|j|j�|j|j|j�y#1swY��xYw)Nc�
�d}|S�NrJrC��xs rrnz#CodeTest.test_replace.<locals>.func�����A��Hr(c��d}d}|S)NrbrcrC)�y�zs  r�func2z$CodeTest.test_replace.<locals>.func2s���A��A��Hr()rpr)rqr)rrr)rsrJ)rtrru)r9�drLr$)rv)�myname)rw)�spam)rK)�freevar)r{)�cellvar)r8�newfilename)r�newnamery)r&�value)rwrsrC)
rRru�inspect�CO_COROUTINErLr$ry�subTestrMr7r"rwrs)r,rnrXr��code2r&r�rPs        r�test_replacezCodeTest.test_replace�sD��	��}�}��	�����
�%�$���
�����)=�)=�=�>�#�
��
�
�&�
�%�/�/�*�%�&�)�)�*�"�
�U�/�/�0�!
�K�D�%�$���4�u��5�'�4�<�<�8�4��-�8��� � ���4�!8�%�@�6�5�%
�,�<�<�E�,=�,=�+0�+;�+;� �=������-�-�u�/@�/@�A�����,�,�e�.>�.>�?�6�5�s�1D:�:E	c��d�}|j}|jdkDsJ�t|�}dD]�}|jt�5||j
|j|j|j|z|j|j|j|j|j|j|j|j|j |j"|j$|j&|j(|j*�ddd���|jt�5|j-|jdz
��ddd�|jt�5|j-|jdz��ddd�y#1swY��xxYw#1swY�TxYw#1swYyxYw)Nc�
�d}|Sr�rCr�s rrnz,CodeTest.test_nlocals_mismatch.<locals>.func"r�r(r)���rJrJ)rs)rRrsror:�
ValueErrorrprqrrrtrurLr$rvrwr8rrxr9ryrzrKr{rM)r,rnr%r|�diffs     r�test_nlocals_mismatchzCodeTest.test_nlocals_mismatch!sS��	��]�]���}�}�q� � � ���8���D��"�"�:�.������.�.��-�-�����-�����������������������������*�*�����-�-�������%�/�.��.�
�
�z�
*��J�J�"�-�-�!�"3�J�4�+�
�
�
�z�
*��J�J�"�-�-�!�"3�J�4�+�
*�1/�.��,+�
*��
*�
*�s%�CF�6 F)�3 F5�F&	�)F2�5F>c�j�d�}|j}|jd��}|j||�y)Nc����fd�S)Nc����SrBrC��args�rrFzBCodeTest.test_shrinking_localsplus.<locals>.func.<locals>.<lambda>Js���3r(rCr�s`rrnz0CodeTest.test_shrinking_localsplus.<locals>.funcIs	����r(rn)r)rRrMr7)r,rnrX�newcodes    r�test_shrinking_localsplusz"CodeTest.test_shrinking_localsplusFs0��	��}�}���,�,�v�,�.������w�'r(c��d�}|jjd��x}}|jt|j	��g�y)Nc��yrBrCrCr(rrnz+CodeTest.test_empty_linetable.<locals>.funcP���r(r(�ry)rRrMr7re�co_lines)r,rnrPrXs    r�test_empty_linetablezCodeTest.test_empty_linetableOsA��	��-�-�/�/�S�/�A�A��4�����h�/�/�1�2�B�7r(c��d�}|jt�5|jjddd�y#1swYyxYw)Nc��yrBrCrCr(rrnz3CodeTest.test_co_lnotab_is_deprecated.<locals>.funcVr�r()�assertWarns�DeprecationWarningrR�	co_lnotab)r,rns  r�test_co_lnotab_is_deprecatedz%CodeTest.test_co_lnotab_is_deprecatedUs1��	��
�
�0�
1��M�M�#�#�2�
1�
1�s	�9�Ac��d�}|jtdd�|jjd|jjddz��|_d}|jt|�5|�ddd�y#1swYyxYw)Nc��yrBrCrCr(r�fooz+CodeTest.test_invalid_bytecode.<locals>.foo]r�r(��z<229>��rJ�rLzunknown opcode 229)r7r
rRrMrL�assertRaisesRegex�SystemError)r,r��msgs   r�test_invalid_bytecodezCodeTest.test_invalid_bytecode\s{��	�	
������g�.��|�|�+�+��c�l�l�2�2�1�2�6�6�,�8���#��
�
#�
#�K��
5��E�6�
5�
5�s�0B�B
c��ddl}i}ttjd�|�|d}|j}|j
j}g}t|j|d��|j�d��D]E\}}|j|jd�gd��t|�r�5|j|��G|j|D�	cgc]}	|	j|	j f��c}	gd��ycc}	w)	NrzX        try:
            1/0
        except Exception as e:
            exc = e
        �excT)�show_caches)�strict)rrc�))�
PUSH_EXC_INFON)�
LOAD_CONSTN)�
STORE_NAME�e)�DELETE_NAMEr���RERAISErJ)�COPYrc)�
POP_EXCEPTNr�)�disr<�textwrap�dedent�
__traceback__�tb_frame�f_code�zip�get_instructions�co_positions�assertIn�count�any�appendr7r
�argval)
r,r��	namespacer��	tracebackrX�artificial_instructions�instr�	positions�instructions
          r�)test_co_positions_artificial_instructionsz2CodeTest.test_co_positions_artificial_instructionsks����	��X�_�_��
�
�	������%�%�	��!�!�(�(��"$�� #� �C� � ��4�8������!
��E�9�
�M�M�)�/�/�$�/��;��y�>�'�.�.�u�5�!
� 	
���$;�
�#:�K��#�#�[�%7�%7�8�#:�
�	
�	
��
s�C>c�J�tjd�}tddd|�y)N�#
            def f():
                pass

            positions = f.__code__.co_positions()
            for line, end_line, column, end_column in positions:
                assert line == end_line
                assert column is None
                assert end_column is None
            z-X�no_debug_ranges�-c�r�r�r�r,rXs  r�6test_endline_and_columntable_none_when_no_debug_rangesz?CodeTest.test_endline_and_columntable_none_when_no_debug_ranges�s(�����	 �	��	��0�$��=r(c�J�tjd�}td|d��y)Nr�r��1)�PYTHONNODEBUGRANGESr�r�s  r�:test_endline_and_columntable_none_when_no_debug_ranges_envzCCodeTest.test_endline_and_columntable_none_when_no_debug_ranges_env�s#�����	 �	��	��t��=r(c���d�}|jjd��}|j�}|D]7\}}}}|j|�|j	||j
dz��9y)Nc��d}yr�rCr�s rrnz8CodeTest.test_co_positions_empty_linetable.<locals>.func�s���Ar(r(r�rJ)rRrMr��assertIsNoner7r9)r,rnrPr��line�end_line�column�
end_columns        r�!test_co_positions_empty_linetablez*CodeTest.test_co_positions_empty_linetable�sh��	��=�=�(�(�c�(�:���)�)�+�	�2;�.�D�(�F�J����d�#����X�x�'>�'>��'B�C�3<r(c�f�d�}|j}|jd��}|jd��}|jd��}|j||�|j||�|j||�|j||�|j||�|j||�y)Nc��	t�t�t�y#t�Y�xYw#t�wxYwrB)�arO�b�drCr(rrWz&CodeTest.test_code_equality.<locals>.f�s,��
��������
������s�
!�
2�/�2�>r(r�)rz)rRrM�assertNotEqual)r,rW�code_a�code_b�code_c�code_ds      r�test_code_equalityzCodeTest.test_code_equality�s���	��������S��1�����#��6�����#��6�����F�F�+����F�F�+����F�F�+����F�F�+����F�F�+����F�F�+r(c�4�d�j}d�j}|j||�|jt|�t|��|jd��}|j||�|jt|�t|��y)Nc��yr�rCrCr(rrFz:CodeTest.test_code_hash_uses_firstlineno.<locals>.<lambda>����ar(c��yr�rCrCr(rrFz:CodeTest.test_code_hash_uses_firstlineno.<locals>.<lambda>�r�r(�)r9)rRr��hashrM)r,�c1�c2�c3s    r�test_code_hash_uses_firstlinenoz(CodeTest.test_code_hash_uses_firstlineno�sx���
!�
!���
!�
!�����B��#����D��H�d�2�h�/�
�Z�Z�r�Z�
*�����B��#����D��H�d�2�h�/r(c�`�ddd�d�j}|j|jd�|j|jd�|j|jd�|jdd��}|j
||�|j
t|�t|��y)NrJ)r��wc��yr�rC)r�r�r�rs    rrFz4CodeTest.test_code_hash_uses_order.<locals>.<lambda>�s��qr(rbr)rqrr)rRr7rprqrrrMr�r)r,rO�swappeds   r�test_code_hash_uses_orderz"CodeTest.test_code_hash_uses_order�s��� �A�
(�2�2���������*�����-�-�q�1�����,�,�a�0��)�)�q�A�)�F�����A�w�'����D��G�T�'�]�3r(c���d�j}d�j}|j|j��}|j||�|jt	|�t	|��y)Nc��||zSrBrC�r�r�s  rrFz7CodeTest.test_code_hash_uses_bytecode.<locals>.<lambda>����!�a�%r(c��||zSrBrCr
s  rrFz7CodeTest.test_code_hash_uses_bytecode.<locals>.<lambda>�rr(r�)rRrMrLr�r)r,rOr�rs    r�test_code_hash_uses_bytecodez%CodeTest.test_code_hash_uses_bytecode�sT��
�)�)��
�)�)��
�Y�Y�q�y�y�Y�
)�����A�r�"����D��G�T�"�X�.r(c��tddd�}tddd�}dtj�_tjd��t|dgi�t|dgi�|j
||�tjd�y)	a
 GH-109052

        Make sure the instrumentation doesn't affect the code equality
        The validity of this test relies on the fact that "x is x" and
        "x in x" have only one different instruction and the instructions
        have the same argument.

        zx is xz
example.py�evalzx in xTc��yrBrC)�argss rrFz?CodeTest.test_code_equal_with_instrumentation.<locals>.<lambda>s��4r(r�N)�compile�sys�	_getframe�f_trace_opcodes�settracer<r�)r,�code1r�s   r�$test_code_equal_with_instrumentationz-CodeTest.test_code_equal_with_instrumentation�ss����,��7����,��7��*.��
�
��'����'�(��U�S�"�I���U�S�"�I�����E�5�)����T�r(N)r^r_r`rr=rkr}rr�r�r�r�r�r�rr�r�r�r�r�rr
rrrCr(rr0r0�s��������7��7�@(�2
�&@�P#5�J(�8�$�
���/
��/
�b
>�>� ��D��D�,�*0�4�/����r(r0c�B�|tjd|zdzdd�uS)N�_rJr�)r�intern)�ss r�
isinternedr 	s%����
�
�C�!�G�c�M�1�R�0�1�1�1r(c�n�eZdZd�Zd�Zd�Zed��Zed��Zed��Z	ed��Z
ed��Zy	)
�CodeConstsTestc�j�|D]}||k(s�	|cS|j||�|jd�y)NzShould never be reached)r��fail)r,rr��vs    r�
find_constzCodeConstsTest.find_consts5���A��E�z����	
�
�
�e�V�$��	�	�+�,r(c�F�t|�s|jd|�d��yy)N�String z is not interned�r r$�r,rs  r�assertIsInternedzCodeConstsTest.assertIsInterneds���!�}��I�I�Q�8�9�r(c�F�t|�r|jd|�d��yy)Nr(z is internedr)r*s  r�assertIsNotInternedz"CodeConstsTest.assertIsNotInterneds���a�=��I�I��4�5�r(c�x�tddd�}|j|jd�}|j|�y)Nzres = "str_value"�?r<�	str_value�rr&r$r+�r,r%r%s   r�test_interned_stringz#CodeConstsTest.test_interned_strings3��
�(�#�v�
6���O�O�B�L�L�+�6�����a� r(c�~�tddd�}|j|jd�}|j|d�y)Nzres = ("str_value",)r/r<�r0rr1r2s   r�test_interned_string_in_tuplez,CodeConstsTest.test_interned_string_in_tuple#s7��
�+�S�&�
9���O�O�B�L�L�.�9�����a��d�#r(c��tddd�}|j|jtd��}|j	t|�d�y)Nzres = a in {"str_value"}r/r<r5r)rr&r$�	frozensetr+r#r2s   r�!test_interned_string_in_frozensetz0CodeConstsTest.test_interned_string_in_frozenset)s@��
�/��f�
=���O�O�B�L�L�)�N�*C�D�����e�A�h�q�k�*r(c�8�dd�}|j|��y)Nc��|SrBrC)r�s rrWz6CodeConstsTest.test_interned_string_default.<locals>.f1s���Hr(r5)r+�r,rWs  r�test_interned_string_defaultz+CodeConstsTest.test_interned_string_default/s��	����a�c�"r(c�x�tddd�}|j|jd�}|j|�y)Nzres = "str\0value!"r/r<z
strvalue!)rr&r$r-r2s   r�test_interned_string_with_nullz-CodeConstsTest.test_interned_string_with_null5s3��
�+�S�&�
9���O�O�B�L�L�-�8��� � ��#r(N)r^r_r`r&r+r-rr3r6r9r=r?rCr(rr"r"su��-�:�6��!��!�
�$��$�
�+��+�
�#��#�
�$��$r(r"c��eZdZd�Zy)�CodeWeakRefTestc�`��i}tdt�|�|d}~d�_�fd�}tj|j
|�}�j
t|���~t��jt|����j
�j�y)Nz
def f(): passrWFc���d�_y)NT)�called)rXr,s �r�callbackz,CodeWeakRefTest.test_basic.<locals>.callbackGs
����D�Kr()
r<rUrD�weakref�refrR�
assertTrue�boolr�assertFalse)r,r�rWrE�coderefs`    r�
test_basiczCodeWeakRefTest.test_basic>s�����	��_�g�i��3��c�N������	��+�+�a�j�j�(�3������W�Y��(�
�������g�i��)�������$r(N)r^r_r`rLrCr(rrArA<s��%r(rAc��t|�SrB)�next)�its r�readrPVs����8�Or(c�v�t|�}|dz}d}|dzr!t|�}|dz
}||dz|zz}|dzr�!|S)N�?r�@�)rP)rOr��val�shifts    r�read_varintrWYsT���R��A�
�b�&�C�
�E�
�b�&���H��
��
����"�������b�&��Jr(c�8�t|�}|dzr|dz	S|dz	Sr�)rW)rO�uvals  r�read_signed_varintrZcs(���r�?�D��a�x����|���q�y�r(c#�K�|j}t|j�}		t|�}|dz	dz}|dzdz}|dk(r||ddddf��n�|dk(rYt|�}||z
}|t
|�z}t
|�}|dk(rd}n|dz}t
|�}|dk(rd}n|dz}||||||f��n�|dk(rt|�}||z
}||||ddf��ne|dvr+|d	z
}||z
}t|�}	t|�}
|||||	|
f��n6d|cxkrd	ksJ�J�t|�}|dz|d
z	z}	|||||	|	|dzzf����#t$rYywxYw�w)Nrcr4�rJ�r�
)�
��r_r�)r9�iterryrP�
StopIterationrZrW)rXr�rO�
first_byte�length�
line_deltar��col�end_colr�r��second_bytes            r�parse_location_tablerjjs��������D�	
�d���	 �B�
�	��b��J��a��2�%���q�.�A�%���2�:����t�T�4�8�8�
�R�Z�+�B�/�J��J��D��k�"�o�-�H��b�/�C��a�x����q���!�"�o�G��!�|����1������x��g�>�>�
�R�Z�+�B�/�J��J��D����t�T�4�8�8�
�\�
!����J��J��D��"�X�F��b��J����t�V�Z�@�@���N��N�#�N�#�N��r�(�K��Q�Y�+��"2�3�F����t�V�V�{�R�?O�5P�Q�Q�M���	��	�s(�#E�D6�DE�6	E�?E�E�Ec#�jK�t|�D]!\}}}}}}t|�D]
}||||f����#y�wrB)rj�range)rXrrer�r�rgrhs       r�positions_from_location_tablerm�s@����3G��3M�/��6�4��3���v��A���3��0�0��4N�s�13c#�2K�|D]}||k7s�	|��|}�y�wrBrC)�lst�prev�items   r�deduprr�s!�������4�<��J��D��s��	c�&�td�|D��S)Nc3�*K�|]\}}}}|���
y�wrBrC)�.0�lrs   r�	<genexpr>z&lines_from_postions.<locals>.<genexpr>�s����1�y�|��1�a���y�s�)rr)r�s r�lines_from_postionsrx�s���1�y�1�1�1r(c�P�dz}ttztz}|rtStS)z






    r�)r�r�r��q�p)r�r�s  r�
misshappenr|�sK��	
�	
�		
��	
�
�	�
�	��	
�
���	r(c�6�dj�}t��)Nz
            )�stripr�)�!example_report_generation_messages r�bug93662r��s��
��e�g�&��,�r(c�4�eZdZd�Zd�Zd�Zd�Zed��Zy)�CodeLocationTestc��t|jj��}tt|j��}t	||�D]\}}|j||��|jt
|�t
|��yrB)rerRr�rmr�r7�len)r,rn�pos1�pos2�l1�l2s      r�check_positionsz CodeLocationTest.check_positions�si���D�M�M�.�.�0�1���1�$�-�-�@�A���$��o�F�B�����R��$�&�����T��C��I�.r(c��|jt�|jt�|jt�yrB)r�rjr|r�r�s r�test_positionszCodeLocationTest.test_positions�s-�����1�2����Z�(����X�&r(c��|j}|j�D��cgc]\}}}|��
}}}|j|tt	|���ttt
|���}t||�D]\}}|j||��|jt|�t|��ycc}}wrB)	rRr�r7rerrrxrmr�r�)	r,rnr%rr��lines1�lines2r�r�s	         r�check_lineszCodeLocationTest.check_lines�s���
�]�]��)+����7��:�1�a��$���7������e�F�m�!4�5��)�*G��*K�L�M���&�&�)�F�B�����R��$�*�����V��c�&�k�2��8s�
B<c��|jt�|jt�|jt�yrB)r�rjr|r�r�s r�
test_lineszCodeLocationTest.test_lines�s-�����-�.�����$�����"r(c��d�}d}|jjddttjddtjddtjddg�td	|d
zzdzdg���|_|jt|�|jt|jj��d
d
gz�y)Nc��yrBrCrCr(rrWz/CodeLocationTest.test_code_new_empty.<locals>.f�r�r(r^rJ�*�RESUMEr�LOAD_ASSERTION_ERROR�
RAISE_VARARGS�rcrb)rtr9rLry)r�r�NN)
rRrMrNr�r	r:�AssertionErrorr7rer�)r,rW� PY_CODE_LOCATION_INFO_NO_COLUMNSs   r�test_code_new_emptyz$CodeLocationTest.test_code_new_empty�s���
	�+-�(��Z�Z�'�'�����I�I�h�'���I�I�4�5�q��I�I�o�.������7�1�<�>����	��(�
��
�&	
���.�!�,��������(�(�*�+�
�%�&�&�	
r(N)	r^r_r`r�r�r�r�rr�rCr(rr�r��s*��/�'�
3�#�
�
��
r(r�T)�cpythonc��|ayrB)�
LAST_FREED)�ptrs r�myfreer�s���
r(c�X�eZdZd�Zd�Zd�Zd�Zd�Zej�d��Z
y)�CoExtrac��td�S)Nz	lambda:42)rr�s r�get_funczCoExtra.get_func#s����$�$r(c	���|j�}|jttdttjd��|jttdttjd��y)Nr�r�)r�r:r��SetExtra�
FREE_INDEX�ctypes�c_voidp�GetExtrar<s  r�test_get_non_codezCoExtra.test_get_non_code)sQ���
�
��A����k�8�R��$�n�n�S�1�
3����k�8�R��$�n�n�S�1�
3r(c	�(�|j�}|jtt|jt
dzt
jd��|jt|jt
dzt
jd��d�y)Nr�r)
r�r:r�r�rRr�r�r�r7r�r<s  r�test_bad_indexzCoExtra.test_bad_index1sh���
�
��A����k�8�Q�Z�Z�(��n�f�n�n�S�.A�
C����X�a�j�j�*�S�.�$�n�n�S�1�3�45�
7r(c��|j�}t|jtt	j
d��~|j
td�y)Nr�)r�r�rRr�r�r�r7r�r<s  r�test_free_calledzCoExtra.test_free_called8s;���
�
��A��Q�Z�Z��V�^�^�C�-@�A�����Z��-r(c���|j�}tj�}t|jt
tjd��t|jt
tjd��|j
td�tj�}t|jt
|�|j
|jd�~y)N��i,)
r�r�r�r�rRr�r7r�r�r�)r,rW�extras   r�test_get_setzCoExtra.test_get_setAs����
�
��A��N�N�$�E��Q�Z�Z��V�^�^�C�-@�A��Q�Z�Z��V�^�^�C�-@�A����Z��-��N�N�$�E��Q�Z�Z��U�3����U�[�[�#�.�r(c�2�|j�}Gd�dtj�}t|jt
t
jd��|||�}~|j�|j�|jtd�y)Nc�$��eZdZ�fd�Zd�Z�xZS)�6CoExtra.test_free_different_thread.<locals>.ThreadTestc�>��t�|��||_||_yrB)r*�__init__rW�test)r,rWr�rEs   �rr�z?CoExtra.test_free_different_thread.<locals>.ThreadTest.__init__Ws����G�$�&��D�F� $�D�Ir(c�H�|`|jjtd�y)N��)rWr�r7r�r�s r�runz:CoExtra.test_free_different_thread.<locals>.ThreadTest.run[s�����I�I�)�)�*�c�:r()r^r_r`r�r��
__classcell__rDs@r�
ThreadTestr�Vs
���%�;r(r�r�)r��	threading�Threadr�rRr�r�r��start�joinr7r�)r,rWr��tts    r�test_free_different_threadz"CoExtra.test_free_different_threadQsm���
�
��A�
;�Y�-�-�
;�
�Q�Z�Z��V�^�^�C�-@�A��A�t�$�B���H�H�J��G�G�I����Z��-r(N)r^r_r`r�r�r�r�r�r�requires_working_threadingr�rCr(rr�r�"s;��	%�	3�	7�	.�	� 
5�	�	4�	4�	6�	.�
7�	.r(r�c�L�|jtj��|SrB)�addTest�doctest�DocTestSuite)�loader�tests�patterns   r�
load_testsr�gs��	�M�M�'�&�&�(�)��Lr(�__main__)C�__doc__r�rr�r��unittestr�rFr�r��ImportError�test.supportrrrr�test.support.script_helperrr�opcoder	r
rrr'r.�TestCaser0r r"rArPrWrZrjrm�objectrrrxr|r�r��	pythonapi�py�	CFUNCTYPEr��freefunc�%PyUnstable_Eval_RequestCodeExtraIndex�RequestCodeExtraIndex�argtypes�	c_ssize_t�restype�PyUnstable_Code_SetExtrar��	py_object�c_int�PyUnstable_Code_GetExtrar��POINTERr�r��	FREE_FUNCr�r�r�r^�mainrCr(r�<module>r�s#��}�~�
������
���&�&�8�)� ��'�(���2�8�Z�x� � �Z�z
2�-$�X�&�&�-$�`%�h�'�'�%�4���)R�V1�
�H��2��@�;
�x�(�(�;
�|�T�"�v�'9�	�	�	�B��v����V�^�^�4�H��D�D��&.�[��"�$*�$4�$4��!��*�*�H��)�)�6�+;�+;�V�^�^�L�H���|�|�H���*�*�H��)�)�6�+;�+;�'�������7�9�H���|�|�H���J���� �I�&�y�1�J�B.�(�#�#�B.�J�
�z���H�M�M�O���C��
�F��s�H	�	H�H

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