ó
è¾bc           @   sg   d  Z  d d l m Z d d l m Z m Z m Z m Z m Z m	 Z	 m
 Z
 d e j f d „  ƒ  YZ d S(   s˜   Fixer for sys.exc_{type, value, traceback}

sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
i   (   t
   fixer_base(   t   Attrt   Callt   Namet   Numbert	   Subscriptt   Nodet   symst	   FixSysExcc           B   sC   e  Z d  d d g Z e Z d d j d „  e Dƒ ƒ Z d „  Z RS(   u   exc_typeu	   exc_valueu   exc_tracebacksN   
              power< 'sys' trailer< dot='.' attribute=(%s) > >
              t   |c         c   s   |  ] } d  | Vq d S(   s   '%s'N(    (   t   .0t   e(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_sys_exc.pys	   <genexpr>   s    c         C   s    | d d } t  |  j j | j ƒ ƒ } t t d ƒ d | j ƒ} t t d ƒ | ƒ } | d j | d j d _ | j	 t
 | ƒ ƒ t t j | d | j ƒS(   Nt	   attributei    u   exc_infot   prefixu   syst   doti   (   R   t   exc_infot   indext   valueR   R   R   R   t   childrent   appendR   R   R   t   power(   t   selft   nodet   resultst   sys_attrR   t   callt   attr(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_sys_exc.pyt	   transform   s    (   t   __name__t
   __module__R   t   Truet   BM_compatiblet   joint   PATTERNR   (    (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_sys_exc.pyR      s   N(   t   __doc__t    R    t
   fixer_utilR   R   R   R   R   R   R   t   BaseFixR   (    (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_sys_exc.pyt   <module>   s   4