관리-도구
편집 파일: fix_except.cpython-39.opt-2.pyc
a R�f � @ sb d dl mZ d dlmZ d dl mZ d dlmZmZmZm Z m Z mZ dd� ZG dd� dej �Zd S ) � )�pytree)�token)� fixer_base)�Assign�Attr�Name�is_tuple�is_list�symsc c sD t | �D ]6\}}|jtjkr|jd jdkr|| |d fV qd S )N� �exceptr )� enumerate�typer � except_clause�children�value)Znodes�i�n� r �=/opt/alt/python39/lib64/python3.9/lib2to3/fixes/fix_except.py�find_excepts s r c @ s e Zd ZdZdZdd� 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)]) > c C sx | j }dd� |d D �}dd� |d D �}t|�D �]\}}t|j�dkr2|jdd� \}} } | �tdd d �� | jtjk�r8t| � � d d �}| � � }d|_| �|� |� � }|j} t| �D ]\}}t |tj�r� q�q�t| �s�t| �r�t|t|td���}n t||�}t| d |� �D ]}|�d |� �q|�||� q2| jdkr2d | _q2dd� |jd d� D �| | }t�|j|�S )Nc S s g | ]}|� � �qS r ��clone)�.0r r r r � <listcomp>2 � z'FixExcept.transform.<locals>.<listcomp>�tailc S s g | ]}|� � �qS r r )r Zchr r r r 4 r Zcleanup� � �as� )�prefix� �argsr c S s g | ]}|� � �qS r r )r �cr r r r \ r � )r r �lenr �replacer r r �NAME�new_namer r"