
    ZQd                      l    d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
mZmZmZ  G d dej                  ZdS )zoFixer for execfile.

This converts usages of the execfile function into calls to the built-in
exec() function.
   )
fixer_base)
CommaNameCallLParenRParenDotNodeArgListStringsymsc                       e Zd ZdZdZd ZdS )FixExecfileTz
    power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > >
    |
    power< 'execfile' trailer< '(' filename=any ')' > >
    c                 p   |sJ |d         }|                     d          }|                     d          }|j        d         j        d                                         }t          |                                t	                      t          dd          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	                      |gz   }t          t          d          |d          }|g}|5|                    t	                      |                                g           |5|                    t	                      |                                g           t          t          d          ||j                  S )Nfilenameglobalslocalsz"rb" )rparenopenreadz'exec'compile exec)prefix)getchildrencloner   r   r   r
   r   powerr   trailerr	   r   r   r   r   extend)selfnoderesultsr   r   r   execfile_paren	open_args	open_callr   	open_exprfilename_argexec_strcompile_argscompile_callargss                   1/usr/lib/python3.11/lib2to3/fixes/fix_execfile.py	transformzFixExecfile.transform   s   :&++i((X&& r*3B7==??X^^--uwwvs8K8KL#13 3 3	d6llI%>??	T\CEE4<<#899T\FHHfhh#788:K$&	  ~~''!(C(( EGG\577H#MMDOO\2>>~KK'--//2333KK&,,..1222DLL$t{;;;;    N)__name__
__module____qualname__BM_compatiblePATTERNr0    r1   r/   r   r      s/        MG< < < < <r1   r   N)__doc__r   r   
fixer_utilr   r   r   r   r   r	   r
   r   r   r   BaseFixr   r7   r1   r/   <module>r;      s          1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1&< &< &< &< &<*$ &< &< &< &< &<r1   