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_sys_setprofile.cpython-310.pyc
o

�9j�4�@s�ddlZddlZddlZddlZddlmZGdd�dej�ZGdd�d�ZGdd�de�Z	Gd	d
�d
ej�Z
Gdd�de
�ZGd
d�de
�Zdd�Z
dd�Ze
e�Zddd�Zdd�ZGdd�dej�Zedkroe��dSdS)�N)�supportc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestGetProfilecC�t�d�dS�N��sys�
setprofile��self�r�//usr/lib/python3.10/test/test_sys_setprofile.py�setUp	�zTestGetProfile.setUpcCrrrr	rrr�tearDownrzTestGetProfile.tearDowncCs|�t���dSr)�assertIsNoner�
getprofiler	rrr�
test_emptyszTestGetProfile.test_emptycCs&dd�}t�|�|�t��|�dS)NcW�dSrr��argsrrr�fn�z&TestGetProfile.test_setget.<locals>.fn)rr�assertIsr)r
rrrr�test_setgets
zTestGetProfile.test_setgetN)�__name__�
__module__�__qualname__r
rrrrrrrrs
rc@s.eZdZdd�Zdd�Zd
dd�Zdd	�ZdS)�HookWatchercCsg|_g|_dSr)�frames�eventsr	rrr�__init__s
zHookWatcher.__init__cCs,|dks|dks|dkr|�||�dSdS)N�call�return�	exception��	add_event�r
�frame�event�argrrr�callbacks
�zHookWatcher.callbackNcCsf|dur	t�d�}z|j�|�}Wnty%t|j�}|j�|�Ynw|j�||t|�f�dS)zAdd an event to the log.N�)	r�	_getframer�index�
ValueError�len�appendr�ident)r
r(r'�framenorrrr%$s

�zHookWatcher.add_eventcs.t|jj�tt�g�d|_�fdd�|jD�S)zRemove calls to add_event().Ncsg|]
}|d�vr|�qS)�r)�.0�item��
disallowedrr�
<listcomp>6sz*HookWatcher.get_events.<locals>.<listcomp>)r1r%�__func__rrr	rr6r�
get_events1szHookWatcher.get_eventsr)rrrr r*r%r:rrrrrs


rc@sNeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zeeeeeed
�Z	dS)�ProfileSimulatorcCs||_g|_t�|�dSr)�testcase�stackrr )r
r<rrrr :szProfileSimulator.__init__cCs|j|||�dSr)�dispatchr&rrrr*?szProfileSimulator.callbackcCs|�d|�|j�|�dS)Nr!)r%r=r0�r
r'rrr�
trace_callCszProfileSimulator.trace_callcCs|�d|�|j��dS)Nr")r%r=�popr?rrr�trace_returnGszProfileSimulator.trace_returncCs|j�d�dS)Nz2the profiler should never receive exception events)r<�failr?rrr�trace_exceptionKs�z ProfileSimulator.trace_exceptioncCrrrr?rrr�
trace_passOrzProfileSimulator.trace_pass)r!r#r"�c_call�c_return�c_exceptionN)
rrrr r*r@rBrDrEr>rrrrr;9s
�r;c@seZdZdd�ZdS)�TestCaseBasecCs<t||���}||kr|�dt�|�t�|�f�dSdS)Nz'Expected events:
%s
Received events:
%s)�capture_events�new_watcherrC�pprint�pformat)r
�callable�expectedrrrr�check_events]s
��zTestCaseBase.check_eventsN)rrrrPrrrrrI\srIc@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�ProfileHookTestCasecCst�Sr)rr	rrrrKe�zProfileHookTestCase.new_watchercC�0dd�}t|�}|�|dd|fdd|fg�dS)NcSrrr��prrr�firz*ProfileHookTestCase.test_simple.<locals>.fr+r!r"�r1rP�r
rV�f_identrrr�test_simpleh�

�zProfileHookTestCase.test_simplecCrS)NcS�dddS�Nr+rrrTrrrrVq�z-ProfileHookTestCase.test_exception.<locals>.fr+r!r"rWrXrrr�test_exceptionpr[z"ProfileHookTestCase.test_exceptioncCrS)NcS�zddWdSYdSr]rrTrrrrVy�z4ProfileHookTestCase.test_caught_exception.<locals>.fr+r!r"rWrXrrr�test_caught_exceptionx�

