File: //usr/lib/python3.7/lib2to3/fixes/__pycache__/fix_throw.cpython-37.pyc
B
µ5»a. ã @ 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
ú-/usr/lib/python3.7/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)ÚselfZnodeZresultsr r r r Z
throw_argsr ÚeZwith_tbr
r
r Ú transform s*
zFixThrow.transformN)Ú__name__Ú
__module__Ú__qualname__Z
BM_compatibleZPATTERNr! r
r
r
r r
s r
N)Ú__doc__r r Zpgen2r r Z
fixer_utilr r r r r ZBaseFixr
r
r
r
r Ú<module> s