| Server IP : 121.121.20.254 / Your IP : 216.73.217.84 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Python312/Lib/lib2to3/fixes/__pycache__/ |
Upload File : |
�
���gm
� �| � d Z ddlmZ ddlmZ ddlmZ ddlmZmZm Z m
Z
mZmZ d� Z
G d� dej � Zy )
a� Fixer for except statements with named exceptions.
The following cases will be converted:
- "except E, T:" where T is a name:
except E as T:
- "except E, T:" where T is not a name, tuple or list:
except E as t:
T = t
This is done because the target of an "except" clause must be a
name.
- "except E, T:" where T is a tuple or list literal:
except E as t:
T = t.args
� )�pytree)�token)�
fixer_base)�Assign�Attr�Name�is_tuple�is_list�symsc # � K � t | � D ]L \ }}|j t j k( s�$|j d j
dk( s�A|| |dz f�� �N y �w)N� �exceptr )� enumerate�typer �
except_clause�children�value)�nodes�i�ns �-C:\Python312\\Lib\lib2to3\fixes\fix_except.py�find_exceptsr sS � �� ��%� ���1��6�6�T�'�'�'��z�z�!�}�"�"�h�.��%��!��*�o�%� !�s �/A�A�Ac � � e Zd ZdZdZd� Zy)� FixExceptTa1
try_stmt< 'try' ':' (simple_stmt | suite)
cleanup=(except_clause ':' (simple_stmt | suite))+
tail=(['except' ':' (simple_stmt | suite)]
['else' ':' (simple_stmt | suite)]
['finally' ':' (simple_stmt | suite)]) >
c
� � | j }|d D �cg c] }|j � �� }}|d D �cg c] }|j � �� }}t |� D �]� \ }} t |j � dk( s� |j dd \ }
}}|j t
dd�� � |j t j k7 �r t
| j � d�� }
|j � }d|_ |j |
� |
j � }
| j }t |� D ]! \ }}t |t j � s�! n t! |� st# |� r t% |t'