AlkantarClanX12

Your IP : 18.221.59.121


Current Path : /opt/alt/python310/lib64/python3.10/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/lib2to3/fixes/__pycache__/fix_except.cpython-310.opt-2.pyc

o

6��f
�@sd	ddlmZddlmZddlmZddlmZmZmZm	Z	m
Z
mZdd�ZGdd�dej
�Zd	S)
�)�pytree)�token)�
fixer_base)�Assign�Attr�Name�is_tuple�is_list�symsccsF�t|�D]\}}|jtjkr |jdjdkr |||dfVqdS)N��exceptr)�	enumerate�typer
�
except_clause�children�value)Znodes�i�n�r�?/opt/alt/python310/lib64/python3.10/lib2to3/fixes/fix_except.py�find_exceptss���rc@seZdZdZdZdd�ZdS)�	FixExceptTa1
    try_stmt< 'try' ':' (simple_stmt | suite)
                  cleanup=(except_clause ':' (simple_stmt | suite))+
                  tail=(['except' ':' (simple_stmt | suite)]
                        ['else' ':' (simple_stmt | suite)]
                        ['finally' ':' (simple_stmt | suite)]) >
    cCsr|j}dd�|dD�}dd�|dD�}t|�D]�\}}t|j�dkr�|jdd�\}}	}
|	�tdd	d
��|
jtjkr�t|�	�d	d
�}|
�
�}d|_|
�|�|�
�}|j}
t|
�D]\}}t
|tj�rhnq\t|
�sqt|
�r|t|t|td���}nt||�}t|
d|��D]}|�d
|�q�|�||�q|
jdkr�d	|
_qdd�|jdd�D�||}t�|j|�S)NcS�g|]}|���qSr��clone)�.0rrrr�
<listcomp>2�z'FixExcept.transform.<locals>.<listcomp>�tailcSrrr)rZchrrrr4rZcleanup���as� )�prefix��argsrcSrrr)r�crrrr\r�)r
r�lenr�replacerrr�NAME�new_namerr#r
�
isinstancerZNoderr	rr�reversedZinsert_child)�selfZnodeZresultsr
rZtry_cleanuprZe_suite�EZcomma�NZnew_N�targetZsuite_stmtsrZstmtZassign�childrrrr�	transform/s:
�

� zFixExcept.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr3rrrrr$srN)r$rZpgen2rrZ
fixer_utilrrrrr	r
rZBaseFixrrrrr�<module>s