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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

�w2_g�@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
dd�Zdd�Zdd�Z
d	d
�Zddd�Zd
d�Zdd�Zedkr�e�dS)a�
Command line tool to bisect failing CPython tests.

Find the test_os test method which alters the environment:

    ./python -m test.bisect --fail-env-changed test_os

Find a reference leak in "test_os", write the list of failing tests into the
"bisect" file:

    ./python -m test.bisect -o bisect -R 3:3 test_os

Load an existing list of tests from a file using -i option:

    ./python -m test --list-cases -m FileTests test_os > tests
    ./python -m test.bisect -i tests test_os
�NcCs<t|d��(}x|D]}t||d�qW|j�WdQRXdS)N�w)�file)�open�print�flush)�filename�tests�fp�name�r�0/opt/alt/python36/lib64/python3.6/test/bisect.py�write_testss
r
cCs*|sdStdt|�|f�t||�|S)NzWriting %s tests into %s)r�lenr
)rrrrr�write_output&s

rcCs
dj|�S)N� )�join)�argsrrr�format_shell_args.srcCsftjdddg}|j|j�tj|tjdd�}|j}|rXt|�}t	d||f�tj
|�|jj�}|S)Nz-m�testz--list-casesT)�stdoutZuniversal_newlinesz1Failed to list tests: %s failed with exit code %s)
�sys�
executable�extend�	test_args�
subprocess�run�PIPE�
returncoderr�exitr�
splitlines)r�cmd�proc�exitcoderrrr�
list_cases2s

r#cCsltj�}zFt||�tjddd|g}|j|j�tdt|��t	j
|�}|jStj
j|�rftj|�XdS)Nz-mrz--matchfilez+ %s)�tempfileZmktempr
rrrrrrrrr�os�path�exists�unlink)rrZ
huntrleaksZtmpr r!rrr�	run_testsBs

r)cCsftj�}|jdddd�|jdddd�|jdd	td
dd�|jd
dtddd�|j�\}}||_|S)Nz-iz--inputzUTest names produced by --list-tests written into a file. If not set, run --list-tests)�helpz-oz--outputzResult of the bisectionz-nz--max-tests�z:Maximum number of tests to stop the bisection (default: 1))�type�defaultr*z-Nz
--max-iter�dz5Maximum number of bisection iterations (default: 100))�argparse�ArgumentParser�add_argument�intZparse_known_argsr)�parserrrrrr�
parse_argsQsr4cCs$t�}|jr2t|j��}dd�|D�}WdQRXnt|�}tdt|��tdt|j��td|j|j	f�t
|j|�}t�tj
�}d}y�x�t|�|jko�||j	k�rNt|�}t|dd�}tj||�}td|t|�t|�f�t�t||�}td	|t|�f�td
|�|�r6td�|}t
|j|�}ntd�t�|d7}q�WWn*tk
�r|t�td
�t�YnXtdt|��x|D]}	td|	��q�Wt�|�r�td|�tjtj
�|�}
t|�|jk�rtd|tj|
d�f�tjd�ntd|tj|
d�f�dS)NcSsg|]}|j��qSr)�strip)�.0�linerrr�
<listcomp>jszmain.<locals>.<listcomp>zStart bisection with %s testszTest arguments: %szxBisection will stop when getting %s or less tests (-n/--max-tests option), or after %s iterations (-N/--max-iter option)r+�z![+] Iteration %s: run %s tests/%szran %s tests/%srz*Tests failed: continuing with this subtestz;Tests succeeded: skipping this subtest, trying a new subsetzBisection interrupted!zTests (%s):z* %szOutput written into %sz+Bisection completed in %s iterations and %s)Zsecondsz+Bisection failed after %s iterations and %s)r4�inputrr#rrrrZ	max_testsZmax_iterr�output�timeZ	monotonic�max�randomZsampler)�KeyboardInterrupt�mathZceil�datetimeZ	timedeltarr)rr	rr;Z
start_timeZ	iterationZntestZsubtestsr"rZdtrrr�maines`


rB�__main__)N)�__doc__r/rAZos.pathr%r@r>rrr$r<r
rrr#r)r4rB�__name__rrrr�<module>s$
A

Youez - 2016 - github.com/yon3zu
LinuXploit