�z)ProfileHookTestCase.test_caught_exceptioncCrS)NcSr`r]rrTrrrrV�raz;ProfileHookTestCase.test_caught_nested_exception.<locals>.fr+r!r"rWrXrrr�test_caught_nested_exception�rcz0ProfileHookTestCase.test_caught_nested_exceptioncCrS)NcSr\r]rrTrrrrV�r^z4ProfileHookTestCase.test_nested_exception.<locals>.fr+r!r"rWrXrrr�test_nested_exception�s

�z)ProfileHookTestCase.test_nested_exceptioncsddd���fdd�}t��}t|�}|�|dd|fdd|fdd|fd	d|fd	d|fdd|fg�dS)
NcSr\r]rrTrrrrV�r^z>ProfileHookTestCase.test_exception_in_except_clause.<locals>.fc	s6z�|�WdSz�|�WYdSYYdSrrrT�rVrr�g�s
z>ProfileHookTestCase.test_exception_in_except_clause.<locals>.gr+r!r3r"�rW�r
rgrY�g_identrrfr�test_exception_in_except_clause�s
�z3ProfileHookTestCase.test_exception_in_except_clausec
s\dd���fdd�}t��}t|�}|�|dd|fdd|fdd|fdd	|fdd|fg�dS)
NcSr\r]rrTrrrrV�r^z9ProfileHookTestCase.test_exception_propagation.<locals>.fc	s&z�|�W|�d�dS|�d�w)N�falling throughr$rTrfrrrg�sz9ProfileHookTestCase.test_exception_propagation.<locals>.gr+r!r3r"rlrWrirrfr�test_exception_propagation�s
�z.ProfileHookTestCase.test_exception_propagationcCrS)NcSs$zddWdSddYdSr]rrTrrrrV�sz/ProfileHookTestCase.test_raise_twice.<locals>.fr+r!r"rWrXrrr�test_raise_twice�rcz$ProfileHookTestCase.test_raise_twicecCrS)NcSszddWdS�r]rrTrrrrV�sz1ProfileHookTestCase.test_raise_reraise.<locals>.fr+r!r"rWrXrrr�test_raise_reraise�rcz&ProfileHookTestCase.test_raise_reraisecCrS)NcSst��r)�	ExceptionrTrrrrV�rRz)ProfileHookTestCase.test_raise.<locals>.fr+r!r"rWrXrrr�
test_raise�r[zProfileHookTestCase.test_raisec�dd���fdd���fdd���fdd���fd	d
�}t��}t��}t��}t��}t|�}|�|dd|fd
d|fdd|fdd|fdd|fdd|fdd|fdd|fd
d|fdd|fg
�dS)NcSr\r]rrrrrrV�r^z5ProfileHookTestCase.test_distant_exception.<locals>.fc�
��dSrrrrfrrrg��
z5ProfileHookTestCase.test_distant_exception.<locals>.gcrsrrr�rgrr�h�rtz5ProfileHookTestCase.test_distant_exception.<locals>.hcrsrrr�rvrr�i�rtz5ProfileHookTestCase.test_distant_exception.<locals>.icrsrrrT�rxrr�j�rtz5ProfileHookTestCase.test_distant_exception.<locals>.jr+r!r3rh��r"rW�r
rzrYrj�h_ident�i_ident�j_identr�rVrgrvrxr�test_distant_exception��*
�z*ProfileHookTestCase.test_distant_exceptionc
�tdd���fdd�}t��}t|�}|�|dd|fdd|fdd|fdd|fdd|fdd|fdd|fdd|fg�dS)	Ncs��td�D]}|VqdS�Nr3��rangeryrrrrV����z-ProfileHookTestCase.test_generator.<locals>.fc���D]}qdSrr�rUrxrfrrrg��
�z-ProfileHookTestCase.test_generator.<locals>.gr+r!r3r"rWrirrfr�test_generator�s
�z"ProfileHookTestCase.test_generatorc
r�)	Ncsr�r�r�ryrrrrVr�z2ProfileHookTestCase.test_stop_iteration.<locals>.fcr�rrr�rfrrrgr�z2ProfileHookTestCase.test_stop_iteration.<locals>.gr+r!r3r"rWrirrfr�test_stop_iterations
�z'ProfileHookTestCase.test_stop_iterationN)rrrrKrZr_rbrdrerkrmrnrorqr�r�r�rrrrrQds				rQc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�ProfileSimulatorTestCasecCst|�Sr)r;r	rrrrKsz$ProfileSimulatorTestCase.new_watchercCrS)NcSrrrrTrrrrVrz/ProfileSimulatorTestCase.test_simple.<locals>.fr+r!r"rWrXrrrrZr[z$ProfileSimulatorTestCase.test_simplecCrS)NcSr\r]rrTrrrrV&r^z8ProfileSimulatorTestCase.test_basic_exception.<locals>.fr+r!r"rWrXrrr�test_basic_exception%r[z-ProfileSimulatorTestCase.test_basic_exceptioncCrS)NcSr`r]rrTrrrrV.raz9ProfileSimulatorTestCase.test_caught_exception.<locals>.fr+r!r"rWrXrrrrb-rcz.ProfileSimulatorTestCase.test_caught_exceptioncrr)NcSr\r]rrrrrrV7r^z:ProfileSimulatorTestCase.test_distant_exception.<locals>.fcrsrrrrfrrrg9rtz:ProfileSimulatorTestCase.test_distant_exception.<locals>.gcrsrrrrurrrv;rtz:ProfileSimulatorTestCase.test_distant_exception.<locals>.hcrsrrrrwrrrx=rtz:ProfileSimulatorTestCase.test_distant_exception.<locals>.icrsrrrTryrrrz?rtz:ProfileSimulatorTestCase.test_distant_exception.<locals>.jr+r!r3rhr{r|r"rWr}rr�rr�6r�z/ProfileSimulatorTestCase.test_distant_exceptionc�8i��fdd�}t|�}|�|dd|fdd|fg�dS)Ncstjidfi���dS�N�*��dict�getrT��kwargsrrrVU�z7ProfileSimulatorTestCase.test_unbound_method.<locals>.fr+r!r"rWrXrr�r�test_unbound_methodS�
�z,ProfileSimulatorTestCase.test_unbound_methodcCrS)NcSst��dSrr�rTrrrrV]r^z?ProfileSimulatorTestCase.test_unbound_method_no_args.<locals>.fr+r!r"rWrXrrr�test_unbound_method_no_args\r[z4ProfileSimulatorTestCase.test_unbound_method_no_argscCrS)NcSst�td�dSr��r�r��printrTrrrrVeszDProfileSimulatorTestCase.test_unbound_method_invalid_args.<locals>.fr+r!r"rWrXrrr� test_unbound_method_invalid_argsdr[z9ProfileSimulatorTestCase.test_unbound_method_invalid_argscr�)Ncstjdi���dS)Nrr�rTr�rrrVnszGProfileSimulatorTestCase.test_unbound_method_no_keyword_args.<locals>.fr+r!r"rWrXrr�r�#test_unbound_method_no_keyword_argslr�z<ProfileSimulatorTestCase.test_unbound_method_no_keyword_argscr�)Ncstjtdfi���dSr�r�rTr�rrrVwr�zLProfileSimulatorTestCase.test_unbound_method_invalid_keyword_args.<locals>.fr+r!r"rWrXrr�r�(test_unbound_method_invalid_keyword_argsur�zAProfileSimulatorTestCase.test_unbound_method_invalid_keyword_argsN)
rrrrKrZr�rbr�r�r�r�r�r�rrrrr�s			r�cCs$t|d�r	|j}n|j}|j|jfS)N�f_code)�hasattrr��__code__�co_firstlineno�co_name)�function�coderrrr1~s
r1cCsz||�WdSYdSrr)rVrUrrr�protect�rar�cCsp|durt�}t��}t��zt�|j�t||�t�d�W|r't��n|r/t��ww|�	�dd�S)Nr+���)
r�gc�	isenabled�disablerrr*r��enabler:)rNrU�old_gcrrrrJ�s
��
�rJcCsddl}|�t|��dS)Nr)rLrJ)rNrLrrr�show_events�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)�
TestEdgeCasescCs |�tjt���t�d�dSr)�
addCleanuprrrr	rrrr
�szTestEdgeCases.setUpcs�dd�}dd��G�fdd�d�}t�|��t���}t�|�|�|jj|j�|�|jj	t
�Wd�n1s<wY|�t��|�dS)NcWrrrrrrr�foo�rz*TestEdgeCases.test_reentrancy.<locals>.foocWrrrrrrr�bar�rz*TestEdgeCases.test_reentrancy.<locals>.barcs eZdZdd�Z�fdd�ZdS)z(TestEdgeCases.test_reentrancy.<locals>.AcWrrr)r
rrrr�__call__�rz1TestEdgeCases.test_reentrancy.<locals>.A.__call__cst���dSrrr	�r�rr�__del__�rz0TestEdgeCases.test_reentrancy.<locals>.A.__del__N)rrrr�r�rr�rr�A�sr�)rrr�catch_unraisable_exception�assertEqual�
unraisable�objectr��assertIsInstance�	exc_value�RuntimeErrorr)r
r�r��cmrr�r�test_reentrancy�s

�zTestEdgeCases.test_reentrancycCs&dd�}t�|�~t�t���dS)NcWrrrrrrrr��rz+TestEdgeCases.test_same_object.<locals>.foo)rrr)r
r�rrr�test_same_object�s
zTestEdgeCases.test_same_objectN)rrrr
r�r�rrrrr��sr��__main__r)r�rLr�unittest�testr�TestCaserrr;rIrQr�r1r��
protect_identrJr�r�r�mainrrrr�<module>s* #6e
&�

Youez - 2016 - github.com/yon3zu
LinuXploit