Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_poll.cpython-310.pyc
o

�9j�@s�ddlZddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZzejWne
y?e�d��wdd�ZGdd	�d	ej�Zed
krWe��dSdS)�N)�cpython_only)�threading_helper)�TESTFNzselect.poll not definedcCs(g}|D]
\}}||@r|�|�q|S)N)�append)�ready�flag�match�fd�mode�r�%/usr/lib/python3.10/test/test_poll.py�find_ready_matchings
�r
c@s`eZdZdd�Zdd�Zdd�Zdd�Zed	d
��Ze	j
dd��Ze�
ed
�e	j
dd���ZdS)�	PollTestscCsrt��}d}d}t|�}g}g}i}i}t|�D]-}	t��\}
}|�|
�|�|
tj�|�|tj	�|�
|
�|�
|�|||
<|
||<qg}|r�|��}
t|
tj	�}|sZtd��t
�|�}t�||�|��}
t|
tj�}|sutd��t
�|�}
t�|
|�}|�t|�|�|�
|�t�||
�t�|
�|�||
�|�|
�|�||
�|sJ|�||g|�dS)N�s This is a test.zno pipes ready for writingzno pipes ready for reading)�select�poll�len�range�os�pipe�register�modify�POLLIN�POLLOUTrr
�RuntimeError�random�choice�write�read�assertEqual�close�
unregister�remove)�self�p�	NUM_PIPES�MSG�MSG_LEN�readers�writers�r2w�w2r�i�rd�wr�bufsr�
ready_writers�
ready_readers�bufrrr�
test_poll1sN







�zPollTests.test_poll1c
Csht��\}}t�|�t�|�t��}|�|�|��}|�|d|tjf�tt	d��#}|�
�}t��}|�|�|��}|�|dd|�Wd�n1sSwY|��}|�|d|tjf�t�t	�t��}|�t
|j|�|�t
|j|�t��}|�t|jd�t��}Gdd�d�}Gdd�d�}	|�t
|j|�d�|�t
|j|	�d�dS)Nr�w�c@seZdZdS)z,PollTests.test_poll_unit_tests.<locals>.NopeN)�__name__�
__module__�__qualname__rrrr�Nopensr9c@seZdZdd�ZdS)z.PollTests.test_poll_unit_tests.<locals>.AlmostcSsdS)N�filenor)r#rrrr:rsz5PollTests.test_poll_unit_tests.<locals>.Almost.filenoN)r6r7r8r:rrrr�Almostqsr;)rrr rrrr�POLLNVAL�openrr:�unlink�assertRaises�	TypeErrorr!�KeyError)
r#�FDr4r$�r�fr	�pollsterr9r;rrr�test_poll_unit_testsOs6



�
zPollTests.test_poll_unit_testsc
Cs�d}tj|dtjdd�}|��|�|jddd�|j}t��}|�	|tj
�dD]A}|�|�}|gkr5q)|d\}}|tj@rN|��}	|	dkrM|�
d�q)|tj
@rc|��}	|	s\dS|�|	d�q)|�
d	|�q)dS)
Nz?for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; doneTr)�shell�stdout�bufsize)ri�i�i�i@i�>���rJrJrJrJrJrJrJrJrJ�z6error: pipe seems to be closed, but still returns datastesting...
z,Unexpected return value from select.poll: %s)�
subprocess�Popen�PIPE�	__enter__�
addCleanup�__exit__rHrrrr�POLLHUP�readline�failr)
r#�cmd�procr$rE�tout�fdlistr	�flags�linerrr�
test_poll2{s6�



�zPollTests.test_poll2cCs�t��}|�d�|�t|jd�d}|dkr|�d�|�t|jdd�|�t|jdd�|�t|jdd�|�t|jdd�dS)N�l�zOverflow must have occurredrrJ)rrrr?�
OverflowErrorrT�
ValueErrorr)r#rE�xrrr�
test_poll3�s

zPollTests.test_poll3cCs~ddlm}m}m}t��}|�d�|�t|jd|d�|�t|j	d|d�|�t|j|d�|�t|j|d�dS)Nr)�	USHRT_MAX�INT_MAX�UINT_MAXr\)
�	_testcapirbrcrdrrrr?r^r)r#rbrcrdrErrr�test_poll_c_limits�s
zPollTests.test_poll_c_limitsc
Cs�t��\}}|�tj|�|�tj|�g}td�D]}t�|�}|�tj|�|�|�qt��}|D]	}|�	|tj
�q4tj|jd�}|�
�z*t�d�|D]}|�|�qQ|�	|tj�|�t|j�Wt�|d�|��dSt�|d�|��w)N�
)�targetg�?�spam)rrrPr r�duprrrrr�	threading�Thread�start�time�sleepr!rr?rr�join)r#rCr4�rfdsr,r	rE�trrr�test_threaded_poll�s.

�
zPollTests.test_threaded_pollz!Threading required for this test.cCs�dD]H}t��\}}t��}|�|tj�tj|j|fd�}|��|j	dd�|�
|���t�|d�|�	�|�
|���t�|�t�|�qdS)N)Ni���rJg�g��������g0��.�+�)rh�argsg�������?)�timeoutri)rrrrrrrkrlrmrp�
assertTrue�is_aliver�assertFalser )r#�
timeout_msrCr4rE�poll_threadrrr�!test_poll_blocks_with_negative_ms�s
�z+PollTests.test_poll_blocks_with_negative_msN)r6r7r8r3rFr[rarrfr�reap_threadsrs�unittest�
skipUnlessrkr{rrrrrs1,


r�__main__)rrLrrrkrnr}�test.supportrr�test.support.os_helperrr�AttributeError�SkipTestr
�TestCaserr6�mainrrrr�<module>s*

�M�

Youez - 2016 - github.com/yon3zu
LinuXploit