U iÛfHã@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|krr|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ÚreplaceZchanged) ÚselfZnodeZresultsZnames_insertedZtestlistrZnew_argsÚiteratorÚidxÚargZatom©rúA/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_isinstance.pyÚ transforms* $     zFixIsinstance.transformN)Ú__name__Ú __module__Ú __qualname__Z BM_compatibleZPATTERNZ run_orderrrrrrrs rN)Ú__doc__ÚrZ fixer_utilrZBaseFixrrrrrÚs