Your IP : 3.17.78.184
o
6��f. � @ sX d dl mZ d dlmZ d dl mZ d dlmZmZmZm Z m
Z
G dd� dej�ZdS )� )�pytree)�token)�
fixer_base)�Name�Call�ArgList�Attr�is_tuplec @ s e Zd ZdZdZdd� ZdS )�FixThrowTz�
power< any trailer< '.' 'throw' >
trailer< '(' args=arglist< exc=any ',' val=any [',' tb=any] > ')' >
>
|
power< any trailer< '.' 'throw' > trailer< '(' exc=any ')' > >
c C s� | j }|d �� }|jtju r| �|d� d S |�d�}|d u r"d S |�� }t|�r7dd� |jdd� D �}nd|_ |g}|d }d
|v rl|d
�� }d|_ t
||�} t| td��t
|g�g }
|�t�|j|
�� d S |�t
||�� d S )N�excz+Python 3 does not support string exceptions�valc S s g | ]}|� � �qS � )�clone)�.0�cr
r
�>/opt/alt/python310/lib64/python3.10/lib2to3/fixes/fix_throw.py�
<listcomp>) s z&FixThrow.transform.<locals>.<listcomp>� ���� �args�tb�with_traceback)�symsr �typer �STRINGZcannot_convert�getr �children�prefixr r r r �replacer ZNodeZpower)�selfZnodeZresultsr r r r Z
throw_argsr �eZwith_tbr
r
r � transform s*
zFixThrow.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr"