๐ File Manager By @h0rn3t_sp1d3r
๐ Change Directory:
Go
/
/
opt
/
alt
/
python37
/
lib64
/
python3.7
/
lib2to3
/
fixes
/
__pycache__
/
[ HOME ]
โฌ ๏ธ [ PARENT DIR ]
๐ค Upload
B ๏ฟฝ fn ๏ฟฝ @ sZ d Z ddlmZ ddlmZ ddlmZ ddlmZmZm Z m Z mZ G dd๏ฟฝ dej๏ฟฝZ dS ) a[ Fixer for 'raise E, V, T' raise -> raise raise E -> raise E raise E, V -> raise E(V) raise E, V, T -> raise E(V).with_traceback(T) raise E, None, T -> raise E.with_traceback(T) raise (((E, E'), E''), E'''), V -> raise E(V) raise "foo", V, T -> warns about string exceptions CAVEATS: 1) "raise E, V" will be incorrectly translated if V is an exception instance. The correct Python 3 idiom is raise E from V but since we can't detect instance-hood by syntax alone and since any client code would have to be changed as well, we don't automate this. ๏ฟฝ )๏ฟฝpytree)๏ฟฝtoken)๏ฟฝ fixer_base)๏ฟฝName๏ฟฝCall๏ฟฝAttr๏ฟฝArgList๏ฟฝis_tuplec @ s e Zd ZdZdZdd๏ฟฝ ZdS )๏ฟฝFixRaiseTzB raise_stmt< 'raise' exc=any [',' val=any [',' tb=any]] > c C sl | j }|d ๏ฟฝ๏ฟฝ }|jtjkr2d}| ๏ฟฝ||๏ฟฝ d S t|๏ฟฝrbx t|๏ฟฝrZ|jd jd ๏ฟฝ๏ฟฝ }q<W d|_d|kr๏ฟฝt ๏ฟฝ |jtd๏ฟฝ|g๏ฟฝ}|j|_|S |d ๏ฟฝ๏ฟฝ }t|๏ฟฝr๏ฟฝdd ๏ฟฝ |jdd ๏ฟฝ D ๏ฟฝ}nd|_|g}d|k๏ฟฝrF|d ๏ฟฝ๏ฟฝ } d| _|} |jtj ks๏ฟฝ|jd k๏ฟฝrt||๏ฟฝ} t| td๏ฟฝ๏ฟฝt| g๏ฟฝg }t ๏ฟฝ |jtd๏ฟฝg| ๏ฟฝ}|j|_|S t j |jtd๏ฟฝt||๏ฟฝg|jd๏ฟฝS d S )N๏ฟฝexcz+Python 3 does not support string exceptions๏ฟฝ ๏ฟฝ ๏ฟฝ ๏ฟฝval๏ฟฝraisec S s g | ]}|๏ฟฝ ๏ฟฝ ๏ฟฝqS ๏ฟฝ )๏ฟฝclone)๏ฟฝ.0๏ฟฝcr r ๏ฟฝ</opt/alt/python37/lib64/python3.7/lib2to3/fixes/fix_raise.py๏ฟฝ <listcomp>D s z&FixRaise.transform.<locals>.<listcomp>๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ ๏ฟฝtb๏ฟฝNone๏ฟฝwith_traceback)๏ฟฝprefix)๏ฟฝsymsr ๏ฟฝtyper ๏ฟฝSTRINGZcannot_convertr Zchildrenr r ZNodeZ raise_stmtr ๏ฟฝNAME๏ฟฝvaluer r r Zsimple_stmt)๏ฟฝselfZnodeZresultsr r ๏ฟฝmsg๏ฟฝnewr ๏ฟฝargsr ๏ฟฝeZwith_tbr r r ๏ฟฝ transform&