Viewing File: /opt/alt/python311/lib64/python3.11/lib2to3/fixes/__pycache__/fix_exitfunc.cpython-311.pyc
f ` d Z ddlmZmZ ddlmZmZmZmZm Z m
Z
G d dej ZdS )z7
Convert use of sys.exitfunc to use the atexit module.
)pytree
fixer_base)NameAttrCallCommaNewlinesymsc : e Zd ZdZdZdZ fdZ fdZd Z xZ S )FixExitfuncTa
(
sys_import=import_name<'import'
('sys'
|
dotted_as_names< (any ',')* 'sys' (',' any)* >
)
>
|
expr_stmt<
power< 'sys' trailer< '.' 'exitfunc' > >
'=' func=any >
)
c B t t | j | d S N)superr __init__)selfargs __class__s A/opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_exitfunc.pyr zFixExitfunc.__init__ s# )k4 )40000 c h t t | || d | _ d S r )r r
start_tree
sys_import)r treefilenamer s r r zFixExitfunc.start_tree! s.
k4 ++D(;;;r c d|v r| j
|d | _ d S |d }d|_ t j t
j t t d t d }t ||g|j }|
| | j | |d d S | j j d }|j
t
j k rF| t! | t dd d S | j j }|j | j }|j } t j t
j t d t dd g }
t j t
j |
g }| |dz t- | |d
z | d S )Nr func atexitregisterzKCan't find sys import; Please add an atexit import at the top of your file. import )r cloneprefixr Noder
powerr r r replacewarningchildrentypedotted_as_namesappend_childr parentindeximport_namesimple_stmtinsert_childr )r noderesultsr r callnamescontaining_stmtpositionstmt_container
new_importnews r transformzFixExitfunc.transform% s 7""&"),"7Fv$$&&;tz#DNND4D4DEE! ! Htfdk22T?"LL ?
@
@
@F (+:---uww'''tHc2233333"o4O&/55doFFH,3NT%5#H~~tHc/B/BC J +d.==C((AwyyAAA((As;;;;;r )
__name__
__module____qualname__keep_line_order
BM_compatiblePATTERNr r r<