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_sys_setprofile.cpython-36.opt-1.pyc
3

x2_�+�@s�ddlZddlZddlZddlZGdd�dej�ZGdd�d�ZGdd�de�ZGdd	�d	ej�ZGd
d�de�Z	Gdd
�d
e�Z
dd�Zdd�Zee�Z
ddd�Zdd�Zedkr�ej�dS)�Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestGetProfilecCstjd�dS)N)�sys�
setprofile)�self�r�=/opt/alt/python36/lib64/python3.6/test/test_sys_setprofile.py�setUpszTestGetProfile.setUpcCstjd�dS)N)rr)rrrr�tearDownszTestGetProfile.tearDowncCs|jtj��dS)N)ZassertIsNoner�
getprofile)rrrr�
test_emptyszTestGetProfile.test_emptycCs&dd�}tj|�|jtj�|�dS)NcWsdS)Nr)�argsrrr�fnsz&TestGetProfile.test_setget.<locals>.fn)rrZassertIsr
)rr
rrr�test_setgets
zTestGetProfile.test_setgetN)�__name__�
__module__�__qualname__rr	rrrrrrrsrc@s.eZdZdd�Zdd�Zd
dd�Zdd	�ZdS)�HookWatchercCsg|_g|_dS)N)�frames�events)rrrr�__init__szHookWatcher.__init__cCs(|dks|dks|dkr$|j||�dS)N�call�return�	exception)�	add_event)r�frame�event�argrrr�callbackszHookWatcher.callbackNc
Csh|dkrtjd�}y|jj|�}Wn*tk
rLt|j�}|jj|�YnX|jj||t|�f�dS)zAdd an event to the log.N�)	r�	_getframer�index�
ValueError�len�appendr�ident)rrrZframenorrrr#s

zHookWatcher.add_eventcs.t|jj�tt�g�d|_�fdd�|jD�S)zRemove calls to add_event().Ncsg|]}|d�kr|�qS)�r)�.0�item)�
disallowedrr�
<listcomp>5sz*HookWatcher.get_events.<locals>.<listcomp>)r$r�__func__rr)rr)r(r�
get_events0szHookWatcher.get_events)N)rrrrrrr+rrrrrs

