a ZÚß^Hã@s2dZddlmZddlmZGdd„dejƒZdS)a,Fixer that cleans up a tuple argument to isinstance after the tokens in it were fixed. This is mainly used to remove double occurrences of tokens as a leftover of the long -> int / unicode -> str conversion. eg. isinstance(x, (int, long)) -> isinstance(x, (int, int)) -> isinstance(x, int) é)Ú fixer_base)Útokenc@s eZdZdZdZdZdd„ZdS)Ú FixIsinstanceTz˜ power< 'isinstance' trailer< '(' arglist< any ',' atom< '(' args=testlist_gexp< any+ > ')' > > ')' > > éc Csötƒ}|d}|j}g}t|ƒ}|D]p\}} | jtjkrr| j|vrr|t|ƒdkr”||djtjkr”t |ƒq$q$|  | ¡| jtjkr$|  | j¡q$|r°|djtjkr°|d=t|ƒdkrÞ|j } | j |d_ |  |d¡n||dd…<| ¡dS)NÚargsééÿÿÿÿé)ÚsetZchildrenÚ enumerateÚtyperÚNAMEÚvalueÚlenÚCOMMAÚnextÚappendÚaddÚparentÚprefixÚreplaceÚchanged) ÚselfZnodeÚresultsZnames_insertedZtestlistrÚnew_argsÚiteratorÚidxÚargZatom©rú4/usr/lib64/python3.9/lib2to3/fixes/fix_isinstance.pyÚ transforms* $     zFixIsinstance.transformN)Ú__name__Ú __module__Ú __qualname__Z BM_compatibleZPATTERNZ run_orderr rrrrrs rN)Ú__doc__ÚrZ fixer_utilrZBaseFixrrrrrÚs