U
    A`                     @   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   s@   | d}|r$|td|jd n|dd |d D  d S )Nno_call__iter__)prefixc                 S   s   g | ]}|  qS  )Zclone).0xr   r   2/usr/lib/python3.8/lib2to3/fixes/fix_xreadlines.py
<listcomp>   s     z+FixXreadlines.transform.<locals>.<listcomp>Zcall)getreplacer   r   )selfZnodeZresultsr   r   r   r   	transform   s    
zFixXreadlines.transformN)__name__
__module____qualname__ZBM_compatibleZPATTERNr   r   r   r   r   r      s   r   N)__doc__ r   Z
fixer_utilr   ZBaseFixr   r   r   r   r   <module>   s   