U iÛfèã@s<dZddlmZddlmZdddœZGdd„dejƒZd S) z¢Fixer for unicode. * Changes unicode to str and unichr to chr. * If "...\u..." is not unicode literal change it into "...\\u...". * Change u"..." into "...". é)Útoken)Ú fixer_baseÚchrÚstr)ZunichrZunicodecs,eZdZdZdZ‡fdd„Zdd„Z‡ZS)Ú FixUnicodeTzSTRING | 'unicode' | 'unichr'cs"tt|ƒ ||¡d|jk|_dS)NÚunicode_literals)ÚsuperrÚ start_treeZfuture_featuresr)ÚselfZtreeÚfilename©Ú __class__©ú>/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_unicode.pyr szFixUnicode.start_treecCs¦|jtjkr$| ¡}t|j|_|S|jtjkr¢|j}|jsj|ddkrjd|krjd dd„|  d¡Dƒ¡}|ddkr‚|dd…}||jkr|S| ¡}||_|SdS) Néz'"ú\z\\cSs g|]}| dd¡ dd¡‘qS)z\uz\\uz\Uz\\U)Úreplace)Ú.0ÚvrrrÚ sÿz(FixUnicode.transform..ZuUé) ÚtyperÚNAMEZcloneÚ_mappingÚvalueÚSTRINGrÚjoinÚsplit)r ZnodeZresultsÚnewÚvalrrrÚ transforms"    þ   zFixUnicode.transform)Ú__name__Ú __module__Ú __qualname__Z BM_compatibleZPATTERNr r Ú __classcell__rrr rrs rN)Ú__doc__Zpgen2rÚrrZBaseFixrrrrrÚs