Nٖ ~ d Z ddlmZ ddlmZ ddlmZ ddlm Z m
Z
mZ dZ G d dej
Zd Zd
Zd ZdS )
a
Based on fix_next.py by Collin Winter.
Replaces it.next() -> next(it), per PEP 3114.
Unlike fix_next.py, this fixer doesn't replace the name of a next method with __next__,
which would break Python 2 compatibility without further help from fixers in
stage 2.
)token)python_symbols)
fixer_base)NameCallfind_bindingz;Calls to builtin next() possibly shadowed by global bindingc 0 e Zd ZdZdZdZ fdZd Z xZS )FixNextCallTz
power< base=any+ trailer< '.' attr='next' > trailer< '(' ')' > >
|
power< head=any+ trailer< '.' attr='next' > not trailer< '(' ')' > >
|
global=global_stmt< 'global' any* 'next' any* >
prec t t | || t d| }|r$| |t
d| _ d S d| _ d S )NnextTF)superr
start_treer warningbind_warning
shadowed_next)selftreefilenamen __class__s q/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/libfuturize/fixes/fix_next_call.pyr zFixNextCall.start_tree sj
k4 ++D(;;;&& 'LLL)))!%D!&D c x |sJ | d }| d }| d }|r[| j rd S d |D }d|d _ | t t d|j | d S |rd S |rkt
| rZ|d }d d
|D dk r| |t d S d S d|v r$| |t d
| _ d S d S )Nbaseattrnamec 6 g | ]}| S )clone.0r s r