JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr i fn @s{dZddlmZddlmZddlmZddlmZmZm Z m Z m Z Gdddej 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)NameCallAttrArgListis_tuplec@s(eZdZdZdZddZdS)FixRaiseTzB raise_stmt< 'raise' exc=any [',' val=any [',' tb=any]] > c Cs|j}|dj}|jtjkrEd}|j||dSt|rx*t|r}|jdjdj}qTWd|_nd|krt j |j t d|g}|j|_|S|dj}t|rdd |jddD}nd |_|g}d |kr|d j} d | _|} |jtj ksd|jd krvt||} nt| t d t| gg} t j |jt dg| }|j|_|St j |j t dt||gd|jSdS)Nexcz+Python 3 does not support string exceptions valraisecSsg|]}|jqS)clone).0crrDs z&FixRaise.transform..tbNonewith_tracebackprefix)symsrtyperSTRINGZcannot_convertr ZchildrenrrZNodeZ raise_stmtrNAMEvaluerrrZ simple_stmt) selfZnodeZresultsrr msgnewrargsreZwith_tbrrr transform&s@    !  #    !%"  zFixRaise.transformN)__name__ __module__ __qualname__Z BM_compatibleZPATTERNr'rrrrr s r N)__doc__rrZpgen2rrZ fixer_utilrrrrr ZBaseFixr rrrrs (