Your IP : 52.14.66.242


Current Path : /opt/alt/python34/lib64/python3.4/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/lib2to3/fixes/__pycache__/fix_execfile.cpython-34.pyc

�
j f��@sydZddlmZddlmZmZmZmZmZm	Z	m
Z
mZmZm
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@s(eZdZdZdZdd�ZdS)�FixExecfileTz�
    power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > >
    |
    power< 'execfile' trailer< '(' filename=any ')' > >
    cCs�|st�|d}|jd�}|jd�}|jdjdj�}t|j�gd|�}ttjtd�|g�}ttj	t
�td�g�ttj	t�t�g�g}	|g|	}
|j�}d|_
td	d�}|
t�|t�|g}
ttd
�|
d�}|g}|dk	r_|jt�|j�g�n|dk	r�|jt�|j�g�nttd�|d
|j
�S)N�filename�globals�locals�Zrparen�open�read� z'exec'�compile��exec�prefix���r)�AssertionError�getZchildrenZcloner
r	rZpowerrZtrailerrrrrrrr�extend)�selfZnodeZresultsrrrZexecfile_parenZ	open_argsZ	open_callrZ	open_exprZfilename_argZexec_strZcompile_argsZcompile_call�args�r�?/opt/alt/python34/lib64/python3.4/lib2to3/fixes/fix_execfile.py�	transforms*
!
		zFixExecfile.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr!rrrr r
sr
N)�__doc__rrZ
fixer_utilrrrrrrr	r
rrZBaseFixr
rrrr �<module>sF

?>