ok
Mini Shell
�
�܋fT8���dZddlmZddlZddlZddlZddlZddlmZm Z ddl
mZmZm
Z
mZmZmZmZmZddlmZddlmZmZmZmZmZmZmZmZej�d��Z ejd Z!e �%ejd
Z"ejdZ#ej$rdndZ%e&�'d
��Z(Gd�de��Z)dS)z#Raw data collector for coverage.py.�)�annotationsN)� FrameType�
ModuleType)�Any�Callable�Dict�List�Optional�Set�Tuple�cast)�env)�TArc�TFileDisposition�TLineNo�
TTraceData�TTraceFileData�TTraceFn�TTracer�TWarnFn�RESUME�RETURN_VALUE�YIELD_VALUE�
YIELD_FROM��coc�^�eZdZdZdd�Zdd�Zdd
�Z dd d�Zd!d�Zdd�Z d"d�Z
dd�Zd#d�ZdS)$�PyTracerz-Python implementation of the raw data tracer.�return�Nonec�*�|d|_||d|_d|_|d|_d|_d|_d|_d|_d|_g|_ d|_
d|_d|_d|_
tjt |dd��|j|_dS)NFr� in_atexitT)�
trace_arcs�should_start_context�switch_context� threading�
cur_file_data� last_line�
cur_file_name�context�started_context�
data_stack�thread�stopped� _activityr"�atexit�register�setattr�_trace�_cached_bound_method_trace��selfs �d/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/coverage/pytracer.py�__init__zPyTracer.__init__6s���
������G��F�TX��!�IM�����04���7;���"#���,0���&*���$���_a���26����������������{�D�9�9�9�59�K��'�'�'��strc���t|��}td�|j���D����}t |j��}d|d�d|�d|�d�S)Nc3�4K�|]}t|��V��dS�N)�len)�.0�vs r7� <genexpr>z$PyTracer.__repr__.<locals>.<genexpr>Ys(����8�8��S��V�V�8�8�8�8�8�8r9z<PyTracer at 0x�xz: z data points in z files>)�id�sum�data�valuesr>)r6�me�points�filess r7�__repr__zPyTracer.__repr__Wsh��
��X�X���8�8�T�Y�%5�%5�%7�%7�8�8�8�8�8���D�I����O��O�O�O��O�O��O�O�O�Or9�marker�argsrc��tdd��5}|�d�|t|��t |j������ |�d�d�
tt|�������� |�d��ddd��dS#1swxYwYdS)
z3For hard-core logging of what this tracer is doing.z/tmp/debug_trace.txt�az {} {}[{}]rz
.{:x}.{:x}z {}� z | z / c3�ZK�|]&\}}}}|pd�d��dV��'dS)z???�/���N)�
rpartition)r?�_�fnames r7rAzPyTracer.log.<locals>.<genexpr>msU����#�#�&��5�!�Q��^�e�/�/��4�4�R�8�#�#�#�#�#�#r9�
N)
�open�write�formatrCr>r,r-�identr&�current_thread�join�mapr:)r6rKrL�f�stacks r7�logzPyTracer.log]s��
�(�#�
.�
.� �!�
�G�G�K�&�&���4����D�O�$�$���
�
�
�
�
�G�G�E�L�L����#�c�4�.�.�!9�!9�:�:�;�;�;�
�
�G�G�D�M�M�M�' � � � � � � � � � � � ���� � � � � � s�B/C
�
C�CN�framer�event�arg�lineno�Optional[TLineNo]�Optional[TTraceFn]c� �t|jjvrdS|jr�t j��|jkr� t jd�� |j
���\|_|_|_|_nA#t&$r4|�d|jj|j|jj ��YnwxYwdS|dk�r�|jrN|j�G|�|��}|�-||_d}|j�J�|�|j��nd}nd}||_d|_|j
�|j|j|j|f��|jj}||jks|r�||_|j�|��} | � |�||��} | |j|<d|_| jr=| j}
|
�J�|
|jvrt?��|j|
<|j|
|_nd|_ n|jsd|_ tB�!|jj"|j#d z}|dk}ntI|d
d��dk}|r|jj%|_�n|j|_�n
|dkr�|j��|j}
|j&r@tOtPtR|j���*|j|
f��n8tOtPtV|j���*|
��|
|_�nn|d
k�rg|j&�r|jr�|jj"}|j#}tB�.tY|��|dzkrd}ny||dztBk}nd||tZkrd}nP||t\krd}n<tY|��|t^zkrd}n||t^zt`krd}nd}|rL|jj%}tOtPtR|j���*|j|f��|j
���\|_|_|_|_|jr%|j�J�d|_|�d��|jS)z*The trace function passed to sys.settrace.Nrz---
X�>zEmpty stack!�callTF��f_lastirR�linerr)1� THIS_FILE�f_code�co_filenamer.�sys�gettracer4r`�f_lineno�co_name�f_trace�f_back�settracer,�popr'r)r(r+�
IndexErrorr$r*r%r/�append�should_trace_cache�get�should_trace�trace�source_filenamerE�set�
f_trace_linesr�co_coderk�getattr�co_firstlinenor#r
rr�addrr>rr�YIELD_FROM_OFFSETr)r6rarbrcrdr^�
context_mayber+�filename�disp� tracename�oparg� real_call�flineno�code�lasti�real_return�firsts r7r3zPyTracer._tracets������0�0�0��4�
�L� �S�\�^�^�t�/N�N�N�
!�
�L�����
��O�'�'�)�)�]��"�D�$6����H\�H\���
�
�
����"��L�,��N��L�(� �����
�����4�
�F�?�?��(�
(�T�\�-A� $� 9� 9�%� @� @�
� �,�#0�D�L�&*�O��.�:�:�:��'�'���5�5�5�5�&+�O�O�"'��#2�D� �"�D�N��O�"�"��&��&��N�#� �
�
�
��|�/�H��4�-�-�-��-�%-��"��.�2�2�8�<�<���<��,�,�X�u�=�=�D�8<�D�+�H�5�%)��"��:�0� $� 4�I�$�0�0�0� �� �1�1�/2�u�u�� �)�,�)-��9�)=�D�&�&�*/�E�'�'��'�
,�&+��#��!���,�U�]�Q�->�?��"�a�Z� � �$�U�I�r�:�:�Q�>� ��
0�"'�,�"=�!=����!&�����
�f�_�_��!�-�#(�>���?�H���T��D�$6�7�7�;�;�T�^�W�<U�V�V�V�V���W��t�'9�:�:�>�>�w�G�G�G�!(����
�h�
�
���
V�4�#5�
V��|�+���
���%��4�y�y�E�A�I�-�-�&*���(,�E�A�I��&�'@����E�{�l�2�2�&*����e���3�3�&+����T���e�.?�&?�?�?�&*����e�&7�7�8�J�F�F�&+���&*���V�!�L�7�E���T��D�$6�7�7�;�;�T�^�e�V�<T�U�U�U���#�#�%�%�
Y�D��� 2�D�N�D�DX��#�
*��*�6�6�6�#����#�#�D�)�)�)��.�.s�2B�;C�?Crc��d|_|jrY|j�|j���|_n3|jj|j���jkr|jSt
j|j��|jS)zdStart this Tracer.
Return a Python function suitable for use with sys.settrace().
F)r.r&r-r[rZr4rprvr5s r7�startzPyTracer.starts|������>� ;��{�"�"�n�;�;�=�=�����;�$���(E�(E�(G�(G�(M�M�M�
�:�:���T�4�5�5�5��.�.r9c��tj��}d|_|jr7|j�J�|jj|j���jkrdS|jrZtj otj
dko
|jo|du}|s3||jkr*|�d|�d|j��zd���dSdSdSdS)zStop this Tracer.TN)��z.Trace function changed, data is likely wrong: z != z
trace-changed)�slug)
rprqr.r&r-rZr[�warnr�PYPY�PYPYVERSIONr"r4)r6�tf� dont_warns r7�stopz
PyTracer.stop's����\�^�^��
����>� ��;�*�*�*��{� �D�N�$A�$A�$C�$C�$I�I�I�
���9�
���a�c�o��&?�a�D�N�a�WY�]a�Wa�I��
�2��)H�#H�#H�� � �D��D�D��!@�D�D�E�(�������
�
�
�
�#H�#Hr9�boolc��|jS)zHas there been any activity?�r/r5s r7�activityzPyTracer.activityGs
���~�r9c��d|_dS)zReset the activity() flag.FNr�r5s r7�reset_activityzPyTracer.reset_activityKs
������r9�Optional[Dict[str, int]]c��dS)z+Return a dictionary of statistics, or None.N�r5s r7� get_statszPyTracer.get_statsOs���tr9)rr )rr:)rKr:rLrrr r=)
rarrbr:rcrrdrerrf)rr)rr�)rr�)
�__name__�
__module__�__qualname__�__doc__r8rJr`r3r�r�r�r�r�r�r9r7rr#s�������7�7�$@�@�@�@�BP�P�P�P�����8%)�\/�\/�\/�\/�\/�|/�/�/�/�*����@�������������r9r)*r��
__future__rr0�disrpr&�typesrr�typingrrrr r
rrr
�coverager�coverage.typesrrrrrrrr�opmapr{rrrrr�r��__file__�rstriprmrr�r9r7�<module>r�s���*�)�"�"�"�"�"�"�
�
�
�
�
�
�
�
�
�
�
�
�����'�'�'�'�'�'�'�'�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H���������������������������
����x� � ���y��(�� �>��)�M�*�K���<�(�J� �X�,���1��
�O�O�D�!�!� �n�n�n�n�n�w�n�n�n�n�nr9
Zerion Mini Shell 1.0