AlkantarClanX12

Your IP : 18.220.200.197


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_throw.cpython-310.pyc

o

6��f.�@sZdZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZGdd�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@seZdZdZdZdd�ZdS)�FixThrowTz�
    power< any trailer< '.' 'throw' >
           trailer< '(' args=arglist< exc=any ',' val=any [',' tb=any] > ')' >
    >
    |
    power< any trailer< '.' 'throw' > trailer< '(' exc=any ')' > >
    cCs�|j}|d��}|jtjur|�|d�dS|�d�}|dur"dS|��}t|�r7dd�|jdd�D�}nd|_	|g}|d	}d
|vrl|d
��}d|_	t
||�}	t|	td��t
|g�g}
|�t�|j|
��dS|�t
||��dS)N�excz+Python 3 does not support string exceptions�valcSsg|]}|���qS�)�clone)�.0�cr
r
�>/opt/alt/python310/lib64/python3.10/lib2to3/fixes/fix_throw.py�
<listcomp>)sz&FixThrow.transform.<locals>.<listcomp>������args�tb�with_traceback)�symsr�typer�STRINGZcannot_convert�getr	�children�prefixrrrr�replacerZNodeZpower)�selfZnodeZresultsrrrrZ
throw_argsr�eZwith_tbr
r
r�	transforms*

zFixThrow.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr"r
r
r
rr
sr
N)�__doc__rrZpgen2rrZ
fixer_utilrrrrr	ZBaseFixr
r
r
r
r�<module>s