tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Y\¬Qc@sšdZddlmZddlmZddlmZddlmZddlmZm    Z    m
Z
m Z m Z ej dƒZdejfd    „ƒYZd
S( s 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__
 
i(tpatcomp(tpytree(ttoken(t
fixer_base(tNametCalltCommatStringtis_tuples"atom< '(' [atom|STRING|NAME] ')' >tFixPrintcBs&eZeZdZd„Zd„ZRS(sP
              simple_stmt< any* bare='print' any* > | print_stmt
              c Cs2|s t‚|jdƒ}|rJ|jttdƒgd|jƒƒdS|jdtdƒksit‚|jd}t|ƒdkrŸtj    |dƒrŸdSd}}}|rÙ|dt ƒkrÙ|d }d}n|r3|dt j tjdƒkr3t|ƒd    kst‚|djƒ}|d
}ng|D]}|jƒ^q:}    |    rhd |    d_n|dk    sŒ|dk    sŒ|dk    r |dk    rº|j|    d tt|ƒƒƒn|dk    rè|j|    d tt|ƒƒƒn|dk    r |j|    d|ƒq nttdƒ|    ƒ}
|j|
_|
S(Ntbareuprinttprefixiiiÿÿÿÿt u>>iiuusepuendufile(tAssertionErrortgettreplaceRRR tchildrentlent parend_exprtmatchtNoneRRtLeafRt
RIGHTSHIFTtclonet    add_kwargRtrepr( tselftnodetresultst
bare_printtargstseptendtfiletargtl_argstn_stmt((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_print.pyt    transform%s>   %
    % $ " "  cCsrd|_tj|jjt|ƒtjtjdƒ|fƒ}|ra|j    t
ƒƒd|_n|j    |ƒdS(Nuu=u ( R RtNodetsymstargumentRRRtEQUALtappendR(Rtl_nodests_kwdtn_exprt
n_argument((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_print.pyRMs          (t__name__t
__module__tTruet BM_compatibletPATTERNR%R(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_print.pyR    s    (N(t__doc__tRRtpgen2RRt
fixer_utilRRRRRtcompile_patternRtBaseFixR    (((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/lib2to3/fixes/fix_print.pyt<module>s(