U
iÛfÓ ã @ s: d Z ddlmZ ddlmZmZmZ G dd„ dejƒZdS )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 Zd ZdZdZdd„ ZdS )ÚFixExecTzx
exec_stmt< 'exec' a=any 'in' b=any [',' c=any] >
|
exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any >
c C sŠ |st ‚| j}|d }| d¡}| d¡}| ¡ g}d|d _|d k rZ| tƒ | ¡ g¡ |d k rv| tƒ | ¡ g¡ ttdƒ||jdS )NÚaÚbÚcÚ é Úexec)Úprefix) ÚAssertionErrorÚsymsÚgetZcloner
Úextendr r r )ÚselfZnodeZresultsr r r r Úargs© r ú;/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_exec.pyÚ transform s
zFixExec.transformN)Ú__name__Ú
__module__Ú__qualname__Z
BM_compatibleZPATTERNr r r r r r s r N) Ú__doc__r
r Z
fixer_utilr r r ZBaseFixr r r r r Ú