Spade
Mini Shell
| Directory:~$ /proc/self/root/lib64/python3.6/lib2to3/fixes/__pycache__/ |
| [Home] [System Details] [Kill Me] |
3
\�@sVdZddlmZddlmZmZmZmZmZm Z m
Z
mZmZm
Z
Gdd�dej�ZdS)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@seZdZdZdZdd�ZdS)�FixExecfileTz�
power< 'execfile' trailer< '(' arglist<
filename=any [',' globals=any [',' locals=any ] ] >
')' > >
|
power< 'execfile' trailer< '(' filename=any
')' > >
cCs0|st�|d}|jd�}|jd�}|jdjdj�}t|j�t�tdd�g|d�}ttj t
d�|g�}ttjt�t
d �g�ttjt
�t�g�g} |g| }
|j�}d|_td
d�}|
t�|t�|g}
tt
d�|
d�}|g}|dk �r�|jt�|j�g�|dk �r|jt�|j�g�tt
d
�||jd�S)N�filename�globals�locals�z"rb"�
)Zrparen�open�readz'exec'�compile��exec)�prefix���r)�AssertionError�getZchildrenZcloner
rrr rZpowerrZtrailerrrrrr�extend)�selfZnode�resultsrrrZexecfile_parenZ open_argsZ open_callrZ open_exprZfilename_argZexec_strZcompile_argsZcompile_call�args�r
�$/usr/lib64/python3.6/fix_execfile.py� transforms,
zFixExecfile.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr"r r r
r!r
sr
N)�__doc__rrZ
fixer_utilrrrrrrr r
rrZBaseFixr
r r r r!�<module>s0