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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
O\¬Qc@s|ddlZddlZddlZddlmZddlZdejfd„ƒYZd„Ze    dkrxeƒndS(iÿÿÿÿN(t test_supportt TestSpecificscBseZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „Zd „Zd„Zd„Zd„Zd„ZejdkrÃd„Znd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs$tdddƒtdddƒdS(Nthis<test>texecshi (tcompile(tself((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_no_ending_newline    scCstdddƒdS(Nts<test>R(R(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt
test_empty scCsDtdddƒtdddƒtdddƒtdddƒdS(Ns
s<test>Rs shi
stuff
def f():
    pass s(this_is really_old_mac def f():
    pass(R(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_other_newlinesscCsR|jttdddƒddl}|j}t|ddƒt|d|ƒdS(Ns __debug__ = 1t?tsingleiÿÿÿÿt    __debug__tsure(t assertRaisest SyntaxErrorRt __builtin__R tsetattr(RRtprev((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_debug_assignments
     cBsÄ|jeedƒ|jeedƒ|jeedƒyddU|jdƒWnek
renXyddU|jdƒWnek
r’nXyddU|jd    ƒWnek
r¿nXdS(
Ns lambda a,a:0slambda a,a=1:0slambda a=1,a=1:0sdef f(a, a): passsduplicate argumentssdef f(a = 0, a = 1): passsduplicate keyword argumentssdef f(a): global a; a = 1svariable is global and local(RRtevaltfail(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_argument_handlings$   cCs|jttdddƒdS(Ns1+*3tfilenameR(RRR(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_syntax_error3scCs|jttdddƒdS(Ns    f(None=1)s<string>R(RRR(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_none_keyword_arg6scBs1yddU|jdƒWnek
r,nXdS(Nsdef f(a): global a; a = 1svariable is global and local(RR(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_duplicate_global_local9s
 c
Bs8idd6}d|fdU|j|ddƒidd6}idd6dd6}d    ||fdU|jd|ƒ|j|dd
ƒ|jeƒ d dUWdQX|jeƒdiiifdUWdQXidd6d d6}i}|jeƒd|f|UWdQX|jeƒd||f||UWdQXdS( Nitbs    a = b + 1taiiitcs    a = b + ci
i(s    a = b + 1(t assertEqualt assertNotInRt    TypeError(Rtgtl((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_exec_functional_style@s$  cBs™ddd„ƒY}|ƒ}eƒ}d||U|j|jdƒyd||UWnek
rcnX|jdƒd||U|j|jded    ƒfƒd
||U|j|jd|fƒd ||U|j|jd|fƒy d|UWnek
rÿnX|jd ƒd dd„ƒY}|ƒ}yd||UWnek
rJnX|jdƒdefd„ƒY}|ƒ}d||U|j|ddƒdS(NtMcBs)eZdZd„Zd„Zd„ZRS(s9Test mapping interface versus possible calls from eval().cSs|dkrdSt‚dS(NRi (tKeyError(Rtkey((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt __getitem__`s cSs||f|_dS(N(tresults(RR&tvalue((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt __setitem__dscSs
tdƒS(Ntxyz(tlist(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pytkeysfs(t__name__t
__module__t__doc__R'R*R-(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR$^s        sz = atzi sz = bsDid not detect a KeyErrors    z = dir()R+s z = globals()s z = locals()s'Did not validate globals as a real dicttAcBseZdZRS(s Non-mapping(R.R/R0(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR2€ss$Did not validate locals as a mappingtDcBseZd„ZRS(cSs |dkrdStj||ƒS(NRi (tdictR'(RR&((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR's (R.R/R'(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR3Œs((R1i ((tglobalsRR(t    NameErrorRR,R R4(RR$tmR!R2R3td((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt)test_exec_with_general_mapping_for_locals\s@        
 
 
 
             
cBsAddd}d|fd}|dU|jedƒdƒdS(Ns    x = x or s-xiÄ    sÞ
def f(x):
    %s
    %s
    %s
    %s
    %s
    %s
    %s
    %s
    %s
    %s
    # the expressions above have no effect, x == argument
    while x:
        x -= 1
        # EXTENDED_ARG/JUMP_ABSOLUTE here
    return x
i
ii(Rtf(Rtlongexprtcode((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_extended_arg•scBs1ejdefƒejdƒdUWdQXdS(Ns*tuple parameter unpacking has been removeds>
        def comp_args((a, b)):
            return a,b
        self.assertEqual(comp_args((1, 2)), (1, 2))
 
        def comp_args((a, b)=(3, 4)):
            return a, b
        self.assertEqual(comp_args((1, 2)), (1, 2))
        self.assertEqual(comp_args(), (3, 4))
 
        def comp_args(a, (b, c)):
            return a, b, c
        self.assertEqual(comp_args(1, (2, 3)), (1, 2, 3))
 
        def comp_args(a=2, (b, c)=(3, 4)):
            return a, b, c
        self.assertEqual(comp_args(1, (2, 3)), (1, 2, 3))
        self.assertEqual(comp_args(), (2, 3, 4))
        (Rtcheck_py3k_warningst SyntaxWarningttextwraptdedent(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_complex_args¬scBs1yddU|jdƒWnek
r,nXdS(Nsdef f(a=1, (b, c)): passsnon-default args after default(RR(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_argument_orderÄs
 cCsP|jttdƒ|jttdƒ|jttdƒ|jttdƒdS(Nt2es2.0e+s1e-s3-4e/21(RRR(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_float_literalsËscCsd}t|ddƒdS(Ns
if 1:
    if 2:
        passs<string>R(R(Rts((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_indentationÒscCsYdjdgddgƒ}t|ddƒ}|j|jdƒ|j|jdƒdS(NRs
itspamtfnRi(tjoinRRtco_firstlinenot    co_lnotab(Rts256tco((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_leading_newlinesÞscCs!xZddddddddd    d
d d d ddddddgD]}|jtt|ƒq@W|jtdƒdƒ|jtdƒdƒ|jtdƒdƒ|jtdƒdƒ|jtdƒdƒ|jtdƒdƒ|jtdƒdƒ|jtdƒdƒ|jtdƒdƒ|jtd ƒd!ƒ|jtd"ƒd#ƒ|jtd$ƒd#ƒ|jtd%ƒd&ƒ|jtd'ƒd(ƒ|jtd)ƒd*ƒ|jtd+ƒd#ƒ|jtd,ƒd#ƒ|jtd-ƒd.ƒ|jtd/ƒd.ƒ|jtd0ƒd.ƒ|jtd1ƒd.ƒ|jtd2ƒd3ƒ|jtd4ƒd5ƒ|jtd6ƒd7ƒ|jtd8ƒd9ƒ|jtd:ƒd;ƒ|jtd<ƒd=ƒ|jtd>ƒdƒ|jtd?ƒd@ƒ|jtdAƒdBƒ|jtdCƒdDƒ|jtdEƒdFƒdS(GNt077787t0xjs0x.t0et090000000000000t080000000000000t000000000000009t000000000000008t0b42t0BADCAFEt 0o123456789s0b1.1s0o4.2t0b101j2t0o153j2t0b100e1t0o777e1t0o8t0o78t0777iÿt0777Lt000777t0xffiÿt0xffLt0XfFs0777.i    s0777.0t8000000000000000000000000000000000000000000000000000777e0t0777e1iZt0e0is    0000E-012s09.5g#@t0777jyHˆ@t00jys00.0t0e3s090000000000000.g聰vÔBs&090000000000000.0000000000000000000000t090000000000000e0s090000000000000e-0t090000000000000jy聰vÔBt000000000000007is000000000000008.g @s000000000000009.g"@t0b101010i*s-0b000000000010iþÿÿÿt0o777s
-0o0000010iøÿÿÿs020000000000.0g _ Bt037777777777e0gâHv—!Bs01000000000000000000000.0gPïâÖäKD(RRRR(Rtarg((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt!test_literals_with_leading_zeroesäsL    cCsåtjdkrHd}|jt|ƒdƒ|jtd|ƒdƒnUtjdkrd}|jt|ƒdƒ|jtd|ƒd    ƒn |jd
ƒ|jtd tj d ƒtƒ|jtd tj d ƒtƒdS(Niÿÿÿt
0xfffffffflÿÿt-lýÿÿÿÿÿIÿÿÿÿÿÿÿt0xfffffffffffffffflÿÿÿÿlûÿÿÿÿÿÿÿs)How many bits *does* this machine have???s%sii(tsystmaxintRRRtassertIsInstancetinttlong(Rt all_one_bits((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_unary_minus s "Iÿÿÿÿÿÿÿc
Csqd
}d}d
}d}d
}d}d
}d}x6|jjjD]%}    |    dk    rD|j|    tƒqDqDWdS(    NIIÿÿÿÿIIÿÿI@IÀIÿÿÿÿÿÿÿI€(ttest_32_63_bit_valuest    func_codet    co_conststNoneRyRz(
RRRRR8teR:R!thtvariable((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR~!s cCs6dp    d\}}|j|dƒ|j|dƒdS(Niiÿÿÿÿ(iiÿÿÿÿ(iÿÿÿÿi(R(Rtitj((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_sequence_unpacking_error/sc Cs«ddddddddd    d
d d g }xJ|D]B}|d 7}|jtt|ddƒ|jtt|ddƒq1WtdddƒtdddƒtdddƒdS(NsNone = 0s    None += 0s__builtins__.None = 0sdef None(): passsclass None: passs(a, None) = 0, 0sfor None in range(10): passsdef f(None): passs import Nonesimport x as Nonesfrom x import Nonesfrom x import y as Nones
ttmpR Rsfrom None import xsfrom x import None as ysimport None as x(RRR(Rtstmtststmt((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_none_assignment5s&     
cCsÇddddddddd    d
d d d ddg}ddddddddddddddddd d!d"d#d$g}x|D]}t|d%d&ƒqWx'|D]}|jtt|d%d&ƒq WdS('Ns
import syssimport os, syssimport os as barsimport os.path as bars0from __future__ import nested_scopes, generatorss2from __future__ import (nested_scopes,
generators)s3from __future__ import (nested_scopes,
generators,)s%from sys import stdin, stderr, stdouts'from sys import (stdin, stderr,
stdout)s(from sys import (stdin, stderr,
stdout,)s(from sys import (stdin
, stderr, stdout)s)from sys import (stdin
, stderr, stdout,)s7from sys import stdin as si, stdout as so, stderr as ses9from sys import (stdin as si, stdout as so, stderr as se)s:from sys import (stdin as si, stdout as so, stderr as se,)simport (os, sys)simport (os), (sys)simport ((os), (sys))s import (syss import sys)s import (os,)simport os As barsimport os.path a barsfrom sys import stdin As stdoutsfrom sys import stdin a stdoutsfrom (sys) import stdins%from __future__ import (nested_scopess%from __future__ import nested_scopes)s0from __future__ import nested_scopes,
generatorssfrom sys import (stdinsfrom sys import stdin)s%from sys import stdin, stdout,
stderrsfrom sys import stdin sis)from sys import stdin,from sys import (*)s(from sys import (stdin,, stdout, stderr)s from sys import (stdin, stdout),RˆR(RRR(RtsucceedRRŠ((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt test_importMsP          cCs>d„}|ƒ\}}|jt|jƒt|jƒƒdS(NcSs"dd„}dd„}||fS(NicSs|S(N((tx((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt<lambda>sicSs|S(N((RŽ((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR€s((tf1tf2((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR:~s  (tassertNotEqualtidR(RR:RR‘((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_for_distinct_code_objects|s    cCsd„}|j|jƒdS(NcSsdS(Ntfoo((((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR†s(t assertIsNoneR0(RR"((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_lambda_doc…s    cCs#d}|jtt|ddƒdS(Nu# -*- coding: utf-8 -*-
pass
RˆR(RRR(RR<((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_unicode_encoding‰scCsJdtfd„ƒY}|ƒ}d|d<|j|ddƒ|dcd7<|j|ddƒ|d=|jd|ƒd|d<|j|ddƒ|d    cd7<|j|d
dƒ|d =|jd |ƒd|dd+|j|dd!dƒ|ddc!d7+|j|dd!dƒ|dd5|jtddƒ|ƒd|dd…dd…f<|j|dd…dd…fdƒ|dd…dd…fcd7<|j|dd…dd…fdƒ|dd…dd…f=|jtddƒtddƒf|ƒd|ddd…<|j|ddd…dƒ|ddd…cd7<|j|ddd…dƒ|ddd…=|jtdddƒ|ƒd|ddd…ddd…f<|j|ddd…ddd…fdƒ|ddd…ddd…fcd7<|j|ddd…ddd…fdƒ|ddd…ddd…f=|jtdddƒtdddƒf|ƒd|d<|j|ddƒ|dcd7<|j|ddƒ|d=|jt|ƒd|d <|j|ddƒ|dcd7<|j|ddƒ|d=|jttf|ƒdS(Ntstr_mapcBs5eZd„Zd„Zd„Zd„Zd„ZRS(cSs i|_dS(N(tdata(R((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt__init__‘scSs|jt|ƒS(N(Rštstr(RR&((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR'“scSs||jt|ƒ<dS(N(RšRœ(RR&R)((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR*•scSs|jt|ƒ=dS(N(RšRœ(RR&((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt __delitem__—scSst|ƒ|jkS(N(RœRš(RR&((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt __contains__™s(R.R/R›R'R*RRž(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR™s
                iii.(ii(ii(ii(ii(ii(ii(..(..(..(..(..(tobjectRRtslicetEllipsis(RR™R8((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_subscriptssd    
 
 
&"&(",(,.
 
cCs{ddd„ƒY}|jd|jjjƒ|jd|jjjƒ|jd|jjjƒ|jd|jjjƒdS(NR2cBseZd„ZRS(cSs(d}d}ddl}ddl}dS(Niiiÿÿÿÿ(t_A__mangled_modt__package__.module(t _A__mangledt__not_mangled__R£t __package__((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR:×s (R.R/R:(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyR2ÖsR¥R¦R£R§((tassertInR:Rt co_varnames(RR2((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt test_manglingÕs
c     CsÐt}|jƒjdƒr(|d }nt|dƒ}|jƒ}WdQXddgddgd    d
gd d gd dgddgddgddg||gg    }xŸ|D]—\}}t|d|dƒ}t|d|dtjƒ}|jt    |ƒtj
kƒt|d|dƒ}|j ||ƒ|j |j d|ƒqªWtdddtjƒ}|j tt|ddƒ|j tttjƒddƒtj
ƒ}tjƒg|_|j tt|ddƒdS(Ntpyctpyoiÿÿÿÿtrs<assign>sx = 5s<print1>sprint 1s<printv>sprint vs <printTrue>s
print Trues <printList>sprint []s    <ifblock>sif True:
    pass
s
<forblock>s for n in [1, 2, 3]:
    print n
s    <deffunc>sdef foo():
    pass
foo()
s%s1Rs%s2s%s3s<string>s<ast>R(R«R¬(t__file__tlowertendswithtopentreadRt_astt PyCF_ONLY_ASTt
assertTruettypetModuleRt co_filenameRR tIftBoolOptbody(    RtfnameR:t    fcontentst sample_codeR<tco1tasttco2((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyttest_compile_astâs6                                  ( R.R/RRR    RRRRRR#R9R=RBRCRERGRORsR}RwRxR~R‡R‹RR”R—R˜R¢RªRÂ(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyRs:                                        9                            )                 /                    H     cCstjtƒdS(N(Rt run_unittestR(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt    test_main
st__main__(
tunittestRwR³ttestRR@tTestCaseRRÄR.(((sY/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_compile.pyt<module>s    ÿÿ