403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.230
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_exception_hierarchy.cpython-36.pyc
3

�w2_��@s�ddlZddlZddlZddlZddlZddlZddlmZGdd�de�ZGdd�de�Z	Gdd�de�Z
Gd	d
�d
e	e
�ZGdd�de
e	�ZGd
d�de�Z
Gdd�dej�ZGdd�dej�ZGdd�dej�Zedkr�ej�dS)�N)�EEXISTc@seZdZdS)�
SubOSErrorN)�__name__�
__module__�__qualname__�rr�B/opt/alt/python36/lib64/python3.6/test/test_exception_hierarchy.pyr
srcseZdZ�fdd�Z�ZS)�SubOSErrorWithInitcs||_t�j|�dS)N)�bar�super�__init__)�self�messager
)�	__class__rrrszSubOSErrorWithInit.__init__)rrrr�
__classcell__rr)rrr	
sr	cseZdZ�fdd�Z�ZS)�SubOSErrorWithNewcst�j||�}||_|S)N)r�__new__�baz)�clsrrr
)rrrrszSubOSErrorWithNew.__new__)rrrrrrr)rrrsrc@seZdZdS)�SubOSErrorCombinedInitFirstN)rrrrrrrrsrc@seZdZdS)�SubOSErrorCombinedNewFirstN)rrrrrrrrsrc@seZdZdd�ZdS)�SubOSErrorWithStandaloneInitcCsdS)Nr)r
rrrrsz%SubOSErrorWithStandaloneInit.__init__N)rrrrrrrrrsrc@sHeZdZdd�Zdd�Zdd�ZdZdd	�Zee�Zd
d�Z	dd
�Z
dS)�
HierarchyTestcCs*|jtjd�|jtt�|jtt�dS)N�OSError)�assertEqualrr�assertIs�IOError�EnvironmentError)r
rrr�test_builtin_errors%sz!HierarchyTest.test_builtin_errorscCsB|jtjt�|jtjjt�|jtjjt�|jtjjt�dS)N)	r�socket�errorrZgaierror�__base__rZherrorZtimeout)r
rrr�test_socket_errors*sz HierarchyTest.test_socket_errorscCs|jtjt�dS)N)r�selectr r)r
rrr�test_select_error0szHierarchyTest.test_select_errorae
        +-- BlockingIOError        EAGAIN, EALREADY, EWOULDBLOCK, EINPROGRESS
        +-- ChildProcessError                                          ECHILD
        +-- ConnectionError
            +-- BrokenPipeError                              EPIPE, ESHUTDOWN
            +-- ConnectionAbortedError                           ECONNABORTED
            +-- ConnectionRefusedError                           ECONNREFUSED
            +-- ConnectionResetError                               ECONNRESET
        +-- FileExistsError                                            EEXIST
        +-- FileNotFoundError                                          ENOENT
        +-- InterruptedError                                            EINTR
        +-- IsADirectoryError                                          EISDIR
        +-- NotADirectoryError                                        ENOTDIR
        +-- PermissionError                                     EACCES, EPERM
        +-- ProcessLookupError                                          ESRCH
        +-- TimeoutError                                            ETIMEDOUT
    cCsli}xb|j�D]V}|jd�}|s"q|jd�\}}}x0td|j�jd��D]}tt|�|tt|�<qHWqW|S)Nz+- � z, )�
splitlines�strip�	partition�filter�split�getattr�builtins�errno)�s�_map�lineZexcname�_ZerrnamesZerrnamerrr�	_make_mapFs
zHierarchyTest._make_mapcCs�ttd�}|jt|�t�x0|jj�D]"\}}t|d�}|jt|�|�q&Wttj	�t|j�}x&|D]}t|d�}|jt|�t�qfWdS)NzBad file descriptorzSome message)
rrr�type�FileExistsErrorr/�items�setr-�	errorcode)r
�eZerrcode�excZ
othercodesrrr�test_errno_mappingRs



z HierarchyTest.test_errno_mappingcCstd}yt|�Wntk
r$YnX|jd�|jtjj|��ytj|�Wntk
rdYnX|jd�dS)NZ some_hopefully_non_existing_filez&should have raised a FileNotFoundError)�open�FileNotFoundErrorZfailZassertFalse�os�path�exists�unlink)r
�filenamerrr�test_try_except`s
zHierarchyTest.test_try_exceptN)rrrrr"r$Z_pep_mapr2r/r:rBrrrrr#s
rc@s>eZdZdd�Zdd�Zejejdkd�dd��Z	d	d
�Z
dS)�AttributesTestcCs0tjdkr|jdtt��n|jdtt��dS)N�nt�winerror)r=�nameZassertIn�dirrZassertNotIn)r
rrr�test_windows_errorzs
z!AttributesTest.test_windows_errorcCsdttdd�}|j|jt�|j|jdt�|j|jd�|j|jd�tjdkr`|j|j	d�dS)NzFile already existszfoo.txtrrD)
rrrr-�args�strerrorrAr=rFrE)r
r8rrr�test_posix_error�s
zAttributesTest.test_posix_errorrDzWindows-specific testcCs\tdddd�}|j|jd�|j|jt�|j|jdt�|j|jd�|j|jd�dS)NrzFile already existszfoo.txt�)rrrEr-rrIrJrA)r
r8rrr�test_errno_translation�sz%AttributesTest.test_errno_translationc
Cstd	}x<td�D]0}t|d|��}|jt��|jWdQRXqWtddd�}|j|jd�d|_|j|jd�dS)
N�a�b�c�dr8���)rNrOrPrQr8)�range�BlockingIOErrorZassertRaises�AttributeError�characters_writtenr)r
rI�nr8rrr�test_blockingioerror�sz#AttributesTest.test_blockingioerrorN)rrrrHrK�unittestZ
skipUnlessr=rFrMrZrrrrrCxs	
rCc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�ExplicitSubclassingTestcCsttd�}|jt|�t�dS)NzBad file descriptor)rrrr3)r
r8rrrr:�s
z*ExplicitSubclassingTest.test_errno_mappingcCs*tdd�}|j|jd�|j|jd�dS)N�some messager)r])r	rr
rI)r
r8rrr�test_init_overridden�s
z,ExplicitSubclassingTest.test_init_overriddencCs,tddd�}|j|jd�|j|jd�dS)N�some messager)r
)r_)r	rr
rI)r
r8rrr�test_init_kwdargs�sz)ExplicitSubclassingTest.test_init_kwdargscCs*tdd�}|j|jd�|j|jd�dS)N�some messager)ra)rrrrI)r
r8rrr�test_new_overridden�s
z+ExplicitSubclassingTest.test_new_overriddencCs,tddd�}|j|jd�|j|jd�dS)N�some messager)r)rc)rrrrI)r
r8rrr�test_new_kwdargs�sz(ExplicitSubclassingTest.test_new_kwdargscCsltdd�}|j|jd�|j|jd�|j|jd�tdd�}|j|jd�|j|jd�|j|jd�dS)N�some messager)re)re)rrr
rrIr)r
r8rrr�test_init_new_overridden�s

z0ExplicitSubclassingTest.test_init_new_overriddencCs(t�}|j|jf�|jt|�d�dS)N�)rrrI�str)r
r8rrr�test_init_standalone�sz,ExplicitSubclassingTest.test_init_standaloneN)
rrrr:r^r`rbrdrfrirrrrr\�s
r\�__main__)r,r=r#rr[r-rrrr	rrrrZTestCaserrCr\r�mainrrrr�<module>s"U',

Youez - 2016 - github.com/yon3zu
LinuXploit