�
��Vc c sl � d Z ddlmZ ddlmZmZmZmZmZm Z m
Z
mZmZm
Z
G d� dej � � ZdS )zoFixer for execfile.
This converts usages of the execfile function into calls to the built-in
exec() function.
i )�
fixer_base)
�Comma�Name�Call�LParen�RParen�Dot�Node�ArgList�String�symsc s � e Zd ZdZdZd� ZdS )�FixExecfileTz�
power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > >
|
power< 'execfile' trailer< '(' filename=any ')' > >
c sh � |d }|� d� � }|� d� � }|j d j d � � � }t |� � � t � � t dd� � g|�� � }t
t j t d� � |g� � }t
t j
t � � t d � � g� � t
t j
t � � t � � g� � g} |g| z }
|� � � }d|_ t d
d� � }|
t � � |t � � |gz }
t t d� � |
d� � }|g}|�5|� t � � |� � � g� � |�5|� t � � |� � � g� � t t d
� � ||j �� � S )N�filename�globals�localsi����z"rb"z )ZrparenZopen�readz'exec'Zcompile� Zexec)�prefix)ZgetZchildrenZcloner r r r r
Zpowerr Ztrailerr r r r r Zextend)ZselfZnodeZresultsr r
r Zexecfile_parenZ open_argsZ open_callr Z open_exprZfilename_argZexec_strZcompile_argsZcompile_callZargss �3/usr/lib64/python3.11/lib2to3/fixes/fix_execfile.py� transformzFixExecfile.transform s� � ��:�&���+�+�i�(�(�����X�&�&�� ��r�*�3�B�7�=�=�?�?���X�^�^�-�-�u�w�w��v�s�8K�8K�L�#1�3� 3� 3� ����d�6�l�l�I�%>�?�?� ��T�\�C�E�E�4��<�<�#8�9�9��T�\�F�H�H�f�h�h�#7�8�8�:���K�$�&� � �~�~�'�'��!����(�C�(�(�� �E�G�G�\�5�7�7�H�#M�M���D��O�O�\�2�>�>���~��� 4��K�K����'�-�-�/�/�2�3�3�3�� 3��K�K����&�,�,�.�.�1�2�2�2��D��L�L�$�t�{�;�;�;�;� N)Z__name__Z
__module__Z__qualname__Z
BM_compatibleZPATTERNr � r r r r s/