관리-도구
편집 파일: fix_next_call.cpython-311.pyc
� �܋fV � �~ � 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)�Name�Call�find_bindingz;Calls to builtin next() possibly shadowed by global bindingc �0 � � e Zd ZdZdZdZ� fd�Zd� 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 )N�nextTF)�superr � start_treer �warning�bind_warning� shadowed_next)�self�tree�filename�n� __class__s ��p/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/libfuturize/fixes/fix_next_call.pyr zFixNextCall.start_tree sj �� � �k�4� � �+�+�D�(�;�;�;����&�&��� '��L�L��L�)�)�)�!%�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 )N�base�attr�namec �6 � g | ]}|� � � ��S � )�clone��.0r s r � <listcomp>z)FixNextCall.transform.<locals>.<listcomp>7 s � �0�0�0�a���� � �0�0�0r � r r )�prefix�headc �, � g | ]}t |� � ��S r )�strr! s r r# z)FixNextCall.transform.<locals>.<listcomp>E s � �1�1�1�q�C��F�F�1�1�1r �__builtin__�globalT)�getr r% �replacer r �is_assign_target�join�stripr r )r �node�resultsr r r r&