403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.217.130
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/distutils/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

x2_��@s�dZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
mZmZmZddlmZGdd�de�ZGd	d
�d
e�ZGdd�d�ZGd
d�de�Zdd�Zdd�Zdd�ZdS)z&Support code for distutils test cases.�N)�deepcopy)�log)�DEBUG�INFO�WARN�ERROR�FATAL)�Distributioncs@eZdZ�fdd�Z�fdd�Zdd�Zdd�Zd	d
�Z�ZS)�LoggingSilencercs6t�j�tjtj�|_tjj|_|jtj_g|_	dS)N)
�super�setUpr�
set_thresholdr�	threshold�Log�_log�_old_log�logs)�self)�	__class__��</opt/alt/python36/lib64/python3.6/distutils/tests/support.pyrs



zLoggingSilencer.setUpcs$tj|j�|jtj_t�j�dS)N)rr
rrrrr�tearDown)r)rrrrs
zLoggingSilencer.tearDowncCsT|tttttfkr"tdt|���t|t�s>tdt	|�j
��|jj|||f�dS)Nz%s wrong log levelzmsg should be str, not '%.200s')
rrrrr�
ValueError�str�
isinstance�	TypeError�type�__name__r�append)r�level�msg�argsrrrr s
zLoggingSilencer._logcsdd�}�fdd�|jD�S)NcSs||S)Nr)r r!rrr�_format)sz)LoggingSilencer.get_logs.<locals>._formatcs"g|]\}}}|�kr||�qSrr)�.0rr r!)�levelsrr�
<listcomp>+sz,LoggingSilencer.get_logs.<locals>.<listcomp>)r)rr$r"r)r$r�get_logs(s
zLoggingSilencer.get_logscCs
g|_dS)N)r)rrrr�
clear_logs.szLoggingSilencer.clear_logs)	r�
__module__�__qualname__rrrr&r'�
__classcell__rr)rrr
s

r
csHeZdZdZ�fdd�Z�fdd�Zdd�Zdd	d
�Zddd
�Z�Z	S)�TempdirManagerz}Mix-in class that handles temporary directories for test cases.

    This is intended to be used with unittest.TestCase.
    cst�j�tj�|_g|_dS)N)rr�os�getcwd�old_cwd�tempdirs)r)rrrr8s

zTempdirManager.setUpcsBtj|j�t�j�x&|jr<|jj�}tj|tj	dk�qWdS)N�nt�cygwin)r0r1)
r,�chdirr.rrr/�pop�shutilZrmtree�name)r�d)rrrr=s


zTempdirManager.tearDowncCstj�}|jj|�|S)zjCreate a temporary directory that will be cleaned up.

        Returns the path of the directory.
        )�tempfile�mkdtempr/r)rr6rrrr8FszTempdirManager.mkdtemp�xxxc
CsBt|ttf�rtjj|�}t|d�}z|j|�Wd|j�XdS)zWWrites a file in the given path.


        path can be a string or a sequence.
        �wN)	r�list�tupler,�path�join�open�write�close)rr=Zcontent�frrr�
write_fileOs
zTempdirManager.write_file�foocKs2|j�}tjj||�}tj|�t|d�}||fS)aWill 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.
        )Zattrs)r8r,r=r>�mkdirr	)rZpkg_name�kwZtmp_dirZpkg_dirZdistrrr�create_dist]s



zTempdirManager.create_dist)r9)rD)
rr(r)�__doc__rrr8rCrGr*rr)rrr+2s		
r+c@s eZdZdZdd�Zdd�ZdS)�DummyCommandzAClass to store options for retrieval via set_undefined_options().cKs&x |j�D]\}}t|||�q
WdS)N)�items�setattr)r�kwargsrF�valrrr�__init__rszDummyCommand.__init__cCsdS)Nr)rrrr�ensure_finalizedvszDummyCommand.ensure_finalizedN)rr(r)rHrNrOrrrrrIosrIcs(eZdZ�fdd�Z�fdd�Z�ZS)�EnvironGuardcstt|�j�ttj�|_dS)N)rrPrrr,�environ�old_environ)r)rrrr|szEnvironGuard.setUpcsnx0|jj�D]"\}}tjj|�|kr|tj|<qWx(ttjj��D]}||jkrBtj|=qBWtt|�j	�dS)N)
rRrJr,rQ�getr<�keysrrPr)r�key�value)rrrr�s
zEnvironGuard.tearDown)rr(r)rrr*rr)rrrPzsrPcCs(t�}|dkrtjd��tj||�dS)akHelper 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.
    Nz>cannot find xxmodule.c (test must run in the python build dir))�_get_xxmodule_path�unittestZSkipTestr4�copy)Z	directory�filenamerrr�copy_xxmodule_c�s
r[c	Csftjd�}tjjtjjt�d�tjj|dd�tjj|ddddd�g}x|D]}tjj|�rJ|SqJWdS)N�srcdirz
xxmodule.c�Modulesz..)�	sysconfig�get_config_varr,r=r>�dirname�__file__�exists)r\Z
candidatesr=rrrrW�s

rWcCs~tjdkrtjjd�|_n`tjd�rztjd�}|dkr@dg|_n:tj	dkrRg|_n(|j
d�\}}}d	d
�|jtj�D�|_dS)a�Function needed to make build_ext tests pass.

    When Python was built with --enable-shared on Unix, -L. is not enough to
    find libpython<blah>.so, because regrtest runs in a tempdir, not in the
    source directory where the .so lives.

    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.
    r0z_d.exe�Py_ENABLE_SHARED�	RUNSHAREDN�.�darwin�=cSsg|]}|r|�qSrr)r#r6rrrr%�sz#fixup_build_ext.<locals>.<listcomp>)
r,r5�sys�
executable�endswith�debugr^r_Zlibrary_dirs�platform�	partition�split�pathsep)�cmdZ	runsharedr5ZequalsrVrrr�fixup_build_ext�s




rq)rHr,rhr4r7rXr^rYrZ	distutilsrZ
distutils.logrrrrrZdistutils.corer	�objectr
r+rIrPr[rWrqrrrr�<module>s"#=

Youez - 2016 - github.com/yon3zu
LinuXploit