403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.109
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python36/lib64/python3.6/test/support/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python36/lib64/python3.6/test/support/__pycache__/script_helper.cpython-36.pyc
3

�w2_�(�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZmZdadd�Zejdd"�Zd
d�Zdd
�Zdd�Zdd�Zejejd�dd�Zdd�Zd#dd�Zd$dd�Zd%dd�Zd&d d!�ZdS)'�N)�source_from_cache)�make_legacy_pyc�strip_python_stderrcCsVtdkrRdtjkrdadSytjtjdddg�Wntjk
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_environment�os�environ�
subprocessZ
check_call�sys�
executableZCalledProcessError�rr�?/opt/alt/python36/lib64/python3.6/test/support/script_helper.py� interpreter_requires_environments


r
�_PythonRunResult�rc�out�errc
Ost�}d|kr|jd�}n|o$|}tjddg}|rB|jd�n|rX|rX|jd�|jdd�r�i}tjdkr�tjd|d<n
tjj�}d	|kr�d
|d	<|j	|�|j
|�tj|tj
tj
tj
|d�}|�*z|j�\}}Wd|j�tj�XWdQRX|j}	t|�}t|	||�|fS)NZ
__isolatedz-XZfaulthandlerz-Iz-EZ
__cleanenvZwin32Z
SYSTEMROOT�TERM�)�stdin�stdout�stderr�env)r
�popr	r
�append�platformrr�copy�update�extendr�Popen�PIPEZcommunicate�kill�_cleanup�
returncoderr)
�args�env_varsZenv_required�isolated�cmd_liner�procrrrrrr�run_python_until_end@s:





r(cOs�t||�\}}|jr|s&|jr�|r�d}|j|j}}t|�|krVd||d�}t|�|krtd||d�}|jdd�j�}|jdd�j�}td|j|||f��|S)	N�P�ds(... truncated stdout ...)s(... truncated stderr ...)�ascii�replacezRProcess return code is %d
command line: %r

stdout:
---
%s
---

stderr:
---
%s
---i@)r(rrr�len�decode�rstrip�AssertionError)Zexpected_successr#r$�resr&�maxlenrrrrr�_assert_pythonss
r3cOstd|�|�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)r3)r#r$rrr�assert_python_ok�sr4cOstd|�|�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)r3)r#r$rrr�assert_python_failure�sr5)rrcOsXtjg}t�s|jd�|j|�|jdttj��}d|d<t	j
|ft	j||d�|��S)z�Run a Python subprocess with the given arguments.

    kw is extra keyword args to pass to subprocess.Popen. Returns a Popen
    object.
    z-ErZvt100r)rrr)r	r
r
rr�
setdefault�dictrrrrr)rrr#�kwr&rrrr�spawn_python�s

r9cCs2|jj�|jj�}|jj�|j�tj�|S)z?Run the given Popen process until completion and return stdout.)r�closer�read�waitrr!)�p�datarrr�kill_python�s


r?FcCsP|}|s|tjd7}tjj||�}t|ddd�}|j|�|j�tj�|S)N�py�wzutf-8)�encoding)	r�extsep�path�join�open�writer:�	importlib�invalidate_caches)Z
script_dir�script_basename�sourceZomit_suffixZscript_filename�script_nameZscript_filerrr�make_script�s
rMc	Cs�|tjd}tjj||�}tj|d�}|dkr~|jtj�}t|�dkrr|ddkrrt	t
|��}tjj|�}|}ntjj|�}|j||�|j
�|tjj||�fS)N�ziprA��__pycache__���)rrCrDrE�zipfile�ZipFile�split�sepr-rr�basenamerGr:)	�zip_dir�zip_basenamerLZname_in_zip�zip_filename�zip_name�zip_file�partsZ
legacy_pycrrr�make_zip_script�sr]rcCstj|�t|d|�dS)N�__init__)r�mkdirrM)Zpkg_dirZinit_sourcerrr�make_pkg�s
r`�cs0g}t|dd�}|j|�tjj|�}	t|||�}
|j|
�|rjtj|dd�}tj|
dd�}
|j||
f��fdd�td|d�D�}tjj	|d
tjj|
��}|tj
d}
tjj	||
�}tj|d	�}x&|D]}tjj	||	�}|j
||�q�W|j
|
|�|j�x|D]}tj|��q
W|tjj	||�fS)Nr^rT)�doraisecsg|]}tjj�g|��qSr)rrUrE)�.0�i)�pkg_namerr�
<listcomp>�sz make_zip_pkg.<locals>.<listcomp>rarNrA���)rMrrrDrV�
py_compile�compiler�rangerErCrRrSrGr:�unlink)rWrXrerJrKZdepthZcompiledrkZ	init_nameZ
init_basenamerLZ	pkg_namesZscript_name_in_ziprYrZr[�nameZinit_name_in_zipr)rer�make_zip_pkg�s.



rm)rrr)F)N)r)raF) �collectionsrHr	rZos.pathZtempfilerrh�
contextlibZshutilrR�importlib.utilrZtest.supportrrrr
�
namedtuplerr(r3r4r5rZSTDOUTr9r?rMr]r`rmrrrr�<module>s4$3






Youez - 2016 - github.com/yon3zu
LinuXploit