o
     JAfÓ  ã                   @   s:   d Z ddlmZ ddlmZmZmZ G dd„ dejƒZdS )z•Fixer for exec.

This converts usages of the exec statement into calls to a built-in
exec() function.

exec code in ns1, ns2 -> exec(code, ns1, ns2)
é   )Ú
fixer_base)ÚCommaÚNameÚCallc                   @   s   e Zd ZdZdZdd„ ZdS )ÚFixExecTzx
    exec_stmt< 'exec' a=any 'in' b=any [',' c=any] >
    |
    exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any >
    c                 C   sŠ   |sJ ‚| j }|d }| d¡}| d¡}| ¡ g}d|d _|d ur-| tƒ | ¡ g¡ |d ur;| tƒ | ¡ g¡ ttdƒ||jdS )NÚaÚbÚcÚ é    Úexec)Úprefix)ÚsymsÚgetZcloner   Úextendr   r   r   )ÚselfZnodeÚresultsr   r   r   r	   Úargs© r   ú-/usr/lib/python3.10/lib2to3/fixes/fix_exec.pyÚ	transform   s   



zFixExec.transformN)Ú__name__Ú
__module__Ú__qualname__ZBM_compatibleZPATTERNr   r   r   r   r   r      s    r   N)	Ú__doc__r
   r   Z
fixer_utilr   r   r   ZBaseFixr   r   r   r   r   Ú<module>   s   	