U if@sVdZddlmZddlmZmZmZmZmZm Z m Z m Z m Z m Z GdddejZdS)zoFixer for execfile. This converts usages of the execfile function into calls to the built-in exec() function. ) fixer_base) CommaNameCallLParenRParenDotNodeArgListStringsymsc@seZdZdZdZddZdS) FixExecfileTz power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > > | power< 'execfile' trailer< '(' filename=any ')' > > cCs&|d}|d}|d}|jdjd}t|ttddg|d}ttjt d|g}ttj t t d gttj t t gg} |g| } |} d| _td d} | t| t| g} tt d | d }|g}|dk r|t|g|dk r|t|gtt d ||jdS)Nfilenameglobalslocalsz"rb" )Zrparenopenreadz'exec'compileexec)prefix)getZchildrenZcloner rr r r ZpowerrZtrailerrrrrrextend)selfZnodeZresultsrrrZexecfile_parenZ open_argsZ open_callrZ open_exprZ filename_argZexec_strZ compile_argsZ compile_callargsr?/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_execfile.py transforms.     zFixExecfile.transformN)__name__ __module__ __qualname__Z BM_compatibleZPATTERNrrrrrr sr N)__doc__rrZ fixer_utilrrrrrrr r r r ZBaseFixr rrrrs 0