//usr/lib64/lib64//lib64//python2.7/ó
ÛœSec @ s{ d Z d d l m Z d d l m Z d d l m Z d d l m Z m Z m Z m
Z
m Z d e j f d „ ƒ YZ
d S( s[ 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.
i ( t pytree( t token( t
fixer_base( t Namet Callt Attrt ArgListt is_tuplet FixRaisec B s e Z e Z d Z d „ Z RS( sB
raise_stmt< 'raise' exc=any [',' val=any [',' tb=any]] >
c
C s | j } | d j ƒ } | j t j k rE d } | j | | ƒ d St | ƒ rŠ x* t | ƒ r} | j d j d j ƒ } qT Wd | _ n d | k rÇ t j
| j t d ƒ | g ƒ } | j | _ | S| d j ƒ } t | ƒ rg | j d d !D] } | j ƒ ^ qô } n d | _ | g } d
| k rÖ| d
j ƒ }
d |
_ | } | j t j
k sm| j d k rt | | ƒ } n t | t d ƒ ƒ t |
g ƒ g } t j
| j t d ƒ g | ƒ } | j | _ | St j
| j t d ƒ t | | ƒ g d
| j ƒSd S( Nt excs+ Python 3 does not support string exceptionsi i u t valu raiseiÿÿÿÿu t tbu Noneu with_tracebackt prefix( t symst clonet typeR t STRINGt cannot_convertR t childrenR R t Nodet
raise_stmtR t NAMEt valueR R R t simple_stmt(
t selft nodet resultsR
R t msgt newR
t ct argsR t et with_tb( ( s/ /usr/lib64/python2.7/lib2to3/fixes/fix_raise.pyt transform&