§
™ …9ÞŠ1ã ó˜ — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZm Z m
Z
mZ ej d¦ « Z
G d„ d ej ¦ « Zd
S )a Fixer for print.
Change:
'print' into 'print()'
'print ...' into 'print(...)'
'print ... ,' into 'print(..., end=" ")'
'print >>x, ...' into 'print(..., file=x)'
No changes are applied if print_function is imported from __future__
é )Úpatcomp)Úpytree)Útoken)Ú
fixer_base)ÚNameÚCallÚCommaÚStringz"atom< '(' [atom|STRING|NAME] ')' >c ó" — e Zd ZdZdZd„ Zd„ ZdS )ÚFixPrintTzP
simple_stmt< any* bare='print' any* > | print_stmt
c ó( — |sJ ‚| d¦ « }|r9| t t d¦ « g |j ¬¦ « ¦ « d S |j d t d¦ « k sJ ‚|j dd … }t
|¦ « dk r"t |d ¦ « rd S d x}x}}|r$|d t ¦ « k r|d d… }d}|rb|d t j t j
d¦ « k r9t
|¦ « d k sJ ‚|d ¦ « }|d
d … }d„ |D ¦ « }|r
d|d _ |€|€|�|�1| |d
t! t# |¦ « ¦ « ¦ « |�1| |dt! t# |¦ « ¦ « ¦ « |�| |d|¦ « t t d¦ « |¦ « } |j | _ | S )NÚbareÚprint)Úprefixé é éÿÿÿÿú z>>r é c ó6 — g | ]}| ¦ « ‘ŒS © )Úclone)Ú.0Úargs ú>/opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_print.pyú