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
N\¬Qc@s+ddlZddlZddlZddlZddlZddlZddlZddlZddlZyddl    Z    Wne
k
rnXddl m Z d„Z d„Zd„Zd„Zd„Zd„Zd    „Zejd
„ƒZd „Zd „Zdd „Zd„Zded„ZdS(iÿÿÿÿN(tstrip_python_stderrc    
Ostjg}|s"|jdƒn|j|ƒtjjƒ}|j|ƒtj    |dtj
dtj
dtj
d|ƒ}z|j ƒ\}}Wdtj ƒ|j jƒ|jjƒX|j}t|ƒ}|rÚ|sè| r | r td||jddƒfƒ‚n|||fS(    Ns-Etstdintstdouttstderrtenvs-Process return code is %d, stderr follows:
%stasciitignore(tsyst
executabletappendtextendtostenvirontcopytupdatet
subprocesstPopentPIPEt communicatet_cleanupRtcloseRt
returncodeRtAssertionErrortdecode(    texpected_successtargstenv_varstcmd_lineRtptoutterrtrc((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pyt_assert_pythons*       
      cOstt||ŽS(s£
    Assert that running the interpreter with `args` and optional environment
    variables `env_vars` is ok and return a (return code, stdout, stderr) tuple.
    (R tTrue(RR((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pytassert_python_ok2scOstt||ŽS(s£
    Assert that running the interpreter with `args` and optional environment
    variables `env_vars` fails and return a (return code, stdout, stderr) tuple.
    (R tFalse(RR((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pytassert_python_failure9sc
GsWtjdg}|j|ƒttjdƒ#}tj|d|dtjƒSWdQXdS(Ns-EtwRR(    RRR
topenR tdevnullRtcalltSTDOUT(RRR'((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pytpython_exit_code@s
 c    OsGtjdg}|j|ƒtj|dtjdtjdtj|S(Ns-ERRR(RRR
RRRR)(RtkwargsR((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pyt spawn_pythonGs
 cCsA|jjƒ|jjƒ}|jjƒ|jƒtjƒ|S(N(RRRtreadtwaitRR(Rtdata((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pyt kill_pythonNs   
 
cOs+t||Ž}t|ƒ}|jƒ|fS(N(R,R0R.(RR+Rt stdout_data((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pyt
run_pythonXs ccs<tjƒ}tjj|ƒ}z    |VWdtj|ƒXdS(N(ttempfiletmkdtempR tpathtrealpathtshutiltrmtree(tdirname((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pyttemp_diras
     cCsP|tjd}tjj||ƒ}t|dƒ}|j|ƒ|jƒ|S(NtpyR%(R textsepR5tjoinR&twriteR(t
script_dirtscript_basenametsourcetscript_filenamet script_namet script_file((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pyt make_scriptjs  
cCs!tj|dtƒ|d}|S(Ntdoraisetc(t
py_compiletcompileR!(RCt compiled_name((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pytcompile_scriptrs
cCsŒ|tjd}tjj||ƒ}tj|dƒ}|dkrYtjj|ƒ}n|j||ƒ|j    ƒ|tjj||ƒfS(NtzipR%(
R R<R5R=tzipfiletZipFiletNonetbasenameR>R(tzip_dirt zip_basenameRCt name_in_zipt zip_filenametzip_nametzip_file((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pytmake_zip_scriptzs 
cCs!tj|ƒt|ddƒdS(Nt__init__t(R tmkdirRE(tpkg_dir((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pytmake_pkg‰s icCs§g}t|ddƒ}|j|ƒtjj|ƒ}    t|||ƒ}
|j|
ƒ|rŠt|ƒ}t|
ƒ}
|j||
fƒngtd|dƒD]} tjj    |g| ƒ^qž} tjj    | dtjj|
ƒƒ} |tj
d}tjj    ||ƒ}t j |dƒ}x3| D]+}tjj    ||    ƒ}|j ||ƒq'W|j |
| ƒ|jƒx|D]}tj|ƒqwW|tjj    || ƒfS(NRXRYiiÿÿÿÿRLR%(RER    R R5RPRKR
trangetsepR=R<RMRNR>Rtunlink(RQRRtpkg_nameR@RAtdepthtcompiledR_t    init_namet init_basenameRCtit    pkg_namestscript_name_in_zipRTRURVtnametinit_name_in_zip((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pyt make_zip_pkgs.    9% 
 (RR tretos.pathR3RRHt
contextlibR7RMt ImportErrorttest.test_supportRR R"R$R*R,R0R2tcontextmanagerR:RERKRORWR\R#Rj(((sZ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/script_helper.pyt<module>s4