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

�9j�@s`ddlZddlZddlZddlmZGdd�dej�ZGdd�dej�Ze	dkr.e�
�dSdS)�N)�systemc@sTeZdZdZdd�Zdd�Zdd�ZdZd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�ExceptionClassTestsz]Tests for anything relating to exception objects themselves (e.g.,
    inheritance hierarchy)cCs|�ttt��dS�N)�
assertTrue�
issubclass�	Exception�object��self�r�./usr/lib/python3.10/test/test_baseexception.py�test_builtins_new_stylesz+ExceptionClassTests.test_builtins_new_stylecCs,dD]}|�t||�d|jj|f�qdS)N)�args�__str__�__repr__z%s missing %s attribute)r�hasattr�	__class__�__name__)r
�ins�attrrrr�verify_instance_interfaces
���z-ExceptionClassTests.verify_instance_interfacec	Csvt�}tj��D]}z
t|t�r|�|j�Wqty Yqwt	t
j�t
j�
t�dd�dd�}z�|����}ztt|�}WntyP|�d|�Ynw|�||d|�|�|�g}d}|D]�}|��}|�d�}	||	dd�}
d	|
vr�|
�d	�}|
|d
d�}|
d|d
�}
t�|kr�|�|
�qed|
vr�|
�d�}
|
d|
d
�}
ztt|
�}Wnty�|�d
|
�Ynw||	kr�|�||f�n||	kr�|dd|	kr�|��|dd|	ks�|�t||dd
�d|j|dd
jf�z|�|��Wn
t�yYnw|�|
|�|�|
�|}|	}qeW|��n|��w|�t|�dd|�dS)Nrzexception_hierarchy.txtzutf-8)�encodingzbase class %s not a built-inz%s not found�-��(�����[z%s not a built-in exceptionz%s is not a subclass of %sz%s not accounted for) �set�builtins�__dict__�valuesr�
BaseException�addr�	TypeError�open�os�path�join�split�__file__�readline�rstrip�getattr�AttributeError�fail�assertIn�discard�rindex�index�platform_system�append�poprr�close�assertEqual�len)r
�exc_set�object_�inheritance_tree�superclass_name�last_exc�superclasses�
last_depth�exc_line�depth�exc_name�paren_index�
platform_name�left_bracket�excrrr�test_inheritances�
�����





�����
�#z$ExceptionClassTests.test_inheritance)�lengthr�str�reprc	Cs6t|j|�D]\}\}}|�||d|||f�qdS)Nz%s: %s != %s)�zip�interface_testsr8)r
�results�	test_name�given�expectedrrr�interface_test_driverUs

��z)ExceptionClassTests.interface_test_drivercCsZd}t|�}t|j�dg|jd|gt|�t|�gt|�d|jj|fgf}|�|�dS)N�spamrrz%s(%r))rr9rrJrKrrrR)r
�argrGrNrrr�test_interface_single_argZs�z-ExceptionClassTests.test_interface_single_argcCsdd}tt|��}t|�}t|j�|g|j|gt|�t|�gt|�|jjt|j�gf}|�	|�dS)N�)
�tuple�rangerr9rrJrKrrrR)r
�	arg_countrrGrNrrr�test_interface_multi_argcs�z,ExceptionClassTests.test_interface_multi_argcCsJt�}t|j�dg|jt�gt|�dgt|�|jjdgf}|�|�dS)Nr�z())	rr9rrWrJrKrrrR)r
rGrNrrr�test_interface_no_argms
�z)ExceptionClassTests.test_interface_no_argcsXddl}i�G�fdd�dt�}Gdd�dt�}t�}|��|�<|���|��dS)Nrcs$eZdZdef��fdd�Z�ZS)zXExceptionClassTests.test_setstate_refcount_no_crash.<locals>.HashThisKeyWillClearTheDict�returncs���t���Sr)�clear�super�__hash__r	)r�drrr`{s
zaExceptionClassTests.test_setstate_refcount_no_crash.<locals>.HashThisKeyWillClearTheDict.__hash__)r�
__module__�__qualname__�intr`�
__classcell__r�ra)rr�HashThisKeyWillClearTheDictzsrgc@�eZdZdS)zBExceptionClassTests.test_setstate_refcount_no_crash.<locals>.ValueN�rrbrcrrrr�Value~�rj)�gcrJr�__setstate__�collect)r
rlrgrjrGrrfr�test_setstate_refcount_no_crashus
z3ExceptionClassTests.test_setstate_refcount_no_crashN)
rrbrc�__doc__r
rrHrMrRrUrZr\rorrrrrs>	
rc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�
UsageTestszTest usage of exceptionscCsz|�tyYdSw)z6Make sure that raising 'object_' triggers a TypeError.N)r$r/�type�r
r;rrr�raise_fails�s
�zUsageTests.raise_failscCs�zzt�|yYnwWntyYnty(|�dt|��Ynwzzt�|fy8YWdSwtyBYdStyT|�dt|��YdSw)z,Catching 'object_' should raise a TypeError.z#TypeError expected when catching %sNz;TypeError expected when catching %s as specified in a tuple)rr$r/rrrsrrr�catch_fails�s2�����zUsageTests.catch_failscC�*Gdd�dt�}|�|�|�|��dS)Nc@rh)zDUsageTests.test_raise_new_style_non_exception.<locals>.NewStyleClassNrirrrr�
NewStyleClass�rkrw)rrt)r
rwrrr�"test_raise_new_style_non_exception�s
z-UsageTests.test_raise_new_style_non_exceptioncC�|�d�dS�NrS)rtr	rrr�test_raise_string��zUsageTests.test_raise_stringcCrv)Nc@rh)zAUsageTests.test_catch_non_BaseException.<locals>.NonBaseExceptionNrirrrr�NonBaseException�rkr})rru)r
r}rrr�test_catch_non_BaseException�s
z'UsageTests.test_catch_non_BaseExceptioncCs|�t��dSr)rur"r	rrr�!test_catch_BaseException_instance�sz,UsageTests.test_catch_BaseException_instancecCryrz)rur	rrr�test_catch_string�r|zUsageTests.test_catch_stringN)rrbrcrprtrurxr{r~rr�rrrrrq�s
rq�__main__)�unittestrr&�platformrr4�TestCaserrqr�mainrrrr�<module>sB�

Youez - 2016 - github.com/yon3zu
LinuXploit