ronnie
2022-10-14 1504bb53e29d3d46222c0b3ea994fc494b48e153
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
\\¬Qc@s/dZddlZddlZddlZddlZddlZddlZddlmZddl    Z    ddl
m Z ddl m Z mZmZmZmZddlmZd„Zdefd    „ƒYZd
efd „ƒYZd dd „ƒYZdefd„ƒYZd„Zd„Zd„ZdS(s&Support code for distutils test cases.iÿÿÿÿN(tdeepcopy(tlog(tDEBUGtINFOtWARNtERRORtFATAL(t Distributioncs‡fd†}|S(Ncs1tjƒtjdƒˆ||ŽSWdQXdS(Ntignore(twarningstcatch_warningst simplefilter(targstkw(tfunc(s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyt_capture_warningss  ((RR((Rs_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pytcapture_warningsstLoggingSilencercBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCsStt|ƒjƒtjtjƒ|_tjj|_    |jtj_g|_
dS(N( tsuperRtsetUpRt set_thresholdRt    thresholdtLogt_logt_old_logtlogs(tself((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyRs
cCs6tj|jƒ|jtj_tt|ƒjƒdS(N(    RRRRRRRRttearDown(R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyR$scCsQ|tttttfkr4tdt|ƒƒ‚n|jj|||fƒdS(Ns%s wrong log level(    RRRRRt
ValueErrortstrRtappend(RtleveltmsgR ((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyR)scGsAd„}g|jD]*\}}}||kr|||ƒ^qS(NcSst|ƒdkr|S||S(Ni(tlen(R R ((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyt_format/s(R(RtlevelsR"RR R ((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pytget_logs.s    cCs g|_dS(N(R(R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyt
clear_logs6s(t__name__t
__module__RRRR$R%(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyRs
    
           tTempdirManagercBsAeZdZd„Zd„Zd„Zdd„Zdd„ZRS(s}Mix-in class that handles temporary directories for test cases.
 
    This is intended to be used with unittest.TestCase.
    cCs/tt|ƒjƒtjƒ|_g|_dS(N(RR(Rtostgetcwdtold_cwdttempdirs(R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyR@scCs_tj|jƒtt|ƒjƒx5|jrZ|jjƒ}tj    |tj
dkƒq&WdS(Ntnttcygwin(sntscygwin( R)tchdirR+RR(RR,tpoptshutiltrmtreetname(Rtd((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyREs
 cCs tjƒ}|jj|ƒ|S(sjCreate a temporary directory that will be cleaned up.
 
        Returns the path of the directory.
        (ttempfiletmkdtempR,R(RR4((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyR6Ns txxxcCs\t|ttfƒr*tjj|Œ}nt|dƒ}z|j|ƒWd|jƒXdS(sWWrites a file in the given path.
 
 
        path can be a string or a sequence.
        twN(    t
isinstancetlistttupleR)tpathtjointopentwritetclose(RR<tcontenttf((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyt
write_fileWs tfoocKsG|jƒ}tjj||ƒ}tj|ƒtd|ƒ}||fS(sWill generate a test environment.
 
        This function creates:
         - a Distribution instance using keywords
         - a temporary directory with a package structure
 
        It returns the package directory and the distribution
        instance.
        tattrs(R6R)R<R=tmkdirR(Rtpkg_nameR ttmp_dirtpkg_dirtdist((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyt create_distes
 
 (R&R't__doc__RRR6RCRK(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyR(:s                      t DummyCommandcBs eZdZd„Zd„ZRS(sAClass to store options for retrieval via set_undefined_options().cKs1x*|jƒD]\}}t|||ƒq WdS(N(titemstsetattr(RtkwargsR tval((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyt__init__zscCsdS(N((R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pytensure_finalized~s(R&R'RLRRRS(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyRMws    t EnvironGuardcBseZd„Zd„ZRS(cCs)tt|ƒjƒttjƒ|_dS(N(RRTRRR)tenviront old_environ(R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyR„scCs•xE|jjƒD]4\}}tjj|ƒ|kr|tj|<qqWx3tjjƒD]"}||jkrXtj|=qXqXWtt|ƒjƒdS(N(    RVRNR)RUtgettkeysRRTR(Rtkeytvalue((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyRˆs(R&R'RR(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyRT‚s    cCs;tƒ}|dkr'tjdƒ‚ntj||ƒdS(skHelper for tests that need the xxmodule.c source file.
 
    Example use:
 
        def test_compile(self):
            copy_xxmodule_c(self.tmpdir)
            self.assertIn('xxmodule.c', os.listdir(self.tmpdir))
 
    If the source file can be found, it will be copied to *directory*.  If not,
    the test will be skipped.  Errors during copy are not caught.
    s>cannot find xxmodule.c (test must run in the python build dir)N(t_get_xxmodule_pathtNonetunittesttSkipTestR1tcopy(t    directorytfilename((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pytcopy_xxmodule_c”s     c    Cs‘tjdƒ}tjjtjjtƒdƒtjj|ddƒtjj|dddddƒg}x$|D]}tjj|ƒrm|SqmWdS(Ntsrcdirs
xxmodule.ctModuless..(t    sysconfigtget_config_varR)R<R=tdirnamet__file__texists(Rct
candidatesR<((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyR[§s$ cCs¯tjdkr'tjjdƒ|_n„tjdƒr«tjdƒ}|dkr`dg|_    q«tj
dkr{g|_    q«|j dƒ\}}}|j tj ƒ|_    ndS(    s4Function needed to make build_ext tests pass.
 
    When Python was build with --enable-shared on Unix, -L. is not good
    enough to find the libpython<blah>.so.  This is because regrtest runs
    it under a tempdir, not in the top level where the .so lives.  By the
    time we've gotten here, Python's already been chdir'd to the tempdir.
 
    When Python was built with in debug mode on Windows, build_ext commands
    need their debug attribute set, and it is not done automatically for
    some reason.
 
    This function handles both of these things.  Example use:
 
        cmd = build_ext(dist)
        support.fixup_build_ext(cmd)
        cmd.ensure_finalized()
 
    Unlike most other Unix platforms, Mac OS X embeds absolute paths
    to shared libraries into executables, so the fixup is not needed there.
    R-s_d.exetPy_ENABLE_SHAREDt    RUNSHAREDt.tdarwint=N(R)R3tsyst
executabletendswithtdebugReRfR\t library_dirstplatformt    partitiontsplittpathsep(tcmdt    runsharedR3tequalsRZ((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pytfixup_build_extºs  ((RLR)RpR1R5R]ReR_RR    t    distutilsRt distutils.logRRRRRtdistutils.coreRRtobjectRR(RMRTRbR[R|(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/tests/support.pyt<module>s&       (    "=