rc@sNeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zeeeeeed
�Z	dS)�ProfileSimulatorcCs||_g|_tj|�dS)N)�testcase�stackrr)rr-rrrr9szProfileSimulator.__init__cCs|j|||�dS)N)�dispatch)rrrrrrrr>szProfileSimulator.callbackcCs|jd|�|jj|�dS)Nr)rr.r#)rrrrr�
trace_callBszProfileSimulator.trace_callcCs|jd|�|jj�dS)Nr)rr.�pop)rrrrr�trace_returnFszProfileSimulator.trace_returncCs|jjd�dS)Nz2the profiler should never receive exception events)r-�fail)rrrrr�trace_exceptionJsz ProfileSimulator.trace_exceptioncCsdS)Nr)rrrrr�
trace_passNszProfileSimulator.trace_pass)rrrZc_callZc_returnZc_exceptionN)
rrrrrr0r2r4r5r/rrrrr,8sr,c@seZdZdd�ZdS)�TestCaseBasecCs8t||j��}||kr4|jdtj|�tj|�f�dS)Nz'Expected events:
%s
Received events:
%s)�capture_events�new_watcherr3�pprintZpformat)r�callableZexpectedrrrr�check_events\szTestCaseBase.check_eventsN)rrrr;rrrrr6[sr6c@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�ProfileHookTestCasecCst�S)N)r)rrrrr8dszProfileHookTestCase.new_watchercCs0dd�}t|�}|j|dd|fdd|fg�dS)NcSsdS)Nr)�prrr�fhsz*ProfileHookTestCase.test_simple.<locals>.frrr)r$r;)rr>�f_identrrr�test_simplegszProfileHookTestCase.test_simplecCs0dd�}t|�}|j|dd|fdd|fg�dS)NcSsdddS)Nrrr)r=rrrr>psz-ProfileHookTestCase.test_exception.<locals>.frrr)r$r;)rr>r?rrr�test_exceptionosz"ProfileHookTestCase.test_exceptioncCs0dd�}t|�}|j|dd|fdd|fg�dS)Nc	SsyddWnYnXdS)Nrrr)r=rrrr>xsz4ProfileHookTestCase.test_caught_exception.<locals>.frrr)r$r;)rr>r?rrr�test_caught_exceptionwsz)ProfileHookTestCase.test_caught_exceptioncCs0dd�}t|�}|j|dd|fdd|fg�dS)Nc	SsyddWnYnXdS)Nrrr)r=rrrr>�sz;ProfileHookTestCase.test_caught_nested_exception.<locals>.frrr)r$r;)rr>r?rrr�test_caught_nested_exception�sz0ProfileHookTestCase.test_caught_nested_exceptioncCs0dd�}t|�}|j|dd|fdd|fg�dS)NcSsdddS)Nrrr)r=rrrr>�sz4ProfileHookTestCase.test_nested_exception.<locals>.frrr)r$r;)rr>r?rrr�test_nested_exception�sz)ProfileHookTestCase.test_nested_exceptionc
sddd���fdd�}t��}t|�}|j|dd|fdd|fdd|fd	d|fd	d|fdd|fg�dS)
NcSsdddS)Nrrr)r=rrrr>�sz>ProfileHookTestCase.test_exception_in_except_clause.<locals>.fcs8y�|�Wn&y�|�WnYnXYnXdS)Nr)r=)r>rr�g�sz>ProfileHookTestCase.test_exception_in_except_clause.<locals>.grrr%r�)r$r;)rrEr?�g_identr)r>r�test_exception_in_except_clause�sz3ProfileHookTestCase.test_exception_in_except_clausec	s\dd���fdd�}t��}t|�}|j|dd|fdd|fdd|fdd	|fdd|fg�dS)
NcSsdddS)Nrrr)r=rrrr>�sz9ProfileHookTestCase.test_exception_propagation.<locals>.fcsz�|�Wd|jd�XdS)Nzfalling through)r)r=)r>rrrE�sz9ProfileHookTestCase.test_exception_propagation.<locals>.grrr%rzfalling through)r$r;)rrEr?rGr)r>r�test_exception_propagation�sz.ProfileHookTestCase.test_exception_propagationcCs0dd�}t|�}|j|dd|fdd|fg�dS)Nc	Ss&yddWnddYnXdS)Nrrr)r=rrrr>�sz/ProfileHookTestCase.test_raise_twice.<locals>.frrr)r$r;)rr>r?rrr�test_raise_twice�sz$ProfileHookTestCase.test_raise_twicecCs0dd�}t|�}|j|dd|fdd|fg�dS)Nc	Ss yddWn�YnXdS)Nrrr)r=rrrr>�sz1ProfileHookTestCase.test_raise_reraise.<locals>.frrr)r$r;)rr>r?rrr�test_raise_reraise�sz&ProfileHookTestCase.test_raise_reraisecCs0dd�}t|�}|j|dd|fdd|fg�dS)NcSs
t��dS)N)�	Exception)r=rrrr>�sz)ProfileHookTestCase.test_raise.<locals>.frrr)r$r;)rr>r?rrr�
test_raise�szProfileHookTestCase.test_raisecs�dd���fdd���fdd���fdd���fd	d
�}t��}t��}t��}t��}t|�}|j|dd|fd
d|fdd|fdd|fdd|fdd|fdd|fdd|fd
d|fdd|fg
�dS)NcSsdddS)Nrrrrrrrr>�sz5ProfileHookTestCase.test_distant_exception.<locals>.fcs
��dS)Nrr)r>rrrE�sz5ProfileHookTestCase.test_distant_exception.<locals>.gcs
��dS)Nrr)rErr�h�sz5ProfileHookTestCase.test_distant_exception.<locals>.hcs
��dS)Nrr)rNrr�i�sz5ProfileHookTestCase.test_distant_exception.<locals>.ics
��dS)Nr)r=)rOrr�j�sz5ProfileHookTestCase.test_distant_exception.<locals>.jrrr%rF��r)r$r;)rrPr?rG�h_ident�i_ident�j_identr)r>rErNrOr�test_distant_exception�s(z*ProfileHookTestCase.test_distant_exceptioncstdd���fdd�}t��}t|�}|j|dd|fdd|fdd|fdd|fdd|fdd|fdd|fdd|fg�dS)	Ncssxtd�D]
}|Vq
WdS)Nr%)�range)rOrrrr>�sz-ProfileHookTestCase.test_generator.<locals>.fcsx��D]}qWdS)Nr)r=rO)r>rrrE�sz-ProfileHookTestCase.test_generator.<locals>.grrr%r)r$r;)rrEr?rGr)r>r�test_generator�sz"ProfileHookTestCase.test_generatorcstdd���fdd�}t��}t|�}|j|dd|fdd|fdd|fdd|fdd|fdd|fdd|fdd|fg�dS)	Ncssxtd�D]
}|Vq
WdS)Nr%)rW)rOrrrr>sz2ProfileHookTestCase.test_stop_iteration.<locals>.fcsx��D]}qWdS)Nr)r=rO)r>rrrEsz2ProfileHookTestCase.test_stop_iteration.<locals>.grrr%r)r$r;)rrEr?rGr)r>r�test_stop_iterationsz'ProfileHookTestCase.test_stop_iterationN)rrrr8r@rArBrCrDrHrIrJrKrMrVrXrYrrrrr<cs				r<c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�ProfileSimulatorTestCasecCst|�S)N)r,)rrrrr8sz$ProfileSimulatorTestCase.new_watchercCs0dd�}t|�}|j|dd|fdd|fg�dS)NcSsdS)Nr)r=rrrr>sz/ProfileSimulatorTestCase.test_simple.<locals>.frrr)r$r;)rr>r?rrrr@sz$ProfileSimulatorTestCase.test_simplecCs0dd�}t|�}|j|dd|fdd|fg�dS)NcSsdddS)Nrrr)r=rrrr>%sz8ProfileSimulatorTestCase.test_basic_exception.<locals>.frrr)r$r;)rr>r?rrr�test_basic_exception$sz-ProfileSimulatorTestCase.test_basic_exceptioncCs0dd�}t|�}|j|dd|fdd|fg�dS)Nc	SsyddWnYnXdS)Nrrr)r=rrrr>-sz9ProfileSimulatorTestCase.test_caught_exception.<locals>.frrr)r$r;)rr>r?rrrrB,sz.ProfileSimulatorTestCase.test_caught_exceptioncs�dd���fdd���fdd���fdd���fd	d
�}t��}t��}t��}t��}t|�}|j|dd|fd
d|fdd|fdd|fdd|fdd|fdd|fdd|fd
d|fdd|fg
�dS)NcSsdddS)Nrrrrrrrr>6sz:ProfileSimulatorTestCase.test_distant_exception.<locals>.fcs
��dS)Nrr)r>rrrE8sz:ProfileSimulatorTestCase.test_distant_exception.<locals>.gcs
��dS)Nrr)rErrrN:sz:ProfileSimulatorTestCase.test_distant_exception.<locals>.hcs
��dS)Nrr)rNrrrO<sz:ProfileSimulatorTestCase.test_distant_exception.<locals>.ics
��dS)Nr)r=)rOrrrP>sz:ProfileSimulatorTestCase.test_distant_exception.<locals>.jrrr%rFrQrRr)r$r;)rrPr?rGrSrTrUr)r>rErNrOrrV5s(z/ProfileSimulatorTestCase.test_distant_exceptionN)rrrr8r@r[rBrVrrrrrZs
	rZcCs$t|d�r|j}n|j}|j|jfS)N�f_code)�hasattrr\�__code__�co_firstlineno�co_name)Zfunction�coderrrr$Rs
r$c	Csy||�WnYnXdS)Nr)r>r=rrr�protectZsrbcCsb|dkrt�}tj�}tj�z$tj|j�t||�tjd�Wd|rPtj�X|j	�dd�S)Nr���)
r�gc�	isenabled�disablerrrrb�enabler+)r:r=Zold_gcrrrr7as

r7cCsddl}|jt|��dS)Nr)r9r7)r:r9rrr�show_eventsrsrh�__main__)N)rdr9rZunittestZTestCaserrr,r6r<rZr$rbZ
protect_identr7rhr�mainrrrr�<module>s" #6:


Youez - 2016 - github.com/yon3zu
LinuXploit