Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/support/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/support/__pycache__/script_helper.cpython-38.opt-2.pyc
U

?��g)�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZda
dd�ZGdd�de�dd��Zd	d
�Zdd�Zd
d�Zdd�Zejejd�dd�Zdd�Zd!dd�Zd"dd�Zd#dd�Zd$dd �ZdS)%�N)�source_from_cache)�make_legacy_pyc�strip_python_stderrcCsVtdkrRdtjkrdadSzt�tjdddg�Wntjk
rLdaYnXdatS)NZ
PYTHONHOMET�-Ez-czimport sys; sys.exit(0)F)�$__cached_interp_requires_environment�os�environ�
subprocess�
check_call�sys�
executable�CalledProcessError�rr�9/opt/cppython/lib/python3.8/test/support/script_helper.py� interpreter_requires_environments

�

rc@seZdZdd�ZdS)�_PythonRunResultcCs�d}|j|j}}t|�|kr0d||d�}t|�|krNd||d�}|�dd���}|�dd���}td|j|||f��dS)Ni@s(... truncated stdout ...)s(... truncated stderr ...)�ascii�replacezRProcess return code is %d
command line: %r

stdout:
---
%s
---

stderr:
---
%s
---)�out�err�len�decode�rstrip�AssertionError�rc)�self�cmd_line�maxlenrrrrr�fail;s��z_PythonRunResult.failN)�__name__�
__module__�__qualname__rrrrrr8sr)rrrc	Os&t�}|�dd�}d|kr&|�d�}n|o0|}tjddg}|rN|�d�n|s`|s`|�d�|�dd�r�i}tjdkr�tjd	|d	<n
tj��}d
|kr�d|d
<|�	|�|�
|�tj|tj
tj
tj
||d�}|�*z|��\}}	W5|��t��XW5QRX|j}
t|	�}	t|
||	�|fS)
NZ__cwdZ
__isolatedz-X�faulthandlerz-IrZ
__cleanenv�win32Z
SYSTEMROOT�TERM�)�stdin�stdout�stderr�env�cwd)r�poprr�append�platformrr�copy�update�extendr	�Popen�PIPE�kill�_cleanup�communicate�
returncoderr)�args�env_varsZenv_requiredr*�isolatedrr)�procrrrrrr�run_python_until_endXsB





�r;cOs0t||�\}}|jr|s"|js,|s,|�|�|S�N)r;rr)Zexpected_successr7r8�resrrrr�_assert_python�s
r>cOstd|�|�S)NT)T�r>�r7r8rrr�assert_python_ok�srAcOstd|�|�S)NF)Fr?r@rrr�assert_python_failure�srB)r'r(cOsXtjg}t�s|�d�|�|�|�dttj��}d|d<t	j
|ft	j||d�|��S)Nrr)Zvt100r$)r&r'r()rrrr,r0�
setdefault�dictrrr	r1r2)r'r(r7�kwrr)rrr�spawn_python�s

��rFcCs2|j��|j��}|j��|��t��|Sr<)r&�closer'�read�waitr	r4)�p�datarrr�kill_python�s


rLFc	CsT|}|s|tjd7}tj�||�}t|ddd��}|�|�W5QRXt��|S)N�py�wzutf-8)�encoding)r�extsep�path�join�open�write�	importlib�invalidate_caches)Z
script_dir�script_basename�sourceZomit_suffixZscript_filename�script_nameZscript_filerrr�make_script�srZc		Cs�|tjd}tj�||�}t�|d��h}|dkr�|�tj�}t|�dkrt|ddkrtt	t
|��}tj�|�}|}ntj�|�}|�||�W5QRX|tj�||�fS)N�ziprN�����__pycache__)
rrPrQrR�zipfile�ZipFile�split�seprrr�basenamerT)	�zip_dir�zip_basenamerYZname_in_zip�zip_filename�zip_name�zip_file�partsZ
legacy_pycrrr�make_zip_script�srjr%cCst�|�t|d|�dS)N�__init__)r�mkdirrZ)Zpkg_dirZinit_sourcerrr�make_pkg�s
rm�c	s,g}t|dd�}|�|�tj�|�}	t|||�}
|�|
�|rjtj|dd�}tj|
dd�}
|�||
f��fdd�td|d�D�}tj�	|dtj�|
��}|tj
d	}
tj�	||
�}t�|d
��6}|D]}tj�	||	�}|�
||�q�|�
|
|�W5QRX|D]}t�|��q|tj�	||�fS)Nrkr%T)�doraisecsg|]}tj��g|��qSr)rrbrR)�.0�i��pkg_namerr�
<listcomp>�sz make_zip_pkg.<locals>.<listcomp>rn���r[rN)rZr,rrQrc�
py_compile�compiler0�rangerRrPr_r`rT�unlink)rdrersrWrX�depthZcompiledryZ	init_nameZ
init_basenamerYZ	pkg_namesZscript_name_in_ziprfrgrh�nameZinit_name_in_ziprrrr�make_zip_pkg�s,

r|)F)N)r%)rnF)�collectionsrUrrZos.pathr	rvr_�importlib.utilrZtest.supportrrrr�
namedtuplerr;r>rArBr2�STDOUTrFrLrZrjrmr|rrrr�<module>s4$� 4




�

F1le Man4ger