0x1949 Team - FAZEMRX - MANAGER
Edit File: fix_except.cpython-310.pyc
o ��bc � @ sf d Z ddlmZ ddlmZ ddlmZ ddlmZmZm Z m Z mZmZ dd� Z G dd � d ej�Zd S )a� Fixer for except statements with named exceptions. The following cases will be converted: - "except E, T:" where T is a name: except E as T: - "except E, T:" where T is not a name, tuple or list: except E as t: T = t This is done because the target of an "except" clause must be a name. - "except E, T:" where T is a tuple or list literal: except E as t: T = t.args � )�pytree)�token)� fixer_base)�Assign�Attr�Name�is_tuple�is_list�symsc c sF � t | �D ]\}}|jtjkr |jd jdkr || |d fV qd S )N� �exceptr )� enumerate�typer � except_clause�children�value)�nodes�i�n� r �//usr/lib/python3.10/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 sr | j }dd� |d D �}dd� |d D �}t|�D ]�\}}t|j�dkr�|jdd� \}} } | �tdd d �� | jtjkr�t| � � d d �}| � � }d|_| �|� |� � }|j} t| �D ]\}}t |tj�rh nq\t| �sqt| �r|t|t|td���}nt||�}t| d |� �D ]}|�d |� q�|�||� q| jdkr�d | _qdd� |jd d� D �| | }t�|j|�S )Nc S � g | ]}|� � �qS r ��clone)�.0r r r r � <listcomp>2 � z'FixExcept.transform.<locals>.<listcomp>�tailc S r r r )r �chr r r r 4 r �cleanup� � �as� )�prefix� �argsr c S r r r )r �cr r r r \ r � )r r �lenr �replacer r r �NAME�new_namer r&