ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python3.6/test/support/__pycache__/script_helper.cpython-36.pyc
3

i)@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZmZdaddZGdddejdd#ZddZd
dZddZddZejejdddZddZd$ddZd%ddZd&ddZd'd!d"ZdS)(N)source_from_cache)make_legacy_pycstrip_python_stderrcCsVtdkrRdtjkrdadSytjtjdddgWntjk
rLdaYnXdatS)a 
    Returns True if our sys.executable interpreter requires environment
    variables in order to be able to run at all.

    This is designed to be used with @unittest.skipIf() to annotate tests
    that need to use an assert_python*() function to launch an isolated
    mode (-I) or no environment mode (-E) sub-interpreter process.

    A normal build & test does not run into this situation but it can happen
    when trying to run the standard library test suite from an interpreter that
    doesn't have an obvious home with Python's current home finding logic.

    Setting PYTHONHOME is one way to get most of the testsuite to run in that
    situation.  PYTHONPATH or PYTHONUSERSITE are other common environment
    variables that might impact whether or not the interpreter can start.
    NZ
PYTHONHOMETz-Ez-czimport sys; sys.exit(0)F)$__cached_interp_requires_environmentosenviron
subprocessZ
check_callsys
executableZCalledProcessErrorrr2/usr/lib64/python3.6/test/support/script_helper.py interpreter_requires_environments


r
c@seZdZdZddZdS)_PythonRunResultz2Helper for reporting Python subprocess run resultscCsd	}|j|j}}t||kr0d||d}t||krNd||d}|jddj}|jddj}td|j|||fdS)
z4Provide helpful details about failed subcommand runsPds(... truncated stdout ...)Ns(... truncated stderr ...)asciireplacezRProcess return code is %d
command line: %r

stdout:
---
%s
---

stderr:
---
%s
---i@)outerrlendecoderstripAssertionErrorrc)selfcmd_linemaxlenrrrrrfail>sz_PythonRunResult.failN)__name__
__module____qualname____doc__rrrrrr;srrrrc
Ost}d|kr|jd}n|o$|}tjddg}|rB|jdn|rX|rX|jd|jddri}tjdkrtjd|d<n
tjj}d	|krd
|d	<|j	||j
|tj|tj
tj
tj
|d}|*z|j\}}Wd|jtjXWdQRX|j}	t|}t|	|||fS)NZ
__isolatedz-XZfaulthandlerz-Iz-EZ
__cleanenvZwin32Z
SYSTEMROOTTERM)stdinstdoutstderrenv)r
popr	r
appendplatformrrcopyupdateextendrPopenPIPEZcommunicatekill_cleanup
returncoderr)
argsenv_varsZenv_requiredisolatedrr'procrrrrrrrun_python_until_end[s:





r7cOs4t||\}}|jr|s&|jr0|r0|j||S)N)r7rr)Zexpected_successr3r4resrrrr_assert_pythons
r9cOstd||S)a|
    Assert that running the interpreter with `args` and optional environment
    variables `env_vars` succeeds (rc == 0) and return a (return code, stdout,
    stderr) tuple.

    If the __cleanenv keyword is set, env_vars is used as a fresh environment.

    Python is started in isolated mode (command line option -I),
    except if the __isolated keyword is set to False.
    T)T)r9)r3r4rrrassert_python_oksr:cOstd||S)z
    Assert that running the interpreter with `args` and optional environment
    variables `env_vars` fails (rc != 0) and return a (return code, stdout,
    stderr) tuple.

    See assert_python_ok() for more options.
    F)F)r9)r3r4rrrassert_python_failuresr;)r%r&cOsXtjg}ts|jd|j||jdttj}d|d<t	j
|ft	j||d|S)zRun a Python subprocess with the given arguments.

    kw is extra keyword args to pass to subprocess.Popen. Returns a Popen
    object.
    z-Er'Zvt100r")r$r%r&)r	r
r
r)r-
setdefaultdictrrrr.r/)r%r&r3kwrr'rrrspawn_pythons

r?cCs2|jj|jj}|jj|jtj|S)z?Run the given Popen process until completion and return stdout.)r$closer%readwaitrr1)pdatarrrkill_pythons


rEFcCsP|}|s|tjd7}tjj||}t|ddd}|j||jtj|S)Npywzutf-8)encoding)	rextseppathjoinopenwriter@	importlibinvalidate_caches)Z
script_dirscript_basenamesourceZomit_suffixZscript_filenamescript_nameZscript_filerrrmake_scripts
rSc	Cs|tjd}tjj||}tj|d}|dkr~|jtj}t|dkrr|ddkrrt	t
|}tjj|}|}ntjj|}|j|||j
|tjj||fS)NziprG__pycache__)rrIrJrKzipfileZipFilesplitseprrrbasenamerMr@)	zip_dirzip_basenamerRZname_in_zipzip_filenamezip_namezip_filepartsZ
legacy_pycrrrmake_zip_scriptsrcr#cCstj|t|d|dS)N__init__)rmkdirrS)Zpkg_dirZinit_sourcerrrmake_pkgs
rfcs0g}t|dd}|j|tjj|}	t|||}
|j|
|rjtj|dd}tj|
dd}
|j||
ffddtd|dD}tjj	|d
tjj|
}|tj
d}
tjj	||
}tj|d	}x&|D]}tjj	||	}|j
||qW|j
|
||jx|D]}tj|q
W|tjj	||fS)Nrdr#T)doraisecsg|]}tjjg|qSr)rr[rK).0i)pkg_namerr
<listcomp>sz make_zip_pkg.<locals>.<listcomp>rgrTrG)rSr)rrJr\
py_compilecompiler-rangerKrIrXrYrMr@unlink)r]r^rkrPrQZdepthZcompiledrqZ	init_nameZ
init_basenamerRZ	pkg_namesZscript_name_in_zipr_r`ranameZinit_name_in_zipr)rkrmake_zip_pkgs.



rs)rrr)F)N)r#)rgF) collectionsrNr	rZos.pathZtempfilerrn
contextlibZshutilrXimportlib.utilrZtest.supportrrrr

namedtuplerr7r9r:r;r/ZSTDOUTr?rErSrcrfrsrrrr<module>s4$3