B VL{ÄýÉ{^ã@sFddlmZmZddlmZmZmZmZmZm Z Gdd„dej ƒZ dS)é)ÚpytreeÚ fixer_base)ÚNameÚAttrÚCallÚCommaÚNewlineÚsymscs<eZdZdZdZdZ‡fdd„Z‡fdd„Zdd„Z‡Z S) Ú FixExitfuncTa” ( sys_import=import_name<'import' ('sys' | dotted_as_names< (any ',')* 'sys' (',' any)* > ) > | expr_stmt< power< 'sys' trailer< '.' 'exitfunc' > > '=' func=any > ) cstt|ƒj|ŽdS)N)Úsuperr Ú__init__)ÚselfÚargs)Ú __class__©ú=/opt/alt/python37/lib/python3.7/lib2to3/fixes/fix_exitfunc.pyr szFixExitfunc.__init__cstt|ƒ ||¡d|_dS)N)r r Ú start_treeÚ sys_import)r ZtreeÚfilename)rrrr!szFixExitfunc.start_treec Cs&d|kr |jdkr|d|_dS|d ¡}d|_t tjttdƒtdƒƒ¡}t ||g|jƒ}|  |¡|jdkr‚|  |d¡dS|jj d}|j tjkr¸| tƒ¡| tddƒ¡nj|jj}|j  |j¡}|j} t tjtd ƒtddƒg¡} t tj| g¡} | |dtƒ¡| |d | ¡dS) NrÚfuncÚÚatexitÚregisterzKCan't find sys import; Please add an atexit import at the top of your file.éú Úimporté)rZcloneÚprefixrZNoder ZpowerrrrÚreplaceZwarningZchildrenÚtypeZdotted_as_namesZ append_childrÚparentÚindexZ import_nameZ simple_stmtZ insert_childr) r ZnodeÚresultsrrZcallÚnamesZcontaining_stmtZpositionZstmt_containerZ new_importÚnewrrrÚ transform%s2         zFixExitfunc.transform) Ú__name__Ú __module__Ú __qualname__Zkeep_line_orderZ BM_compatibleZPATTERNr rr%Ú __classcell__rr)rrr s   r N) Zlib2to3rrZlib2to3.fixer_utilrrrrrr ZBaseFixr rrrrÚs