shell bypass 403
o
abY � @ s0 d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
mZmZm
Z
mZ ddlmZmZmZ ddlZddlZddlmZ zddlZW n ey[ dZY nw e�ejejkpiejejkd�Zddd�ZG d d
� d
ej �Z!G dd� de!�Z"eG d
d� de!��Z#e$dkr�e�%� dS dS )z|
Test harness for the venv module.
Copyright (C) 2011-2012 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
� N)�captured_stdout�captured_stderr�
requires_zlib�*skip_if_broken_multiprocessing_synchronize)�can_symlink�EnvironmentVarGuard�rmtree)�patchz:cannot run venv.create from within a venv on this platformc C sB t j| t jt j|d�}|�� \}}|jrt �|j| ||��||fS )N)�stdout�stderr�encoding)�
subprocess�Popen�PIPE�communicate�
returncode�CalledProcessError)�cmdr �p�out�err� r �7/usr/local/python-3.10/lib/python3.10/test/test_venv.py�check_output$ s �
�r c @ sB e Zd ZdZdZdd� Zdd� Zdd� Zd d
� Zdd�d
d�Z dS )�BaseTestzBase class for venv tests.i� c C s� t j�t�� �| _t jdkrd| _d| _d| _ nd| _ddt
jd d� f| _d | _ t
j}t j�
|�d
| _t
jdkrLt j�|�rLt j�|�sLd| _d S d
| _d S )N�nt�Scripts��Lib�Include�bin�lib�python%d.%d� �include����win32TF)�os�path�realpath�tempfile�mkdtemp�env_dir�name�bindirr! r$ �sys�version_info�_base_executable�split�exe�platform�lexists�exists�cannot_link_exe)�self�
executabler r r �setUp3 s"