Ñò
$8Zc           @   su   d  Z  d d k l Z d d k l Z l Z h h d d 6d 6Z h  Z d „  Z d „  Z	 d	 e i
 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 i  t t |  ƒ ƒ d S(   Nt   (t   |t   )(   t   joint   mapt   repr(   t   members(    (    s/   /usr/lib/python2.6/lib2to3/fixes/fix_renames.pyt
   alternates   s    c          c   so   xh t  i ƒ  D]Z \ }  } xK | i ƒ  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.6/lib2to3/fixes/fix_renames.pyt   build_pattern   s      
t
   FixRenamesc           B   s2   e  Z d  i e ƒ  ƒ Z d Z d „  Z d „  Z RS(   R   t   prec            sY   t  t |  ƒ i ‰  ˆ  | ƒ } | o0 t ‡  f d †  t | d ƒ Dƒ ƒ o t S| St S(   Nc         3   s   x |  ] } ˆ  | ƒ Vq Wd  S(   N(    (   t   .0t   obj(   t   match(    s/   /usr/lib/python2.6/lib2to3/fixes/fix_renames.pys	   <genexpr>4   s   	 t   parent(   t   superR   R   t   anyR   t   False(   t   selft   nodet   results(    (   R   s/   /usr/lib/python2.6/lib2to3/fixes/fix_renames.pyR   0   s    &c         C   sl   | i  d ƒ } | i  d ƒ } | oC | o< t t | i | i f ƒ } | i t | d | i ƒƒ 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.6/lib2to3/fixes/fix_renames.pyt	   transform=   s
    (   t   __name__t
   __module__R	   R   t   PATTERNt   orderR   R)   (    (    (    s/   /usr/lib/python2.6/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.6/lib2to3/fixes/fix_renames.pyt   <module>   s   		