U if@sVdZddlmZddlmZmZdddiiZiZddZd d Z Gd d d ej Z d S)z?Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize ) fixer_base)Name attr_chainsysZmaxintmaxsizecCsddtt|dS)N(|))joinmaprepr)membersr>/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_renames.py alternatessrccsZttD]H\}}t|D]2\}}|t||f<d|||fVd||fVq q dS)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* > )listMAPPINGitemsLOOKUP)modulereplaceZold_attrnew_attrrrr build_patterns rcs8eZdZdZdeZdZfddZddZ Z S) FixRenamesTrZprecs@tt|j|}|r5sz#FixRenames.match..parentF)superrranyr)selfnoderesults __class__rrr1s zFixRenames.matchcCsD|d}|d}|r@|r@t|j|jf}|t||jddS)NZ module_name attr_name)prefix)getrvaluerrr()r"r#r$Zmod_namer'rrrr transform>s   zFixRenames.transform) __name__ __module__ __qualname__Z BM_compatibler rZPATTERNorderrr+ __classcell__rrr%rr*s   rN) __doc__rZ fixer_utilrrrrrrZBaseFixrrrrrs