Hacked By AnonymousFox
��Yf� � @ sy d Z d d l m Z d d l m Z m Z d d d i i Z i Z d d � Z d d
� Z Gd d � d e j
� Z d
S)z?Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
� )�
fixer_base)�Name�
attr_chain�sysZmaxint�maxsizec C s d d j t t | � � d S)N�(�|�))�join�map�repr)Zmembers� r
�>/opt/alt/python35/lib64/python3.5/lib2to3/fixes/fix_renames.py�
alternates s r c c s{ xt t t j � � D]` \ } } xQ t | j � � D]= \ } } | t | | f <d | | | f Vd | | f Vq2 Wq Wd S)Nz�
import_from< 'from' module_name=%r 'import'
( attr_name=%r | import_as_name< attr_name=%r 'as' any >) >
z^
power< module_name=%r trailer< '.' attr_name=%r > any* >
)�list�MAPPING�items�LOOKUP)�module�replaceZold_attr�new_attrr
r
r �
build_pattern s
r c sL e Z d Z d Z d j e � � Z d Z � f d d � Z d d � Z � S)�
FixRenamesTr Zprec sX t t | � j � � | � } | rT t � f d d � t | d � D� � rP d S| Sd S)Nc 3 s | ] } � | � Vq d S)Nr
)�.0�obj)�matchr
r � <genexpr>5 s z#FixRenames.match.<locals>.<genexpr>�parentF)�superr r �anyr )�self�node�results)� __class__)r r r 1 s (zFixRenames.matchc C s` | j d � } | j d � } | r\ | r\ t | j | j f } | j t | d | j �� d S)NZmodule_name� attr_name�prefix)�getr �valuer r r% )r r! r"