Your IP : 18.216.16.236
3
\� �@sFddlmZmZddlmZmZmZmZmZm Z Gdd�dej
�ZdS)�)�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__��2/usr/lib64/python3.6/lib2to3/fixes/fix_exitfunc.pyrszFixExitfunc.__init__cstt|�j||�d|_dS)N)rr
�
start_tree�
sys_import)r
Ztree�filename)rrrr!szFixExitfunc.start_treecCs&d|kr |jdkr|d|_dS|dj�}d|_tjtjttd�td���}t ||g|j�}|j
|�|jdkr�|j|d�dS|jjd}|j
tjkr�|jt��|jtdd��nj|jj}|jj|j�}|j} tjtjtd �tdd�g�}
tjtj|
g�}|j|dt��|j|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_namesZappend_childr�parent�indexZimport_nameZsimple_stmtZinsert_childr)r
ZnodeZresultsrrZcall�namesZcontaining_stmtZpositionZstmt_containerZ
new_import�newrrr� transform%s2
zFixExitfunc.transform)
�__name__�
__module__�__qualname__Zkeep_line_orderZ
BM_compatibleZPATTERNrrr$�
__classcell__rr)rrr
sr
N)Zlib2to3rrZlib2to3.fixer_utilrrrrrr ZBaseFixr
rrrr�<module>s
?>