ó
è¾bc           @   su   d  Z  d d l m Z d d l m Z m Z i i d d 6d 6Z i  Z d „  Z d „  Z	 d	 e j
 f d
 „  ƒ  YZ d S(   s?   Fix incompatible renames

Fixes:
  * sys.maxint -> sys.maxsize
i   (   t
   fixer_base(   t   Namet
   attr_chaint   maxsizet   maxintt   sysc         C   s   d d j  t t |  ƒ ƒ d S(   Nt   (t   |t   )(   t   joint   mapt   repr(   t   members(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_renames.pyt
   alternates   s    c          c   so   xh t  j ƒ  D]Z \ }  } xK | j ƒ  D]= \ } } | t |  | f <d |  | | f Vd |  | f Vq& Wq Wd  S(   Ns£   
                  import_from< 'from' module_name=%r 'import'
                      ( attr_name=%r | import_as_name< attr_name=%r 'as' any >) >
                  s^   
                  power< module_name=%r trailer< '.' attr_name=%r > any* >
                  (   t   MAPPINGt   itemst   LOOKUP(   t   modulet   replacet   old_attrt   new_attr(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_renames.pyt   build_pattern   s
    
t
   FixRenamesc           B   s8   e  Z e Z d  j e ƒ  ƒ Z d Z d „  Z d „  Z	 RS(   R   t   prec            sU   t  t |  ƒ j ‰  ˆ  | ƒ } | rQ t ‡  f d †  t | d ƒ Dƒ ƒ rM t S| St S(   Nc         3   s   |  ] } ˆ  | ƒ Vq d  S(   N(    (   t   .0t   obj(   t   match(    s/   /usr/lib/python2.7/lib2to3/fixes/fix_renames.pys	   <genexpr>5   s    t   parent(   t   superR   R   t   anyR   t   False(   t   selft   nodet   results(    (   R   s/   /usr/lib/python2.7/lib2to3/fixes/fix_renames.pyR   1   s    %c         C   si   | j  d ƒ } | j  d ƒ } | re | re t t | j | j f ƒ } | j t | d | j ƒƒ n  d  S(   Nt   module_namet	   attr_namet   prefix(   t   gett   unicodeR   t   valueR   R   R$   (   R   R    R!   t   mod_nameR#   R   (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_renames.pyt	   transform>   s
    (
   t   __name__t
   __module__t   Truet   BM_compatibleR	   R   t   PATTERNt   orderR   R)   (    (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_renames.pyR   *   s
   	N(   t   __doc__t    R    t
   fixer_utilR   R   R   R   R   R   t   BaseFixR   (    (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_renames.pyt   <module>   s   		