a ZÚß^Hc@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) i)Ú fixer_base)Útokenc@s eZdZdZdZdZdd„ZdS)Ú FixIsinstanceTz˜ power< 'isinstance' trailer< '(' arglist< any ',' atom< '(' args=testlist_gexp< any+ > ')' > > ')' > > ic 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Úargsiiÿÿÿÿi)ZsetZchildrenZ enumerateZtyperZNAMEZvalueZlenZCOMMAZnextZappendZaddZparentZprefixZreplaceZchanged) ZselfZnodeZresultsZnames_insertedZtestlistrZnew_argsZiteratorZidxZargZatom©rú4/usr/lib64/python3.9/lib2to3/fixes/fix_isinstance.pyÚ transforms* $     zFixIsinstance.transformN)Z__name__Z __module__Z __qualname__Z BM_compatibleZPATTERNZ run_orderrrrrrrs rN)Z__doc__ZrZ fixer_utilrZBaseFixrrrrrZs