Viewing File: /opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/fix_execfile.cpython-35.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 |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ƒ|dk	r„|jtƒ|jƒgƒttdƒ|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/python35/lib64/python3.5/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
Back to Directory File Manager