Your IP : 52.15.71.146
�
c��f� � �R � d Z ddlmZ ddlmZ ddd�Z G d� 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)�unichr�unicodec �, � � e Zd ZdZdZ� fd�Zd� Z� xZS )�
FixUnicodeTzSTRING | 'unicode' | 'unichr'c �v �� t t | � � � ||� � d|j v | _ d S )N�unicode_literals)�superr
�
start_tree�future_featuresr )�self�tree�filename� __class__s ��@/opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_unicode.pyr zFixUnicode.start_tree s9 �� �
�j�$���*�*�4��:�:�:� 2�d�6J� J����� c �� � |j t j k r-|� � � }t |j |_ |S |j t j k r�|j }| j s@|d dv r6d|v r2d� d� |� d� � D � � � � }|d dv r
|dd � }||j k r|S |� � � }||_ |S d S )N� z'"�\z\\c �b � g | ],}|� d d� � � dd� � ��-S )z\uz\\uz\Uz\\U)�replace)�.0�vs r �
<listcomp>z(FixUnicode.transform.<locals>.<listcomp> sF � � "� "� "�� �I�I�e�V�,�,�4�4�U�F�C�C�"� "� "r �uU� )
�typer �NAME�clone�_mapping�value�STRINGr �join�split)r �node�results�new�vals r � transformzFixUnicode.transform s� � ��9��
�"�"��*�*�,�,�C� ���,�C�I��J�
�Y�%�,�
&�
&��*�C��(�
�S��V�u�_�_������j�j� "� "� �Y�Y�u�-�-�"� "� "� � �� �1�v��~�~��!�"�"�g���d�j� � ����*�*�,�,�C��C�I��J� '�
&r )�__name__�
__module__�__qualname__�
BM_compatible�PATTERNr r, �
__classcell__)r s @r r
r
sV �� � � � � ��M�-�G�K� K� K� K� K�� � � � � � r r
N)�__doc__�pgen2r � r r# �BaseFixr
� r r �<module>r8 sy ��� � � � � � � � � � � � � ��%�0�0��� � � � ��#� � � � � r