Ë
    #´˜j  ã                   ó|   — d Z ddlmZ ddlmZ ddlmZ ddlmZmZm	Z	m
Z
mZmZ d„ Z G d„ dej                  «      Zy	)
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
                  dk(  sŒA|| |dz      f–— ŒN y ­w)Né    Úexceptr   )Ú	enumerateÚtyper   Úexcept_clauseÚchildrenÚvalue)ÚnodesÚiÚns      ú*lib/python3.12/lib2to3/fixes/fix_except.pyÚfind_exceptsr      sS   è ø€ Ü˜%Ö ‰ˆˆ1Ø�6‰6”T×'Ñ'Ó'Ø�z‰z˜!‰}×"Ñ" hÓ.Ø˜%  !¡™*�oÓ%ñ !ùs   ‚/A²AÁAc                   ó   — e Zd ZdZdZd„ Zy)Ú	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 �cg c]  }|j                  «       ‘Œ }}|d   D �cg c]  }|j                  «       ‘Œ }}t        |«      D �]�  \  }}	t        |j                  «      dk(  sŒ |j                  dd \  }
}}|j                  t        dd¬«      «       |j                  t        j                  k7  �r	t        | j                  «       d¬«      }|j                  «       }d|_        |j                  |«       |j                  «       }|	j                  }t        |«      D ]!  \  }}t        |t        j                  «      sŒ! n t!        |«      st#        |«      r t%        |t'        |t        d	«      «      «      }nt%        ||«      }t)        |d  «      D ]  }|	j+                  d
|«       Œ |	j+                  ||«       �Œv|j                  dk(  s�Œ‡d|_        �Œ� |j                  d d D �cg c]  }|j                  «       ‘Œ c}|z   |z   }t        j                  |j                  |«      S c c}w c c}w c c}w )NÚtailÚcleanupé   é   ÚasÚ )ÚprefixÚ Úargsr   é   )r   Úcloner   Úlenr   Úreplacer   r   r   ÚNAMEÚnew_namer"   r   Ú
isinstancer   ÚNoder	   r
   r   r   ÚreversedÚinsert_child)ÚselfÚnodeÚresultsr   r   r   ÚchÚtry_cleanupr   Úe_suiteÚEÚcommaÚNÚnew_NÚtargetÚsuite_stmtsr   ÚstmtÚassignÚchildÚcr   s                         r   Ú	transformzFixExcept.transform/   sï  € Ø�y‰yˆà#*¨6¢?Ó3¡?˜a�—‘•	 ?ˆÐ3à,3°IÒ,>Ó?Ñ,> b�r—x‘x•zÐ,>ˆÐ?Ü&2°;×&?Ñ"ˆM˜7Ü�=×)Ñ)Ó*¨aÓ/Ø -× 6Ñ 6°q¸Ð ;‘��E˜1Ø—‘œd 4°Ô4Ô5à—6‘6œUŸZ™ZÓ'ä  §¡£¸Ô=�EØŸW™W›Y�FØ$&�F”MØ—I‘I˜eÔ$Ø!ŸK™K›M�Eð #*×"2Ñ"2�KÜ#,¨[Ö#9™˜˜4Ü% d¬F¯K©KÕ8Ù!ð $:ô   ”{¤g¨a¤jÜ!'¨´°U¼DÀ»LÓ0IÓ!J™ä!'¨°Ó!6˜ô "*¨+°b°q¨/Ö!:˜Ø×,Ñ,¨Q°Õ6ð ";à×(Ñ(¨¨FÖ3Ø—X‘X ”^ð  #�A–HðI '@ðN (,§}¡}°R°aÑ'8Ó9Ñ'8 !�A—G‘G•IÐ'8Ñ9¸KÑGÈ$ÑNˆÜ�{‰{˜4Ÿ9™9 hÓ/Ð/ùòW 4ùâ?ùòP :s   ”H:´H?Ç:IN)Ú__name__Ú
__module__Ú__qualname__ÚBM_compatibleÚPATTERNr?   © ó    r   r   r   $   s   „ Ø€Mð€Gó.0rF   r   N)Ú__doc__r#   r   Úpgen2r   r   Ú
fixer_utilr   r   r   r	   r
   r   r   ÚBaseFixr   rE   rF   r   Ú<module>rK      s2   ðñõ0 Ý Ý ß D× Dò&ô90�
×"Ñ"õ 90rF   