o bc@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,|sJ|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}|dur~|t|g|dur|t|gtt d ||jdS)Nfilenameglobalslocalsz"rb" )rparenopenreadz'exec'compileexec)prefix)getchildrencloner rr r r powerrtrailerrrrrrextend)selfnoderesultsrrrexecfile_paren open_args open_callr open_expr filename_argexec_str compile_args compile_callargsr,1/usr/lib/python3.10/lib2to3/fixes/fix_execfile.py transforms0    zFixExecfile.transformN)__name__ __module__ __qualname__ BM_compatiblePATTERNr.r,r,r,r-r s r N)__doc__rr fixer_utilrrrrrrr r r r BaseFixr r,r,r,r-s 0