|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/lib2to3/fixes/__pycache__/ |
U
?��g. � @ sZ d Z ddlmZ ddlmZ ddlmZ ddlmZmZm Z m
Z
mZ G dd� dej�Z
dS ) z�Fixer for generator.throw(E, V, T).
g.throw(E) -> g.throw(E)
g.throw(E, V) -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))
g.throw("foo"[, V[, T]]) will warn about string exceptions.� )�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 �� }|jtjkr.| �|d� d S |�d�}|d krDd S |�� }t|�rndd� |jdd� D �}nd|_ |g}|d }d
|kr�|d
�� }d|_ t
||�} t| td��t
|g�g }
|�t�|j|
�� n|�t
||�� d S )N�excz+Python 3 does not support string exceptions�valc S s g | ]}|� � �qS � )�clone)�.0�cr
r
�6/opt/cppython/lib/python3.8/lib2to3/fixes/fix_throw.py�
<listcomp>) s z&FixThrow.transform.<locals>.<listcomp>� ���� �args�tb�with_traceback)�symsr �typer �STRINGZcannot_convert�getr Zchildren�prefixr r r r �replacer ZNodeZpower)�selfZnode�resultsr r r r Z
throw_argsr �eZwith_tbr
r
r � transform s*
zFixThrow.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr"