AlkantarClanX12
Current Path : /opt/alt/python311/lib64/python3.11/lib2to3/fixes/__pycache__/ |
Current File : //opt/alt/python311/lib64/python3.11/lib2to3/fixes/__pycache__/fix_throw.cpython-311.pyc |
� c��f. � �p � d Z ddlmZ ddlmZ ddlmZ ddlmZmZm Z m Z mZ G d� dej � � Z dS ) z�Fixer for generator.throw(E, V, T). g.throw(E) -> g.throw(E) g.throw(E, V) -> g.throw(E(V)) g.throw(E, V, T) -> g.throw(E(V).with_traceback(T)) g.throw("foo"[, V[, T]]) will warn about string exceptions.� )�pytree)�token)� fixer_base)�Name�Call�ArgList�Attr�is_tuplec � � e Zd ZdZdZd� ZdS )�FixThrowTz� power< any trailer< '.' 'throw' > trailer< '(' args=arglist< exc=any ',' val=any [',' tb=any] > ')' > > | power< any trailer< '.' 'throw' > trailer< '(' exc=any ')' > > c �� � | j }|d � � � }|j t j u r| � |d� � d S |� d� � }|�d S |� � � }t |� � rd� |j dd� D � � }n d|_ |g}|d }d |v r�|d � � � }d|_ t ||� � } t | t d � � � � t |g� � gz } |� t j |j | � � � � d S |� t ||� � � � d S )N�excz+Python 3 does not support string exceptions�valc �6 � g | ]}|� � � ��S � )�clone)�.0�cs �>/opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_throw.py� <listcomp>z&FixThrow.transform.<locals>.<listcomp>) s � �:�:�:�!�A�G�G�I�I�:�:�:� � ���� �args�tb�with_traceback)�symsr �typer �STRING�cannot_convert�getr �children�prefixr r r r �replacer �Node�power)�self�node�resultsr r r r � throw_argsr �e�with_tbs r � transformzFixThrow.transform s[ � ��y���e�n�"�"�$�$���8�u�|�#�#�����&S�T�T�T��F� �k�k�%� � ���;��F��i�i�k�k���C�=�=� �:�:�s�|�A�b�D�'9�:�:�:�D�D��C�J��5�D��V�_� ��7�?�?����$�$�&�&�B��B�I��S�$���A��1�d�#3�4�4�5�5��"�����G�G����v�{�4�:�w�?�?�@�@�@�@�@����t�C����/�/�/�/�/r N)�__name__� __module__�__qualname__� BM_compatible�PATTERNr. r r r r r s/ � � � � � ��M��G�0� 0� 0� 0� 0r r N)�__doc__r r �pgen2r r � fixer_utilr r r r r �BaseFixr r r r �<module>r8 s� ��?� ?� � � � � � � � � � � � � � � � � � � <� <� <� <� <� <� <� <� <� <� <� <� <� <�(0� (0� (0� (0� (0�z�!� (0� (0� (0� (0� (0r