Viewing File: /opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/fix_execfile.cpython-35.opt-1.pyc



¯ÕYfÆã@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”|d}|jdƒ}|jdƒ}|jdjdjƒ}t|jƒgd|ƒ}ttjtdƒ|gƒ}ttjt	ƒtdƒgƒttjt
ƒtƒgƒg}	|g|	}
|jƒ}d|_t
d	dƒ}|
tƒ|tƒ|g}
ttd
ƒ|
dƒ}|g}|dk	rP|jtƒ|jƒgƒ|dk	rx|jtƒ|jƒgƒttdƒ|d
|jƒS)NÚfilenameÚglobalsÚlocalséZrparenÚopenÚreadú z'exec'ÚcompileÚÚexecÚprefixéÿÿÿÿr)ÚgetZchildrenZcloner
r	rZpowerrZtrailerrrrrrrrÚextend)ÚselfZnodeZresultsrrrZexecfile_parenZ	open_argsZ	open_callrZ	open_exprZfilename_argZexec_strZcompile_argsZcompile_callÚargs©rú?/opt/alt/python35/lib64/python3.5/lib2to3/fixes/fix_execfile.pyÚ	transforms(
!
		zFixExecfile.transformN)Ú__name__Ú
__module__Ú__qualname__Z
BM_compatibleZPATTERNr rrrrr
sr
N)Ú__doc__rrZ
fixer_utilrrrrrrr	r
rrZBaseFixr
rrrrÚ<module>sF
Back to Directory File Manager