
    daf.                     r    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  G d dej                        Zy)	zFixer 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 Zd ZdZdZd Zy)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                         }|j                  t        j                  u r| j                  |d       y |j                  d      }|y |j                         }t        |      r+|j                  dd D cg c]  }|j                          }}n
d|_	        |g}|d   }d|v ry|d   j                         }	d|	_	        t        ||      }
t        |
t        d	            t        |	g      gz   }|j                  t        j                   |j"                  |             y |j                  t        ||             y c c}w )
Nexcz+Python 3 does not support string exceptionsval    argstbwith_traceback)symsclonetyper   STRINGcannot_convertgetr
   childrenprefixr   r	   r   r   replacer   Nodepower)selfnoderesultsr   r   r   cr   
throw_argsr   ewith_tbs               2/root/Python-3.12.4/Lib/lib2to3/fixes/fix_throw.py	transformzFixThrow.transform   s&   yyen""$88u||#&ST kk% ;iikC='*||Ab'9:!AGGI:D:CJ5DV_
7?$$&BBIS$A1d#345"GGv{{4::w?@tC/ ;s   EN)__name__
__module____qualname__BM_compatiblePATTERNr)        r(   r   r      s    MG0r0   r   N)__doc__r   r   pgen2r   r   
fixer_utilr   r   r   r	   r
   BaseFixr   r/   r0   r(   <module>r5      s-   ?    < <(0z!! (0r0   