î j fÆã@sydZddlmZddlmZmZmZmZmZm Z m Z m Z m 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 rS|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)ÚgetZchildrenZcloner r r ZpowerrZtrailerrrrrr rrÚ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 rrrrr s r N)Ú__doc__rrZ fixer_utilrrrrrrr r r r ZBaseFixr rrrrÚsF