o
    Š�bc±  ã                   @   s2   d Z ddlmZ ddlmZ G dd„ dejƒZdS )zpFix "for x in f.xreadlines()" -> "for x in f".

This fixer will also convert g(f.xreadlines) into g(f.__iter__).é   )Ú
fixer_base)ÚNamec                   @   s   e Zd ZdZdZdd„ ZdS )ÚFixXreadlinesTz‡
    power< call=any+ trailer< '.' 'xreadlines' > trailer< '(' ')' > >
    |
    power< any+ trailer< '.' no_call='xreadlines' > >
    c                 C   sB   |  d¡}|r| td|jd�¡ d S | dd„ |d D ƒ¡ d S )NÚno_callÚ__iter__)Úprefixc                 S   s   g | ]}|  ¡ ‘qS © )Úclone)Ú.0Úxr   r   ú3/usr/lib/python3.10/lib2to3/fixes/fix_xreadlines.pyÚ
<listcomp>   s    z+FixXreadlines.transform.<locals>.<listcomp>Úcall)ÚgetÚreplacer   r   )ÚselfÚnodeÚresultsr   r   r   r   Ú	transform   s   
zFixXreadlines.transformN)Ú__name__Ú
__module__Ú__qualname__ÚBM_compatibleÚPATTERNr   r   r   r   r   r      s    r   N)Ú__doc__Ú r   Ú
fixer_utilr   ÚBaseFixr   r   r   r   r   Ú<module>   s    