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_print.cpython-36.pyc
3

�w2_{�@s�ddlZddlZddlmZddlmZe�Zddd�ddd�dd	d�dd
d�ddd�ddd�dd
d�ddd�iZGdd�d�Z	Gdd�dej
�ZGdd�dej
�Ze
dkr�ej�dS)�N)�StringIO)�supportFcCst|�S)N)�print)�args�sep�end�file�r	�4/opt/alt/python36/lib64/python3.6/test/test_print.py�<lambda>srTcCst|d|i�S)Nr)r)rrrrr	r	r
rscCst|d|i�S)Nr)r)rrrrr	r	r
rscCst|||d��S)N)rr)r)rrrrr	r	r
rscCst|d|i�S)Nr)r)rrrrr	r	r
rscCst|||d��S)N)rr)r)rrrrr	r	r
rscCst|||d��S)N)rr)r)rrrrr	r	r
rscCst||||d��S)N)rrr)r)rrrrr	r	r
rsc@seZdZdd�Zdd�ZdS)�ClassWith__str__cCs
||_dS)N)�x)�selfr
r	r	r
�__init__$szClassWith__str__.__init__cCs|jS)N)r
)rr	r	r
�__str__'szClassWith__str__.__str__N)�__name__�
__module__�__qualname__rrr	r	r	r
r#src@s0eZdZdZeeefdd�Zdd�Zdd�ZdS)	�	TestPrintz-Test correct operation of the print function.cCsPt|tk	|tk	|tk	f}tj��}|||||�WdQRX|j|j�|�dS)N)�dispatch�
NotDefinedrZcaptured_stdout�assertEqual�getvalue)r�expectedrrrr�fn�tr	r	r
�check.s
zTestPrint.checkcs<ttf�fdd�	}|df�|dd$�|dd%�|dd&�|d
d'�|dd(d
d�|dd)dd�|dd*dd�|dd+ddd�|dd,d
dd�|dd-dd�|dd.dd�|dd/�|dd0dd�|dd1dd�|dd2ddd�|dtd
�f�|d td!�df��jttdd"d��jttdd"d��jttddd#�dS)3Ncs@�j||||d�t�}�jd||||d��j|j�|�dS)N)rr�)rrr)rrrr)rrrr�o)rr	r
r
@szTestPrint.test_print.<locals>.x�
�a
�azNone
z1 2
��z1   2
� z1*2
�*)rz1 s�sr)rza
b
�bz1.01��?)rrz1*a*1.3+��������?�+za

b
z+ +
�za
 b
z*
zabc 1
�abc�)r)r!)N)r"r#)r"r$r#)r"r#)r"r&)r!r')r(r")r"r!r))r r')r+r$r+)r r')r r')r r')r r')rr�assertRaises�	TypeErrorr�AttributeError)rr
r	)rr
�
test_print?s,





zTestPrint.test_printcCs�Gdd�d�}|�}td|ddd�td|ddd�td|d	d
�|j|jd�|j|jd�Gdd
�d
�}|jttd|�dd
�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z,TestPrint.test_print_flush.<locals>.filelikecSsd|_d|_dS)Nrr)�written�flushed)rr	r	r
rjsz5TestPrint.test_print_flush.<locals>.filelike.__init__cSs|j|7_dS)N)r2)r�strr	r	r
�writensz2TestPrint.test_print_flush.<locals>.filelike.writecSs|jd7_dS)Nr")r3)rr	r	r
�flushqsz2TestPrint.test_print_flush.<locals>.filelike.flushN)rrrrr5r6r	r	r	r
�filelikeisr7r"rT)rrr6r#r-F)rr6z123
c@seZdZdd�Zdd�ZdS)z+TestPrint.test_print_flush.<locals>.noflushcSsdS)Nr	)rr4r	r	r
r5}sz1TestPrint.test_print_flush.<locals>.noflush.writecSst�dS)N)�RuntimeError)rr	r	r
r6�sz1TestPrint.test_print_flush.<locals>.noflush.flushN)rrrr5r6r	r	r	r
�noflush|sr9)rrr2r3r.r8)rr7�fr9r	r	r
�test_print_flushgszTestPrint.test_print_flushN)rrr�__doc__rrr1r;r	r	r	r
r+s(rc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�TestPy2MigrationHintzwTest that correct hint is produced analogous to Python3 syntax,
    if print statement is executed as in Python 2.
    cCs8d}|jt��}t|�WdQRX|jdt|j��dS)Nzprint "Hello World"zprint("Hello World"))r.�SyntaxError�exec�assertInr4�	exception)r�python2_print_str�contextr	r	r
�test_normal_string�sz'TestPy2MigrationHint.test_normal_stringcCs8d}|jt��}t|�WdQRX|jdt|j��dS)Nzprint "Hello World",zprint("Hello World", end=" "))r.r>r?r@r4rA)rrBrCr	r	r
�test_string_with_soft_space�sz0TestPy2MigrationHint.test_string_with_soft_spacecCs8d}|jt��}t|�WdQRX|jdt|j��dS)Nzprint  "Hello World", zprint("Hello World", end=" "))r.r>r?r@r4rA)rrBrCr	r	r
�%test_string_with_excessive_whitespace�sz:TestPy2MigrationHint.test_string_with_excessive_whitespacecCs8d}|jt��}t|�WdQRX|jdt|j��dS)Nz.if 1:
            print "Hello World"
        zprint("Hello World"))r.r>r?r@r4rA)rrBrCr	r	r
�#test_string_with_leading_whitespace�sz8TestPy2MigrationHint.test_string_with_leading_whitespacecCs8d}|jt��}t|�WdQRX|jdt|j��dS)Nzprint p;zprint(p))r.r>r?r@r4rA)rrBrCr	r	r
�test_string_with_semicolon�sz/TestPy2MigrationHint.test_string_with_semicoloncCs8d}|jt��}t|�WdQRX|jdt|j��dS)Nzfor i in s: print izprint(i))r.r>r?r@r4rA)rrBrCr	r	r
� test_string_in_loop_on_same_line�sz5TestPy2MigrationHint.test_string_in_loop_on_same_linec Cs�|jt��}ttj?dfWdQRX|jdt|j��|jt��}td?WdQRX|jdt|j��|jt��}ttj?WdQRX|j	dt|j��|jt��}ttj>WdQRX|j	dt|j��Gdd�d�}|j
t|�?d�dS)N�messagez6Did you mean "print(<message>, file=<output_stream>)"?�*z
Did you mean zDid you meanc@seZdZdd�ZdS)z\TestPy2MigrationHint.test_stream_redirection_hint_for_py2_migration.<locals>.OverrideRRShiftcSsdS)NrKr	)rZlhsr	r	r
�__rrshift__�szhTestPy2MigrationHint.test_stream_redirection_hint_for_py2_migration.<locals>.OverrideRRShift.__rrshift__N)rrrrLr	r	r	r
�OverrideRRShift�srM)r.r/r�sys�stderrr@r4rA�maxZassertNotInr)rrCrMr	r	r
�.test_stream_redirection_hint_for_py2_migration�s zCTestPy2MigrationHint.test_stream_redirection_hint_for_py2_migrationN)rrrr<rDrErFrGrHrIrQr	r	r	r
r=�sr=�__main__)FFF)FFT)FTF)FTT)TFF)TFT)TTF)TTT)ZunittestrN�iorZtestr�objectrrrZTestCaserr=r�mainr	r	r	r
�<module>s2
ZU

Youez - 2016 - github.com/yon3zu
LinuXploit