403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.141
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/test/__pycache__/test_sys.cpython-312.opt-2.pyc
�

���g����ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZ
ddl
mZddlmZddlmZmZddlmZddlmZddlZddlZddlZ	ddlmZd�Zd	ZGd
�dej8�ZGd�d
ej8�ZGd�dej8�ZGd�dej8�Z e
jjBGd�dej8��Z"e
jjBGd�dej8��Z#e$dk(rejJ�yy#e$rdZY��wxYw)�N)�support)�	os_helper)�assert_python_ok�assert_python_failure)�threading_helper)�
import_helper)�interpretersc�J�tjtdud�}||�S)NzTest requires subinterpreters)�unittest�skipIfr	)�func�decos  �"C:\Python312\\Lib\test\test_sys.py�requires_subinterpretersrs$���?�?�<�4�/�4�6�D���:���n2BI2nc�$�eZdZd�Zd�Zd�Zd�Zy)�DisplayHookTestc��tj}tj�5}|d�ddd�|j	j�d�|j	tjd�t`tj�5}|d�ddd�|j	|j�d�|jttd��|jt|�tj}	t`|jt|d�|t_y#1swY��xYw#1swY��xYw#|t_wxYw)N�*z42
��_)�sys�__displayhook__r�captured_stdout�assertEqual�getvalue�builtinsr�
assertTrue�hasattr�assertRaises�	TypeError�stdout�RuntimeError)�self�dh�outr#s    r�test_original_displayhookz)DisplayHookTest.test_original_displayhook's���
�
 �
 ��
�
$�
$�
&�#��r�F�'�	
��������0�������R�(��J�
�
$�
$�
&�#��t�H�'�	
��������,����G�H�c�2�2�3�	
���)�R�(�����	 ��
����l�B��3��C�J�-'�
&��'�
&�� �C�J�s#�	D1�	D>�E
�1D;�>E�

Ec��tj}	t`tddd�}|jtt
|�|t_y#|t_wxYw)N�42�<string>�single)r�displayhook�compiler!r$�eval)r%r-�codes   r�test_lost_displayhookz%DisplayHookTest.test_lost_displayhookBsD���o�o��	*����4��X�6�D����l�D�$�7�)�C�O��k�C�O�s�.A�
Ac��d�}tjtd|�5tddd�}|j	t
t|�ddd�y#1swYyxYw)Nc��t��N��
ValueError)�objs r�baddisplayhookz?DisplayHookTest.test_custom_displayhook.<locals>.baddisplayhookL����rr-r*r+r,)r�	swap_attrrr.r!r6r/)r%r8r0s   r�test_custom_displayhookz'DisplayHookTest.test_custom_displayhookKsH��	��
�
�s�M�>�
B��4��X�6�D����j�$��5�C�
B�
B�s�)A�Ac���Gd�d�}tjtdd�5tj�t_tj|��ddd�y#1swYyxYw)Nc��eZdZd�Zy)�(DisplayHookTest.test_gh130163.<locals>.Xc�f�tj�t_t	j
�y)N�foo)�io�StringIOrr#r�
gc_collect�r%s r�__repr__z1DisplayHookTest.test_gh130163.<locals>.X.__repr__Us���[�[�]��
��"�"�$�rN)�__name__�
__module__�__qualname__rE�rr�Xr>Ts��
rrJr#)rr:rrArBr#r-)r%rJs  r�
test_gh130163zDisplayHookTest.test_gh130163SsG��	�	��
�
�s�H�d�
3�����C�J��O�O�A�C� �4�
3�
3�s�8A'�'A0N)rFrGrHr(r1r;rKrIrrrr%s�� �6*�6�	!rrc�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�ActiveExceptionTestsc�L�|jtj�d�y)N)NNN)rr�exc_inforDs r�test_exc_info_no_exceptionz/ActiveExceptionTests.test_exc_info_no_exception`s���������);�<rc�L�|jtj�d�yr4)rr�	exceptionrDs r�test_sys_exception_no_exceptionz4ActiveExceptionTests.test_sys_exception_no_exceptioncs���������$�/rc�8�d�}	|�|jt�|jdt�|j|d|�|j|d|j�y#t$r }|}tj�}Yd}~��d}~wwxYw)Nc��td���Nrr5rIrr�fzEActiveExceptionTests.test_exc_info_with_exception_instance.<locals>.fg����R�.� rr����	ExceptionrrO�assertIsInstancer6�assertIs�
__traceback__�r%rW�e_�erOs     r�%test_exc_info_with_exception_instancez:ActiveExceptionTests.test_exc_info_with_exception_instancefs��	!�	&�
�C�
	
���a��,��
�
�h�q�k�:�.��
�
�h�q�k�1�%��
�
�h�q�k�1�?�?�3���	&��A��|�|�~�H��	&���A0�0	B�9B�Bc�8�d�}	|�|jt�|jdt�|j|d|�|j|d|j�y#t$r }|}tj�}Yd}~��d}~wwxYw)Nc��t�r4r5rIrrrWzAActiveExceptionTests.test_exc_info_with_exception_type.<locals>.fvr9rrrYrZr[r`s     r�!test_exc_info_with_exception_typez6ActiveExceptionTests.test_exc_info_with_exception_typeus��	�	&�
�C�
	
���a��,��
�
�h�q�k�:�.��
�
�h�q�k�1�%��
�
�h�q�k�1�?�?�3���	&��A��|�|�~�H��	&�rdc���d�}	|�|jt�|j|�y#t$r }|}tj�}Yd}~�Md}~wwxYw)Nc��td��rVr5rIrrrWzJActiveExceptionTests.test_sys_exception_with_exception_instance.<locals>.f�rXr�r\rrRr]r6r^�r%rWrarb�excs     r�*test_sys_exception_with_exception_instancez?ActiveExceptionTests.test_sys_exception_with_exception_instance�sS��	!�	"�
�C�
	
���a��,��
�
�c�1����	"��A��-�-�/�C��	"���5�	A�A�Ac���d�}	|�|jt�|j|�y#t$r }|}tj�}Yd}~�Md}~wwxYw)Nc��t�r4r5rIrrrWzFActiveExceptionTests.test_sys_exception_with_exception_type.<locals>.f�r9rrjrks     r�&test_sys_exception_with_exception_typez;ActiveExceptionTests.test_sys_exception_with_exception_type�sS��	�	"�
�C�
	
���a��,��
�
�c�1����	"��A��-�-�/�C��	"�rnN)	rFrGrHrPrSrcrgrmrqrIrrrMrM_s ��=�0�
4�
4��rrMc��eZdZd�Zd�Zd�Zy)�ExceptHookTestc��	td��#t$rX}tj�5}tjtj
��ddd�n#1swYnxYwYd}~nd}~wwxYw|j
j�jd��|jttj�y)Nr�ValueError: 42
)r6r�captured_stderrr�__excepthook__rOrr�endswithr!r"�r%rl�errs   r�test_original_excepthookz'ExceptHookTest.test_original_excepthook�s���	4��R�.� ���	4��(�(�*�c��"�"�C�L�L�N�3�+�*�*���	4��	
�������/�/�0B�C�D����)�S�%7�%7�8s+�
�	A.�A)�%A�	A)�A!	�A)�)A.c��tj�5tjdt�	t	dd��#t$rX}tj�5}tjtj��ddd�n#1swYnxYwYd}~nd}~wwxYwddd�n#1swYnxYwj�}|jd|�|jd|�|j|jd��y)N�ignore�msg)sbytes_filename�{r�textz%  File "b'bytes_filename'", line 123
z	    text
zSyntaxError: msg
)�warnings�catch_warnings�simplefilter�BytesWarning�SyntaxErrorrrvrrwrOr�assertInrrxrys   r�test_excepthook_bytes_filenamez-ExceptHookTest.test_excepthook_bytes_filename�s����
$�
$�
&��!�!�(�L�9�
8�!�%�)L�M�M���
8��,�,�.�#��&�&�����7�/�.�.���
8��'�
&�
&���l�l�n���
�
�B�C�H��
�
�&��,�������%9�:�;sD�B*�=�	B�B�%B�?	B�B�
B�B*�B�B*�*B3c���tjjd�5}tjddd�ddd�|jdj
�v�y#1swY�+xYw)N�stderrrY�1zETypeError: print_exception(): Exception expected for value, str found)�testr�captured_outputr�
excepthookrr)r%r�s  r�test_excepthookzExceptHookTest.test_excepthook�sV��
�\�\�
)�
)�(�
3�v��N�N�1�c�1�%�4����,�/5���/@�A�	B�4�
3�s�A"�"A+N)rFrGrHr{r�r�rIrrrsrs�s��	9�<�"Brrsc�^�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
jjd��Z
d	�Zd
�Zej"eed�d�d
��Ze
jj*d��Zd�Zd�Zej4ej6�d���Zej4ej6�d���Zd�Zd�Zej"ej@d�d��Z!d�Z"d�Z#eje$d���Z%eje$d���Z&eje$d���Z'd�Z(d�Z)d�Z*d�Z+d �Z,e
jjd!��Z-ej\�d"��Z/ej"e0jbd#�ej"ejd�e3jhd$�k(d%�ej\�d&����Z5ejlejnejpk7d'�ej\�d(���Z9dCd*�Z:d+�Z;dDd,�Z<d-�Z=ej\�d.��Z>ej\�d/��Z?d0�Z@e
jjd1��ZAej"eed2�d3�d4��ZBd5�ZCd6�ZDd7�ZEej"eed8�d9�d:��ZFej\�d;��ZGd<�ZHej"eed=�d>�d?��ZIej\�d@��ZJdA�ZKdB�ZLy))E�
SysModuleTestc�@�tjj�yr4)r�r�
reap_childrenrDs r�tearDownzSysModuleTest.tearDown�s�����"�"�$rc����jttjdd��jt�5}tj�ddd��jjj�tdd�\}}}�j|d��j|d��j|d��jt�5}tjd�ddd��j|jjd��jt�5}tjd�ddd��j|jjd��jt�5}tjd�ddd��j|jjd��jt�5}tjd�ddd��j|jjd�tdd	�\}}}�j|d
��j|d��j|d��fd�}|dd
�|dd�|ddd��y#1swY��BxYw#1swY���xYw#1swY��exYw#1swY��xYw#1swY��xYw)Nr�-czimport sys; sys.exit()rr)r�exit)��zraise SystemExit(47)�/c����td|fi|��\}}}�j|d��j|d��j|j|�t	|��dt	|����y)Nr�rYrz doesn't start with )rrr�
startswith�ascii)r0�expected�env_vars�rcr'rzr%s      �r�check_exit_messagez3SysModuleTest.test_exit.<locals>.check_exit_message�sb���0��t�H�x�H�L�B��S����R��#����S�#�&��O�O�C�N�N�8�4�.3�C�j�%��/�J�
Lrz?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)r!r"rr��
SystemExit�assertIsNonerRr0rrr)r%�cmr�r'rzr�s`     r�	test_exitzSysModuleTest.test_exit�s3������)�S�X�X�r�2�6��
�
�z�
*�b��H�H�J�+����"�,�,�+�+�,�'��.F�G���C������Q������c�"�����c�"��
�
�z�
*�b��H�H�R�L�+�������*�*�B�/��
�
�z�
*�b��H�H�U�O�+�������*�*�B�/��
�
�z�
*�b��H�H�V��+�������*�*�F�3��
�
�z�
*�b��H�H�X��+�������*�*�H�5�-�T�3I�J���C������R� �����c�"�����c�"�	L�	�N� �	"�	�8�!�	#�	�,��y�	2�s+�
*��+�
*��+�
*��
+�
*��
+�
*�s;�J�J�3J,�J9�%K�J�J)�,J6�9K�Kc��|jttjd�|j	tj�t
�yrV)r!r"r�getdefaultencodingr]�strrDs r�test_getdefaultencodingz%SysModuleTest.test_getdefaultencodings3�����)�S�%;�%;�R�@����c�4�4�6��<rc�f�|jttj�|jttjd�|jttjd�|jttjd�tj
�}|j
|dk|�	ddd|fD];}tj|�|jtj
�|��=	tj|�y#tj|�wxYw)N�ag�gg�?g�h㈵��>g�������?g@)r!r"r�setswitchintervalr6�getswitchintervalr�assertAlmostEqual)r%�orig�ns   r�test_switchintervalz!SysModuleTest.test_switchintervals������)�S�%:�%:�;����)�S�%:�%:�C�@����*�c�&;�&;�T�B����*�c�&;�&;�S�A��$�$�&������s�
�D�)�	(��d�C��-���%�%�a�(��&�&�s�'<�'<�'>��B�.�
�!�!�$�'��C�!�!�$�'�s
�>AD�D0c���tj�}|j|t�|j	|d�|jttjd�y)NrYr)r�getrecursionlimitr]�int�
assertGreaterr!r")r%�limits  r�test_getrecursionlimitz$SysModuleTest.test_getrecursionlimit%sH���%�%�'�����e�S�)����5�!�$����)�S�%:�%:�B�?rc��tj�}	tjd�|jtj�d�|j	t
tj�|j	ttjd�tj|�y#tj|�wxYw)Ni'i���)rr��setrecursionlimitrr!r"r6)r%�	old_limits  r�test_setrecursionlimitz$SysModuleTest.test_setrecursionlimit,s����)�)�+�	�	-��!�!�&�)����S�2�2�4�f�=����i��)>�)>�?����j�#�*?�*?��E��!�!�)�,��C�!�!�)�,�s�BB.�.Cc� ��ttd�r%tj�r|jd�tj�}�fd��	dD]b}	tj
|�|jt�5��ddd�|jt�5��ddd��d	tj
|�y#t$rY��wxYw#1swY�VxYw#1swY��xYw#tj
|�wxYw)N�gettracez(fatal error if run with a trace functionc�����yr4rI)rWs�rrWz5SysModuleTest.test_recursionlimit_recovery.<locals>.f<s���
�Cr)�2�K�d���)r rr��skipTestr�r��RecursionErrorr!)r%r��depthrWs   @r�test_recursionlimit_recoveryz*SysModuleTest.test_recursionlimit_recovery7s�����3�
�#������M�M�D�E��)�)�+�	�	�	-�1����)�)�%�0��&�&�~�6��C�7��&�&�~�6��C�7�6�2�
�!�!�)�,��&�����7�6��6�6��
�!�!�)�,�s`�C6�C�,C6�C�	C6�&C*�.
C6�	C�C6�C�C6�C'	�#C6�*C3	�/C6�6D
c�J�tj�}	tj�}|j	tj�|��5tj
|dz�tj
|�|j
t�5}tj
|�ddd�ddd�|jtj�d�tj
|�y#1swY�LxYw#1swY�PxYw#tj
|�wxYw)N)r�r�rYz\cannot set the recursion limit to [0-9]+ at the recursion depth [0-9]+: the limit is too low)rr�r�get_recursion_depth�subTestr�r!r��assertRegexr�rR)r%r�r�r�s    r�test_setrecursionlimit_to_depthz-SysModuleTest.test_setrecursionlimit_to_depthPs���
�)�)�+�	�	-��/�/�1�E����C�$9�$9�$;�5��I��%�%�e�a�i�0��%�%�i�0��&�&�~�6�"��)�)�%�0�7�J�
���S����.�4�
5�

�!�!�)�,�7�6��J�I��
�!�!�)�,�s<�9D�AC?�C3�(C?�0-D�3C<	�8C?�?D�D�D"c��tjjtd�tj�}|jt
|�d�|j|dt�|j|dt�|j|dt�|j|dt�|j|dt�|jttj|d�|j|jt�|j|jt�|j|j t�|j|j"t�|j|j$t�|j|j&t�|j|j(t�|j|j*t�|j|j,t�|j|d|j�|j|d|j�|j|d|j �|j|d|j"�|j|d|j$�tj�\}}}}}y)N�getwindowsversion�rrYrZ��)r�r�
get_attributerr�r�lenr]r�r�r!�
IndexError�operator�getitem�major�minor�build�platform�service_pack�service_pack_minor�service_pack_major�
suite_mask�product_type)r%�v�maj�min�buildno�plat�csds       r�test_getwindowsversionz$SysModuleTest.test_getwindowsversionhs�����"�"�3�(;�<��!�!�#������Q���#����a��d�C�(����a��d�C�(����a��d�C�(����a��d�C�(����a��d�C�(����*�h�&6�&6��1�=����a�g�g�s�+����a�g�g�s�+����a�g�g�s�+����a�j�j�#�.����a�n�n�c�2����a�2�2�C�8����a�2�2�C�8����a�l�l�C�0����a�n�n�c�2�����1��q�w�w�'�����1��q�w�w�'�����1��q�w�w�'�����1��q�z�z�*�����1��q�~�~�.�(+�'<�'<�'>�$��S�'�4�rc�X�|jttjtd�y)NrZ)r!r"r�call_tracing�typerDs r�test_call_tracingzSysModuleTest.test_call_tracing�s�����)�S�%5�%5�t�Q�?r�setdlopenflagsztest needs sys.setdlopenflags()c��|jttd��|jttj
d�tj
�}|jttj�tj|dz�|jtj
�|dz�tj|�y)N�getdlopenflagsrrY)rr rr!r"r�r�r)r%�oldflagss  r�test_dlopenflagszSysModuleTest.test_dlopenflags�s���	
�����%5�6�7����)�S�%7�%7��<��%�%�'�����)�S�%7�%7�8����8�A�:�&�����+�+�-�x��z�:����8�$rc��|jttj�tjd�}da|jtjd�|�b|jtjd�|�t
td�r)|jtj�t�yy)N�gettotalrefcount)
r!r"r�getrefcountr�rr r]r�r�)r%�cs  r�
test_refcountzSysModuleTest.test_refcount�s���	
���)�S�_�_�5��O�O�D�!�����������.��2�
��������.��2��3�*�+��!�!�#�"6�"6�"8�#�>�,rc�(�|jttjdd�|jttjd�|jtjjtj�ju�y)Nri�5w)
r!r"r�	_getframer6rr��
test_getframe�__code__�f_coderDs rr�zSysModuleTest.test_getframe�s_�����)�S�]�]�B��;����*�c�m�m�Z�@�����'�'�0�0��}�}��%�%�
&�	
rc��|jttj��|jdtjd��d}tj|�}|rr|j|j
dtj|�xsd�|dz
}|j}	tj|�}|j||�|r�r|jtj|��y#t$rY�0wxYw)Nz
unittest.caserYrrF�__main__)
rrFr�_getframemodulenamer��	f_globals�f_backr6r^r�)r%�irW�f2s    r�test_getframemodulenamez%SysModuleTest.test_getframemodulename�s�������3�#:�#:�#<�=�����#�*A�*A�!�*D�E�
���M�M�!����������J�'��'�'��*�8�j�
�
��F�A����B�
��M�M�!�$��
�M�M�!�R� ��	
���#�1�1�!�4�5���
��
�s�/C>�>	D
�	D
c�4������ddl�ddl}�j���j��g��fd�}����fd���j|��}|j	��j�	|j
t��d��d}tj�}|D]*}|j|t�|j|d��,�j�}|j||�|j||�|j|�}|j!|tj"�u�|j|�}|j%|�}	t'|	�D]\}
\}}}
}|
dk(s�n|j)d�|j
d�|	
dz\}}}
}|j
|
d	�|j|d
dg��j+�|j-�y#�j+�|j-�wxYw)Nrc�����yr4rI��g456s�r�f123z/SysModuleTest.test_current_frames.<locals>.f123������Frc����j�j���j��j�yr4)�append�	get_ident�set�wait��	entered_g�leave_g�thread_info�	threadings����rrz/SysModuleTest.test_current_frames.<locals>.g456�s,������y�2�2�4�5��M�M�O��L�L�Nr��targetrYr�)didn't find f123() on thread's call stack�g456()rzleave_g.wait()zentered_g.set())r�	traceback�Event�Thread�startrrr�r�_current_framesr]r�r�r
r��poprr��
extract_stack�	enumerate�failr�join)r%rr�t�	thread_id�d�tid�main_id�frame�stackr��filename�lineno�funcname�
sourcelinerrrrrs               @@@@@r�test_current_framesz!SysModuleTest.test_current_frames�s����	��
�O�O�%�	��/�/�#����	�	�

���D��)��	���	�����(	�
���S��-�q�1�#�A��I��#�#�%�A����%�%�c�3�/��"�"�3��*�� �)�)�+�G��M�M�'�1�%��M�M�)�Q�'��E�E�'�N�E��O�O�E�S�]�]�_�4�5�
�E�E�)�$�E��+�+�E�2�E�?H��?O�;��;�H�f�h�
��v�%��@P��	�	�E�F����Z��2�6;�1�Q�3�Z�2�H�f�h�
����X�v�.��M�M�*�'7�9J�&K�L�
�K�K�M�
�F�F�H��
�K�K�M�
�F�F�H�s�0D
G5�;AG5�5"Hc�J������ddl�ddl}�j���j��g��fd�}����fd���j|��}|j	��j�	|j
t��d��d}tj�}|D]*}|j|t�|j|d��,�j�}|j||�|j||�|j
d|j|��|j|�}|j!|j"j$�}	t'|	�D]\}
\}}}
}|
dk(s�n|j)d�|j
d�|	
dz\}}}
}|j
|
d	�|j+|j-d
���j/�|j1�y#�j/�|j1�wxYw)Nrc�����yr4rIrs�rrz3SysModuleTest.test_current_exceptions.<locals>.f123rrc�����j�j���j�		td��#t$r%�j	t
j��rYyYnwxYw�>)N�oops)�timeout)r	r
rr6rr�LONG_TIMEOUTr
s����rrz3SysModuleTest.test_current_exceptions.<locals>.g456sg������y�2�2�4�5��M�M�O���$�V�,�,��!���|�|�G�,@�,@�|�A��B���s�>�)A,�+A,rrYrrrrzif leave_g.wait()rrrrrrrr�r�_current_exceptionsr]r�r�r
r�rrr_�tb_framerrrr�rr)r%rrr r!r"r#r$�	exc_valuer&r�r'r(r)r*rrrrrs               @@@@@r�test_current_exceptionsz%SysModuleTest.test_current_exceptionss����	��
�O�O�%�	��/�/�#����	�	�
���D��)��	���	�����%	�
���S��-�q�1�#�A��I��'�'�)�A����%�%�c�3�/��"�"�3��*�� �)�)�+�G��M�M�'�1�%��M�M�)�Q�'����T�1�5�5��>�2�
���i�(�I��+�+�I�,C�,C�,L�,L�M�E�?H��?O�;��;�H�f�h�
��v�%��@P��	�	�E�F����Z��2�6;�1�Q�3�Z�2�H�f�h�
����X�v�.��O�O�J�1�1�2D�E�F�
�K�K�M�
�F�F�H��
�K�K�M�
�F�F�H�s�0D	H�:A%H�"H"c��|jtjt�|jtjt
�tjD]}|j|t��|jtjt
�tjD]}|j|t��|jtjd�|jtjt�|jtjt�|jtjt�|jtjt�|jtjt�|j!t#tj$�d�|j!tj$j&d�|j!t#tj(�d�|j+tj(j,dzdk(�|j+tj(j.dk\�|j1tj(j2d�|j1tj(j4d	�|j7tj(j2tj(j4�|j!t9tj(j,�t�|j!t9tj(j.�t�|jtj(j2t�|jtj(j4t�|jtj:t�|j!t#tj<�d
�|j?tj<j@dtj<jBz�tEdd	�D]z}|j!tG|tj<j@dz
tj<j@�ddjItj<j@���||jtj<jJt�|jtj<jLt�|jtj<jNt�tQjRd�}tj<jTd
v�r|jtj<jVddh�|jtj<jXhd��|dk(r+|j!tj<jTd�n�|dk(r+|j!tj<jTd�no|dk(r+|j!tj<jTd�n?|jtj<jThd
��n|j!|d�|j1tj<jZd�|j?tj<jZd�|jtj\t�|jtj^t�|j!tj^d�|jtj`t�|jtjbt�|jtjdt�|jtjft�|jtjht�tjj}|j|ddt�|j!t#|�d�|j|dt�|j|dt�|j|dt�|j|dd�|j|dt�|j|jlt�|j|jnt�|j|jpt�|j|jrd�|j|jtt�|j!|d|jl�|j!|d|jn�|j!|d|jp�|j!|d|jr�|j!|d|jt�|j+|dkD�|jtjvt�|jtjvd�tj`jyd�s%|jtjzt�yy)N)�little�big�rZr�r�rrYi�r��	z'sys.hash_info.modulus {} is a non-prime�Py_HASH_ALGORITHM>�fnv�	siphash13�	siphash24� �@>r?r@�r>r<r�r=�i����alpha�beta�	candidate�final)rYrr)�short�legacy�win)>r]r�api_versionr��argv�listr��	orig_argvr��	byteorder�builtin_module_names�tuple�	copyright�exec_prefix�base_exec_prefix�
executablerr��
float_info�radix�int_infor�bits_per_digit�sizeof_digit�assertGreaterEqual�default_max_str_digits�str_digits_check_thresholdr�r��
hexversion�	hash_info�
assertLess�modulus�width�range�pow�format�inf�nan�imag�	sysconfig�get_config_var�	algorithm�	hash_bits�	seed_bits�cutoff�maxsize�
maxunicoder��prefix�base_prefix�
platlibdir�version�version_infor�r��micro�releaselevel�serial�float_repr_styler��abiflags)r%�arg�x�algo�vis     r�test_attributeszSysModuleTest.test_attributesJs������c�o�o�s�3����c�h�h��-��8�8�C��!�!�#�s�+�����c�m�m�T�2��=�=�C��!�!�#�s�+�!��
�
�c�m�m�%6�7����c�6�6��>����c�m�m�S�1����c�o�o�s�3����c�2�2�C�8����c�n�n�c�2�����S�^�^�,�b�1�������-�-�q�1�����S�\�\�*�A�.�������3�3�a�7�1�<�=�������1�1�Q�6�7������� C� C�S�I������� G� G��M����3�<�<�>�>��<�<�B�B�	D�����c�l�l�9�9�:�C�@�����c�l�l�7�7�8�#�>����c�l�l�A�A�3�G����c�l�l�E�E�s�K����c�n�n�c�2�����S�]�]�+�Q�/�����
�
�-�-�q�#�-�-�2E�2E�/E�F��q�#��A�����A�s�}�}�,�,�Q�.��
�
�0E�0E�F��9�@�@��M�M�)�)�+�
��	
���c�m�m�/�/��5����c�m�m�/�/��5����c�m�m�0�0�#�6��'�'�(;�<���=�=�"�"�&G�G��M�M�#�-�-�1�1�B��8�<��M�M�#�-�-�1�1�=�A��q�y�� � ����!8�!8�+�F����� � ����!8�!8�%�@����� � ����!8�!8�+�F��
�
�c�m�m�5�5�7X�Y�
���T�1�%�����
�
� 4� 4�a�8�����
�
�,�,�a�0����c�k�k�3�/����c�n�n�c�2��������2����c�l�l�C�0����c�j�j�#�.����c�o�o�s�3����c�n�n�c�2����c�k�k�3�/�
�
�
�����b��e�U�+�����R��!�$����b��e�S�)����b��e�S�)����b��e�S�)��
�
�b��e�D�E����b��e�S�)����b�h�h��,����b�h�h��,����b�h�h��,��
�
�b�o�o�'N�O����b�i�i��-�����A�����)�����A�����)�����A�����)�����A�����0�����A���	�	�*�����W��%����c�2�2�C�8��
�
�c�*�*�,?�@��|�|�&�&�u�-��!�!�#�,�,��4�.rc�f�tj}|jt|�d�|j	|j
d�|j	|jd�tjjd�r|j|j
d�ytjdk(r|j|j
d�ytjdk(r|j	|j
dd	h�ytjd
k(r|j|j
d	�yy)Nr�)�nt�pthread�
pthread-stubs�solarisN)�	semaphorez
mutex+condN)�linux�freebsdr��win32r��
emscriptenr��wasi)	rrrr�r��name�lockr�r�)r%�infos  r�test_thread_infozSysModuleTest.test_thread_info�s�����������T��A�&��
�
�d�i�i�!T�U��
�
�d�i�i�!B�C��<�<�"�"�#7�8����T�Y�Y�	�2�
�\�\�W�
$����T�Y�Y��-�
�\�\�\�
)��M�M�$�)�)�i��%A�B�
�\�\�V�
#����T�Y�Y��8�$rzonly available on Emscriptenc���|jttj�d�|j	tjj
t�|j	tjjttd�f�|j	tjjt�|j	tjjt�y)Nr�)
rr�r�_emscripten_infor]�emscripten_versionrQ�runtimer�r��pthreads�bool�
shared_memoryrDs r�test_emscripten_infoz"SysModuleTest.test_emscripten_info�s�������S�1�1�2�A�6����c�2�2�E�E�u�M����c�2�2�:�:�S�$�t�*�<M�N����c�2�2�;�;�T�B����c�2�2�@�@�$�Grc��|jtjjtjj�yr4)rr�
__stdout__�encoding�
__stderr__rDs r�
test_43581zSysModuleTest.test_43581�s(��	
������0�0�#�.�.�2I�2I�Jrc���|jttj�dt	tjdd��z}|jtj|�|u�|j�j�}|jtj|�|u�Gd�dt�}|jttj|d��y)N�never interned beforer�ʚ;c��eZdZd�Zy)�$SysModuleTest.test_intern.<locals>.Sc��y)NrrIrDs r�__hash__z-SysModuleTest.test_intern.<locals>.S.__hash__����rN)rFrGrHr�rIrr�Sr�����
rr��abc)	r!r"r�internr��random�	randranger�swapcase)r%�s�s2r�s    r�test_internzSysModuleTest.test_intern�s������)�S�Z�Z�0�#�c�&�*:�*:�1�e�*D�&E�E������
�
�1�
��*�+�
�Z�Z�\�
"�
"�
$������
�
�2��!�+�,�	��	�	
���)�S�Z�Z��5��:rc��dttjdd��z}tj|�}|j||�t
j�}|jtjd|j��dt|��dt|��dt|��dt|��d���y)	Nr�rr�zn
            import sys

            # set `s`, avoid parser interning & constant folding
            s = str(zG, 'utf-8')

            t = sys.intern(s)

            assert id(t) != �
, (id(t), z)
            assert id(t) != z)
            )
r�r�r�rr�r^r	�create�run�textwrap�dedent�encode�id�r%r�r �interps    r�+test_subinterp_intern_dynamically_allocatedz9SysModuleTest.test_subinterp_intern_dynamically_allocated�s���

$�c�&�*:�*:�1�e�*D�&E�E���J�J�q�M���
�
�a����$�$�&���
�
�8�?�?�(��X�X�Z�N�#� ��U�G�:�b��e�W�5���U�G�:�b��e�W�5
�
$�
�
	rc�N�dD]�}|j|��5tj|�}tj�}|jt
jd|j��dt|��dt|��d���ddd���y#1swY��xYw)N)�__init__�	CANCELLEDz<module>�utf-8z{{r�
rr|��¸�ÿ�r���
                    import sys

                    # set `s`, avoid parser interning & constant folding
                    s = str(zV, 'utf-8')

                    t = sys.intern(s)
                    assert id(t) == r�z)
                    )
r�rr�r	r�r�r�r�r�r�r�s    r�*test_subinterp_intern_statically_allocatedz8SysModuleTest.test_subinterp_intern_statically_allocated�s����A������"��J�J�q�M��%�,�,�.���
�
�8�?�?�0��X�X�Z�N�+%�&(��U�G�:�b��e�W�=�,���	#�"��#�"�s�A8B�B$	c��dD]s}|j|��5tj�}|jt	j
d|j
��dt|��d���ddd��uy#1swY��xYw)N)rr�rr|r�r�r�r�r�z0, 'utf-8')

                    assert id(s) == zu
                    t = sys.intern(s)
                    assert id(t) == id(s), (id(t), id(s))
                    )r�r	r�r�r�r�r�r�)r%r�r�s   r�test_subinterp_intern_singletonz-SysModuleTest.test_subinterp_intern_singletons|��
A�A������"�%�,�,�.���
�
�8�?�?�0��X�X�Z�N�+%�%'��U�G�,�
	,�	�	�#�"�A�"�"�s�AA:�:B	c	�<�|jtj�d}|D]p}|jttj|�|�|dvrtnt
}|j
tttj|��||��r|jttj��|j
ttj�t|��|jtjjhd��y)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_mode�warn_default_encoding�	safe_path�int_max_str_digits)r�r�>rrYrZ)
rr�flagsr r�r�rr��getattr�reprr�r�r�)r%�attrs�attr�	attr_types    r�test_sys_flagszSysModuleTest.test_sys_flagss�������	�	�"�M���D��O�O�G�C�I�I�t�4�d�;� $�(A� A��s�I����T�'�#�)�)�T�":�;�Y��M��	
����S�Y�Y��(�����S�Y�Y���U��4��
�
�c�i�i�)�)�9�5rc��|}t|�}|jt�5||�ddd�|jt�5|j||�ddd�y#1swY�:xYw#1swYyxYwr4)r�r!r"�__new__)r%�sys_attrr{r�s    r�assert_raise_on_new_sys_typez*SysModuleTest.assert_raise_on_new_sys_type(sb������N�	�
�
�
�y�
)��c�N�*�
�
�
�y�
)����i��-�*�
)�*�
)��
)�
)�s�	A%�	A1�%A.�1A:c�B�|jtj�yr4)r�rr�rDs r�test_sys_flags_no_instantiationz-SysModuleTest.test_sys_flags_no_instantiation2s���)�)�#�)�)�4rc�B�|jtj�yr4)r�rrurDs r�&test_sys_version_info_no_instantiationz4SysModuleTest.test_sys_version_info_no_instantiation5s���)�)�#�*:�*:�;rc��tjjtd�|j	tj
��y)Nr�)r�rr�rr�r�rDs r�+test_sys_getwindowsversion_no_instantiationz9SysModuleTest.test_sys_getwindowsversion_no_instantiation8s.�����"�"�3�(;�<��)�)�#�*?�*?�*A�Brc�,�tj�yr4)r�_clear_type_cacherDs r�test_clear_type_cachez#SysModuleTest.test_clear_type_cache=s�����rc�d�ttj�}d|d<tjt
jddgtj|��}|j�dj�}dtjzjd�}|j||�d|d<tjt
jddgtj|��}|j�dj�}|j|d	�d
|d<tjt
jddgtjtj|��}|j�\}}|j|d�|jd
|�|jd|�d|d<tjt
jddgtjtj|��}|j�\}}|j|d�|jd
|�|jd|�d|d<tjt
jddgtj|��}|j�dj�}|j|d�y)N�cp424r�r�zprint(chr(0xa2))�r#�envr�¢z
ascii:replace�?r�)r#r�r�rsUnicodeEncodeError:s'\xa2'zascii:z:surrogateescapezprint(chr(0xdcbd))��)�dict�os�environ�
subprocess�PopenrrU�PIPE�communicate�strip�linesepr�rr�)r%r��pr'r�rzs      r�test_ioencodingzSysModuleTest.test_ioencodingAs,���2�:�:���
#*�������c�n�n�d�4F�G�&0�o�o�3�
@���m�m�o�a� �&�&�(���R�Z�Z�'�/�/��8������h�'�"1�������c�n�n�d�4F�G�&0�o�o�3�
@���m�m�o�a� �&�&�(������d�#�")�������c�n�n�d�4F�G�$.�O�O�J�O�O�!$�
&���=�=�?���S�����c�"��
�
�,�c�2��
�
�j�#�&�"*�������c�n�n�d�4F�G�$.�O�O�J�O�O�!$�
&���=�=�?���S�����c�"��
�
�,�c�2��
�
�j�#�&�"4�������c�n�n�d�4H�I�$.�O�O��
>���m�m�o�a� �&�&�(������g�&rz*requires OS support of non-ASCII encodingsFz$requires FS encoding to match localec�x�ttj�}d|d<tjt
jddtjzgtj|��}|j�dj�}|j|tjtj��y)Nrr�r�z	print(%a)r�r)r�r�r�r�r�rrUr�FS_NONASCIIr�r�r�r�fsencode)r%r�r�r's    r�test_ioencoding_nonasciiz&SysModuleTest.test_ioencoding_nonasciims����2�:�:���"$�������c�n�n�d� +�i�.C�.C� C�E�'1���C�
A���m�m�o�a� �&�&�(������b�k�k�)�*?�*?�@�ArzTest is not venv-compatiblec
��|jtjjtj
�tj
�tjj
tjjtj
��}tjgd�tj
tj|��}|j�d}|j�jd�}|j�|j|dt!tj
j#dd��g�y)N)�nonexistentr�zEimport sys; print(sys.executable.encode("ascii", "backslashreplace")))rUr#�cwdr�ASCIIzb''r��backslashreplace)rr��path�abspathrrU�dirname�realpathr�r�r�r�r��decoderr�r�r�)r%�
python_dirr�r#rUs     r�test_executablezSysModuleTest.test_executable|s���
	
�����������8�#�.�.�I��W�W�_�_�R�W�W�%5�%5�c�n�n�%E�F�
����
V��~�~�j�o�o�:�
O�������#���\�\�^�*�*�7�3�
�	�����
�
�j�5�$�s�~�~�/D�/D�W�N`�/a�*b�"c�drNc�z�|j|�tj|�|r|j||�yyr4)�assertIsNotNone�codecs�lookupr�r%�fs_encodingr�s   r�check_fsencodingzSysModuleTest.check_fsencoding�s4�����[�)��
�
�k�"�����[�(�3�rc��tj�}tjdk(rd}nd}|j||�y)N�darwinr�)r�getfilesystemencodingr�rrs   r�test_getfilesystemencodingz(SysModuleTest.test_getfilesystemencoding�s6���/�/�1���<�<�8�#��H��H����k�8�4rc��tjj�}||d<d|d<djd�}tj
ddd|g}|r|j
d	�|�||d
<n|jd
d�tj|tjtj|d��}|j�\}}	|S)
N�LC_ALL�0�PYTHONCOERCECLOCALEr�)�
import syszdef dump(name):z    std = getattr(sys, name)z(    print("%s: %s" % (name, std.errors))z
dump("stdin")zdump("stdout")zdump("stderr")�-Xzutf8=0r��-Ir�T)r#r�r��universal_newlines)
r�r��copyrrrUr	rr�r�r��STDOUTr�)
r%�localer�r�r�r0�argsr�r#r�s
          r�c_locale_get_error_handlerz(SysModuleTest.c_locale_get_error_handler�s����j�j�o�o�����H�
�%(��!�"��y�y�
�������h��d�;����K�K�����&.�C�"�#��G�G�&��-����T�%/�_�_�%/�%6�%6�"%�15�	
7��
��������
rc��|j|d��}|j|d�|j|d��}|j|d�|j|d��}|j|d�|j|d	��}|j|d�|j|d
��}|j|d�|j|d��}|j|d�y)NT)r�zHstdin: surrogateescape
stdout: surrogateescape
stderr: backslashreplace
z:ignore)r�z6stdin: ignore
stdout: ignore
stderr: backslashreplace
z	iso8859-1z6stdin: strict
stdout: strict
stderr: backslashreplace
z
iso8859-1:�:r)r&r)r%r$r's   r�check_locale_surrogateescapez*SysModuleTest.check_locale_surrogateescape�s���-�-�f�t�-�D������6�	7��-�-�f�y�-�I������6�	7��-�-�f�{�-�K������6�	7��-�-�f�|�-�L������6�	7��-�-�f�s�-�C������6�	7��-�-�f�r�-�B������6�	7rc�&�|jd�y)N�C�r)rDs r�test_c_locale_surrogateescapez+SysModuleTest.test_c_locale_surrogateescape�s���)�)�#�.rc�&�|jd�y)N�POSIXr,rDs r�!test_posix_locale_surrogateescapez/SysModuleTest.test_posix_locale_surrogateescape�s���)�)�'�2rc�|�ddddd�}|jttjd��|jttjd��|jttjd��|jttjd	��tjj}|j|dd
|j|jf�|jdz|jdzz|jd
zz||jdzz|jdzz}|jtjj|�|jtjjtjjj��y)N�
r9��rCr�rtr^�	cache_tagrZ��rBr�r)rr r�implementationrtrr�r�rvrwrxr^r��lower)r%�levelsrtr^s    r�test_implementationz!SysModuleTest.test_implementation�sU����#��L������� 2� 2�F�;�<������ 2� 2�I�>�?������ 2� 2�L�A�B������ 2� 2�K�@�A��$�$�,�,�������!��w�}�}�g�m�m�&D�E��m�m�r�)�G�M�M�R�,?�?��m�m�q�(�)�+1�'�2F�2F�+G�1�+L�M��n�n��)�*�
�	
����+�+�6�6�
�C�	
����+�+�0�0��+�+�0�0�6�6�8�	:rc�h�ddlm}ddg}||�\}}}tjdk7rgt	j
d�}t	j
d�}|r|j
d|�|r|j
d	|�|s|s|j|�|jttjd
�y)Nr)rr�z#import sys; sys._debugmallocstats()r��WITH_FREELISTS�
WITH_PYMALLOCsfree PyDictObjectssSmall block thresholdT)�test.support.script_helperrrr�rirjr��assertFalser!r"�_debugmallocstats)r%rr%�retr'rz�with_freelists�
with_pymallocs        r�test_debugmallocstatsz#SysModuleTest.test_debugmallocstatss���	@��;�<��(�$�/�
��S�#��<�<�7�"�&�5�5�6F�G�N�%�4�4�_�E�M���
�
�3�S�9���
�
�6��<�!�-�� � ��%�	
���)�S�%:�%:�D�Ar�getallocatedblocksz0sys.getallocatedblocks unavailable on this buildc���	ddl}	|j�}|dv}t
j�}|jt|�t�|r|j|d�n|j|d�	|j|t
j��t!j"�t
j�}|j%||�t!j"�t
j�}|j'|t)|dz
|dz��y#t$r
}d}Yd}~��d}~wwxYw#t$rt	j
�}Y��=wxYw#t$rY��wxYw)Nr)�pymalloc�pymalloc_debugTr�)�	_testcapi�pymem_getallocatorsnamer$�ImportErrorrrDrrFr^r�r�r�r[r`r��AttributeError�gc�collect�assertLessEqualr�rc)r%rJ�
alloc_namerDrlr��br�s        r�test_getallocatedblocksz%SysModuleTest.test_getallocatedblockss6��	O��
O�&�>�>�@�
�
",�/M�!M�
�
�"�"�$���
�
�d�1�g�s�#�����q�!�$�

�#�#�A�q�)�	�
�O�O�A�s�3�3�5�6�	�
�
���"�"�$�����Q��"�
�
�
���"�"�$���
�
�a��q�2�v�q�2�v�.�/��; �
%� $�
��
%���	4�#�1�1�3�M�	4��4�	��	�s:�D8�D�6$E�	D5�(D0�0D5�8E�E�	E(�'E(c��|jtj�d�d}td|�\}}}|j	|j�d�y)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()
        r�sTrue)r^r�
is_finalizingrr�rstrip�r%r0r�r#r�s     r�test_is_finalizingz SysModuleTest.test_is_finalizingAsK���
�
�c�'�'�)�5�1�
��.�d�D�9���F�F��������'�2rc��d}td|�\}}}|j�}|jd|d�|jd|d�y)Nz�if 1:
            import sys
            class A:
                def __del__(self, sys=sys):
                    print(sys.flags)
                    print(sys.float_info)
            a = A()
            r�s	sys.flagsrssys.float_inforY)r�
splitlinesr��r%r0r�r'rzs     r�test_issue20602zSysModuleTest.test_issue20602VsN����(��d�3���C���n�n����
�
�l�C��F�+��
�
�'��Q��0rc���d}td|�\}}}|j|d�|j|j�d�|j|j�d�y)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()
            r�rr)rrrVrWs     r�&test_sys_ignores_cleaning_up_user_dataz4SysModuleTest.test_sys_ignores_cleaning_up_user_dataesZ��
��.�d�D�9���F�F�����Q���������#�.��������#�.r�getandroidapilevelzneed sys.getandroidapilevel()c�|�tj�}|j|t�|j	|d�y)Nr)rr_r]r�r�)r%�levels  r�test_getandroidapilevelz%SysModuleTest.test_getandroidapilevelvs2���&�&�(�����e�S�)����5�!�$rc�
���d���fd�}gd�}|d|�|d|�|d|dd|ddz�|d|dd|ddz�|d|d	g�|d	|d	g�|dd
z|�|d	d
z|d	g�|d|�y)Nz�if 1:
            import sys
            def f1():
                1 / 0
            def f2():
                f1()
            sys.tracebacklimit = %r
            f2()
        c����tjtjd�|zgtj��}|j�d}�j
|j�|�y)Nr�)r�rY)r�r�rrUr�r�rrZ)�tracebacklimitr�r�r'r0r%s    ��r�checkz4SysModuleTest.test_sys_tracebacklimit.<locals>.check�sS���� � �#�.�.�$��~�8M�!N�(2���9�A��-�-�/�!�$�C����S�^�^�-�x�8r)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 zeror2r�rZrYr���r�rI)r%rfrr0s`  @r�test_sys_tracebacklimitz%SysModuleTest.test_sys_tracebacklimit}s������	9�
�	�	�b�)��
�a���
�a��2�A���1�2��.�/�
�a��2�A���1�2��.�/�
�a�)�B�-��!�
�b�9�R�=�/�"�
�a��g�y�!�
�b�$�h��2���(�
�d�I�rc��|jttj�tt	tj���yr4)rr�r�	meta_pathrrDs r�test_no_duplicates_in_meta_pathz-SysModuleTest.test_no_duplicates_in_meta_path�s)������S�]�]�+�S��S�]�]�1C�-D�Er�_enablelegacywindowsfsencodingz*needs sys._enablelegacywindowsfsencoding()c��d}tddj|��\}}}|jdd�j�}|j	|d�y)N)rz$sys._enablelegacywindowsfsencoding()zCprint(sys.getfilesystemencoding(), sys.getfilesystemencodeerrors())r�z; r��replacezmbcs replace)rrrrVrr[s     r�#test__enablelegacywindowsfsencodingz1SysModuleTest.test__enablelegacywindowsfsencoding�sO��W��(��d�i�i��o�>���C���j�j��)�,�3�3�5������n�-rc�0�tjd�}tjdddd|dg}t	j
|ddd��}t
ddg�t
|�g}|j|jj�j�||�y)	Nz]
            import sys
            print(sys.argv)
            print(sys.orig_argv)
        r r�utf8r�r{T)rf�capture_outputr�)r�r�rrUr�r�r�rr#rVrZ)r%r0r%�procr�s     r�test_orig_argvzSysModuleTest.test_orig_argv�s������ �
��
����d�F�D�$��F���~�~�d�$�t�$�O���$������J�
��	
������+�+�-�8�8�:�H��	rc��|jtjt�tjD]}|j|t��yr4)r]r�stdlib_module_names�	frozensetr�)r%r�s  r�test_module_nameszSysModuleTest.test_module_names�s8�����c�5�5�y�A��+�+�D��!�!�$��,�,rc�h�tjd�}t|dd�}|r|jj	|�sd}|r|jj|�nd}|j
|jjtj�|jj|��y)Nr��__file__)
r�import_fresh_moduler�r�existsr
r�normpathr�_stdlib_dir)r%r��markerr�s    r�test_stdlib_dirzSysModuleTest.test_stdlib_dir�s���
�
.�
.�t�
4����Z��.���"�'�'�.�.��0��F�.4�2�7�7�?�?�6�*�$��������)�)�#�/�/�:����)�)�(�3�	5rr4)FN)MrFrGrHr�r�r�r�r�r�r�r�r�cpython_onlyr�r�r�r�
skipUnlessr rr��
refcount_testr�r�rr�reap_threads�requires_working_threadingr+r5rr��
is_emscriptenr�r�r�rr�r�r�r�r�r�r�r�r��requires_subprocessr�rrrr$�getpreferredencodingrrrrrqrrrr&r)r-r0r;rErSrXr\r^rbrhrkrortrxr�rIrrr�r��s3��%�@2�D=�
(�@�	-�-�2
�\�\���-��-�.?�<@��X�����&6�7�:�<�%�<�%�
�\�\���?� �?� 
�6�*�"�"�0��0�0�2�?�3�#�?�B�"�"�0��0�0�2�A�3�#�A�F]5�~9��X����.�.�0N�O�H�P�H�K�
;�$
��������(
��������,
��������"6�".�5�<�C�

�\�\��� �� �!�W� � �"�)'�#�)'�V�X����.�.�E�G��X���2��2�2�4�8S��8S�8S�TY�8Z�Z�?�A� �W� � �"�B�#�A�G�
B��X�_�_�S�_�_��
�
�2�2�4� �W� � �"�e�#�4�e�(4�5��:$7�L!�W� � �"�/�#�/�!�W� � �"�3�#�3�:�,
�\�\���B��B�*�X�����&:�;�K�M�%0�M�%0�N3�*
1�/�"�X�����&:�;�8�:�%�:�%�
!�W� � �"��#��BF��X�����&F�G�E�G�.�G�.�!�W� � �"�
�#�
�-�
5rr�c�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�UnraisableHookTestc��ddl}ddl}d|��}	|j|||�|jt	|�||j
||��d}S#d}wxYw)Nr�Exception ignored )�exc_typer4�
exc_traceback�err_msg�object)rJ�types�write_unraisable_exc�SimpleNamespacer�r_)r%rlr�r7rJr��err_msg2s       rr�z'UnraisableHookTest.write_unraisable_exc�sc����'��y�1��		��*�*�3���=��(�(�$�s�)�36�7:�7H�7H�19�03�	)�5��C��$�C�s�;A
�
Ac	�f�dD�]}|j|��5d}tjjd�5}tjj	t
dt
j�5|jtd�||�ddd�ddd�j�}|�|jd|�d|�d	�|�n|jd
|�d	�|�|jd|�|jd|�ddd���	y#1swY��xYw#1swY��xYw#1swY��-xYw)
N)Nz
original hook)r�z	an objectr��unraisablehookrr�z: r�zException ignored in: �#Traceback (most recent call last):
ru)r�r�rr�r:r�__unraisablehook__r�r6rr�)r%r�r7r�rzs     r�test_original_unraisablehookz/UnraisableHookTest.test_original_unraisablehook�s��.�G����g��.�!���\�\�1�1�(�;�v����/�/��5E�03�0F�0F�H��1�1�*�R�.�'�3�O�H�<�
�o�o�'���&��M�M�$6�w�i�r�#���"K�S�Q��M�M�$:�3�'��"D�c�J��
�
�D�c�J��
�
�0�#�6�/�.�/�
H�H��<�;��/�.�s;�"D&�4D�/D	�D�A.D&�D
�D�D#�D&�&D0	c	�l��Gd�d�}Gd�dt��G�fd�d�}||fD�]a}|j|�5|�}tjj	�5}tjjtdtj�5~ddd�ddd�j�}|jd|�|j|jj|�|jd	|�|jd
|�||ur%|jd|�|jd|�n$|jd|�|jd
|�|j|jd��ddd���dy#1swY��xYw#1swY��xYw#1swY���xYw)Nc��eZdZd�Zy)�FUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenDelc��td�}|�)N�
del is brokenr5�r%rls  r�__del__zNUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenDel.__del__�s�� ��1���	rN�rFrGrHr�rIrr�	BrokenDelr��s��
rr�c��eZdZd�Zy)�OUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenStrExceptionc��td��)Nzstr() is broken�r\rDs r�__str__zWUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenStrException.__str__�s��� 1�2�2rN)rFrGrHr�rIrr�BrokenStrExceptionr��s��
3rr�c���eZdZ�fd�Zy)�OUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenExceptionDelc�����}|�r4rI)r%rlr�s  �rr�zWUnraisableHookTest.test_original_unraisablehook_err.<locals>.BrokenExceptionDel.__del__�s���(�*���	rNr�)r�s�r�BrokenExceptionDelr��s���
rr�r�zException ignoredztest_sys.pyz	raise excz<exception str() failed>r6r�r�)r\r�r�rrvr:rr�rr�r�rHrrx)r%r�r��
test_classr7r��reportr�s       @r� test_original_unraisablehook_errz3UnraisableHookTest.test_original_unraisablehook_err�s]���	�	�	3��	3�	�	�%�&8�9�J����j�)� �l���\�\�1�1�3�v��\�\�+�+�C�1A�,/�,B�,B�D��D�4� ���*���
�
�1�6�:��
�
�j�0�0�=�=�v�F��
�
�m�V�4��
�
�k�6�2��!3�3��M�M�"6��?��M�M�"<�f�E��M�M�,��7��M�M�/�6�:�������� 5�6�'*�)�:�D�D��4�3��*�)�s=�&F)�&4F�F	�F�$C!F)�F
�F�F&�"F)�)F3	c	���Gd�d�}dD�]6}|j|��5||jj_tj
j
�5}tj
jtdtj�5|j|jj�dd�}ddd�ddd�j�}|j|jjj|�|dvr|j|d	z|�n|j|d	z|�ddd���9y#1swY��xYw#1swY��xYw#1swY��]xYw)
Nc� �eZdZGd�d�Zy)�MUnraisableHookTest.test_original_unraisablehook_exception_qualname.<locals>.Ac�"�eZdZGd�de�Zy)�OUnraisableHookTest.test_original_unraisablehook_exception_qualname.<locals>.A.Bc��eZdZy)�QUnraisableHookTest.test_original_unraisablehook_exception_qualname.<locals>.A.B.XN�rFrGrHrIrrrJr�s��rrJN)rFrGrHr\rJrIrr�Br�s���	�rr�N)rFrGrHr�rIrr�Ar�s��
�
rr�)rr��some_module)�
moduleNamer�r~r7)rr��.)r�r�rJrGr�rrvr:rr�r�rr�rH�assertNotIn)r%r�r�r�r�r�s      r�/test_original_unraisablehook_exception_qualnamezBUnraisableHookTest.test_original_unraisablehook_exception_qualnames��
	�	�
@�J������4�#-������ ��\�\�1�1�3�v�t�|�|�?U�?U��)�3�+A�+A�@� $�8�8��������� �H�@�3� ���*���
�
�a�c�c�e�e�0�0�&�9��!9�9��$�$�Z�#�%5�v�>��M�M�*�s�"2�F�;�5�4�@�@�@��3�3��5�4�s<�:E �4E�,E	�=E�A7E �E
�
E�E�E � E*	c�(�td�}tjjtdtj
�5|j
t�5t	j|�ddd�ddd�y#1swY�xYw#1swYyxYw)Nrr�)	r6r�rr:rr�r!r"r�r�s  r�'test_original_unraisablehook_wrong_typez:UnraisableHookTest.test_original_unraisablehook_wrong_type0sh����n��
�\�\�
#�
#�C�)9�$'�$:�$:�<��"�"�9�-��"�"�3�'�.�<�<�-�-��<�<�s#�B�A<�+B�<B	�B�Bc	�n��d��fd�}t�}	tjjtd|�5|jt
d�d|�}dj�D]+}|jt�|�t||��|f��-	ddd�d}d�y#1swY�xYw#d}d�wxYw)Nc�
��|�yr4rI)r%�	hook_argss �r�	hook_funcz@UnraisableHookTest.test_custom_unraisablehook.<locals>.hook_func:s����Irr�rzcustom hookz/exc_type exc_value exc_traceback err_msg object)
r�r�rr:rr�r6�splitrr�)r%r�r7r�r�r�s     @r�test_custom_unraisablehookz-UnraisableHookTest.test_custom_unraisablehook7s�����	�	��h��	����'�'��-=�y�I��4�4�Z��^�5B�C�I��M�S�S�U�D��$�$�W�Y��%=�%,�X�t�%<�&/��%:�<�V�J��H��I�J�I���H��I�s#�%B.�AB"�B.�"B+�'B.�.B4c��d�}tjjd�5}tjjtd|�5|jt
d�dd�ddd�ddd�j�}|jd|�d�|�|jd|�|jd	|�y#1swY�\xYw#1swY�`xYw)
Nc��td��)Nzhook_func failedr�)r%s rr�zEUnraisableHookTest.test_custom_unraisablehook_fail.<locals>.hook_funcMs���.�/�/rr�r�rzcustom hook failz)Exception ignored in sys.unraisablehook: r�r�zException: hook_func failed
)	r�rr�r:rr�r6rr�)r%r�r�rzs    r�test_custom_unraisablehook_failz2UnraisableHookTest.test_custom_unraisablehook_failLs���	0��\�\�
)�
)�(�
3�v����'�'��-=�y�I��)�)�*�R�.�*<�d�D�J�4�
�o�o����
�
�A�"�
�R�)��	�	
�
�
�<�c�B��
�
�5�s�;�J�I��4�
3�s#�&C
�	C�&C
�C
	�C
�
CN)
rFrGrHr�r�r�r�r�r�r�rIrrr�r��s&��
�7�$&7�P<�4(��*<rr�c���eZdZd�Zej
jZd�Zd�Zd�Z	�fd�Z
d�Zd�Zd�Z
d	�Zd
�Z�xZS)�
SizeofTestc��tjd�|_tjj
|_ddl}|j|_	y)N�Pr)
�struct�calcsizer�rrXrZ�	longdigit�_testinternalcapi�SIZEOF_PYGC_HEAD�gc_headsize)r%r�s  r�setUpzSizeofTest.setUp`s4������%������2�2��� �,�=�=��rc��tjj}|j}|j	tjd�|d�|jz�|j	tjg�|d�|z�y)NTr�Pn)r�r�calcvobjsizer�rr�	getsizeofr�)r%�vsize�gc_header_sizes   r�test_gc_head_sizezSizeofTest.test_gc_head_sizehsd�����)�)���)�)��������t�,�e�B�i�$�.�.�.H�I�������r�*�E�$�K�.�,H�Irc��Gd�d�}|jttj|��Gd�d�}|jttj|��dg}|jtj|�|�|�Gd�d�}|jttj|��|jtj|�|�|�Gd�d	t�}|jtj|tj��tj|jd
zz�|jt�5tj|tjdz��ddd�|jt�5tj|d��ddd�|jttf�5tj|tjdz
��ddd�y#1swY��xYw#1swY�gxYw#1swYyxYw)
Nc��eZdZd�Zy)�)SizeofTest.test_errors.<locals>.BadSizeofc��t�r4r5rDs r�
__sizeof__z4SizeofTest.test_errors.<locals>.BadSizeof.__sizeof__ss�� � rN�rFrGrHr�rIrr�	BadSizeofr�r���
!rr�c��eZdZd�Zy)�-SizeofTest.test_errors.<locals>.InvalidSizeofc��yr4rIrDs rr�z8SizeofTest.test_errors.<locals>.InvalidSizeof.__sizeof__xs��rNr�rIrr�
InvalidSizeofr�ws��
rr��sentinelc��eZdZd�Zy)�+SizeofTest.test_errors.<locals>.FloatSizeofc��y)Ng@rIrDs rr�z6SizeofTest.test_errors.<locals>.FloatSizeof.__sizeof__r�rNr�rIrr�FloatSizeofr�~r�rr�c��eZdZd�Zy)�.SizeofTest.test_errors.<locals>.OverflowSizeofc��t|�Sr4)r�rDs rr�z9SizeofTest.test_errors.<locals>.OverflowSizeof.__sizeof__�s���4�y� rNr�rIrr�OverflowSizeofr��r�rr�rZrYrg)r!r6rr�r"r^r�rror��
OverflowError)r%r�r�r�r�r�s      r�test_errorszSizeofTest.test_errorsqs���	!�	!�	
���*�c�m�m�Y�[�A�	�	�	
���)�S�]�]�M�O�D��<���
�
�c�m�m�M�O�X�>��I�	�	�	
���)�S�]�]�K�M�B��
�
�c�m�m�K�M�8�<�h�G�	!�S�	!�	
������~�c�k�k�'B�C����t�'7�'7��'9�9�	;�
�
�
�}�
-��M�M�.����q��9�:�.�
�
�
�z�
*��M�M�.��,�-�+�
�
�
�
�M�:�
;��M�M�.�#�+�+���)9�:�;�<�
;�	.�
-��
*�
*��
;�
;�s$�1-H1�;H=�:.I	�1H:�=I�	Ic��tjj}|jt	j
d�|d�|jz�|jt	j
dd�|d�|jz�y)NTrrg)r�rr�rrr�r�)r%�sizes  r�test_defaultzSizeofTest.test_default�s_���|�|�(�(��������t�,�d�2�h����.G�H�������t�R�0�$�r�(�T�^�^�2K�Lrc	�����$�%�tj}tjj�%tjj
}�j�$�$d|d��jz��$d|d��jz��$t�%d��dddzg}|D]-}t|�}�$||d�|j�z��/�$tt���%d	���$d|d
�dz��$d|d
�d
z�d�}�$|�jd�%d���fd�}||�j�%d��||j�%d��d�}||j�%d�|d
�z��$tdd��%d���$tj �%d��ddl}	�$|	j$j&�%d��ddl}
�$|
j*j,�%d���$t.j0�%d���$ij2�%d���$i�%d���$ddi�%d�|t4�zdzd|d�zz�t7d�D�cic]}t|�|��}}�$|�%d�|t4�zdzd|d�zz��$ddi�%d�|t4�zdzd|d�zz�dd d!d"dd#d$dd%�}�$|�%d�|t4�zdzd|d�zz��$ij9��%d���$ij;��%d���$ij=��%d���$ti��%d&���$tij9���%d&���$tij;���%d&���$tij=���%d&��Gd'�d(t>�}
�$|
j@�%d���$tC��%d)���$tEddddd��%d*���$tGddddd��%d*���$tIdddd��%d*���$tJ�%d��ddl&}ddl'}|jP|jRjT�}�$|�%d+���$tWg��%d,���$tYd��%d	���$t[d��%d-���$t\j^|d��j`tt\j^�zz�d.�}|�}�$|�%d/��d0�}�$|�%d1��G�$�%fd2�d3�}d4�}�$|��%d5���$td6��%d7��ddl1}�$|jedd��%d���$tgg�|d8���$tgdg�|d8�d �j`zz��$tgdd g�|d8�d �j`zz��$tggd9��|d8�d"�j`zz��$tg��%d7���$tYg��%d	���$d|d��jz��$d|d��jz��$d:|d��jz�d t\jhjjz}�$t/|�|d�d �jzz��$t/|d zdz
�|d�d �jzz��$t/|d z�|d�d!�jzz��$tl�%d;���$d�%d���$tn�%d���$t?��%d��G�$�%fd<�d(t>�}
�$tt7d���%d=���$tt7d d>z���%d?���$tYd��%d	���$t7d��%d@���$t7dA��%d@��d}gt7d�t7dB�g}�%dC|d	zzdDz�}|D]�}t|�}|dk(rd}|d z}|}||kr|dz}||kr�|dkr%�$tq|�|��$ts|�|��V�$tq|�|||d	�zz��$ts|�|||d	�zz����$ttq���%dE���$tud��%d?���$twt.��%d?���$dF|d���$d9|d�d!�j`zz�dG}|d|z�}�$t.|�||dHz�}GdI�dJt>�}�$|||t4�zdKzdL|d�zz�t7dM�D�cgc]	}|���c}�$|�j@�%d��j`z�|�}dx|_<x|_=x|_>x|_?x|_@x|_Ax|_B|_C�$|||t4�zdKzdL|d�zz��$|�j@�%d��j`z�gdN�}dO}|d	z}|dz} |D]�}t�t�|��}!|!dPkr�%|�t|�zdz}"nW|!dQkr�%|�t|�zdz}"n:|!dRkr�%|�d t|�dzzz}"n�%|�d"t|�dzzz}"�$||"���t�dS�}�$|�%|�d"z�t�|dTdU��$|�%|�d"zd"z�ddlH}#�$|#j�t.��%dV���$|#j�t.��%dV��ycc}wcc}w)WNTrF�5Pr�ui���n2Pi�nPr�rYs
xxxxxxxxxxr9c���d��fd�}|S)Nrc����Sr4rI�r|s�r�innerz<SizeofTest.test_objecttypes.<locals>.get_cell.<locals>.inner������rrI)r�r|s @r�get_cellz-SizeofTest.test_objecttypes.<locals>.get_cell�s����A�
��Lrrr�c�P���jtj|�|�yr4)r[rr�)r��
expected_sizer%s  �r�check_code_sizez4SizeofTest.test_objecttypes.<locals>.check_code_size�s����#�#�C�M�M�!�$4�m�Dr�6i13Pc����fd�}|S)Nc����Sr4rIr�s�rr�z=SizeofTest.test_objecttypes.<locals>.get_cell2.<locals>.inner�r�rrI)r|r�s` r�	get_cell2z.SizeofTest.test_objecttypes.<locals>.get_cell2�s
���
��Lr�2d�3PPP�3PP�3P2P�2P�nQ2Pr�rBr�r7r2�n2PrZr�r���)rYrZr�r�r�rrrB�P2nPnc��eZdZy)�&SizeofTest.test_objecttypes.<locals>.CNr�rIrrr+r���rr+�6Pbz	6Pb 2P2nP�32B2iB�n4Pr"c�*�tj�Sr4)rr�rIrrr
z)SizeofTest.test_objecttypes.<locals>.func�s���=�=�?�"rz3Pi3c7P2ic??2Pc��yr4rIrIrrr
z)SizeofTest.test_objecttypes.<locals>.funcs��Dr�15Pic�r��eZdZed��Zed��ZW�eW�d��W�eW�d��y)�&SizeofTest.test_objecttypes.<locals>.cc��yr4rIrIrrr@z*SizeofTest.test_objecttypes.<locals>.c.foo���rc��yr4rI)�clss r�barz*SizeofTest.test_objecttypes.<locals>.c.bar
rr�PPN)rFrGrH�staticmethodr@�classmethodr!�rfr�s��rr�rsE���
�
��
�
�
��
�
�#�t�D�z�"��#�t�D�z�"rr�c3�K�d��y�w)NrYrIrIrr�get_genz,SizeofTest.test_objecttypes.<locals>.get_gens
����Q�w�s�zPP4P4c7P2ic??2Pr��lPr�)rYrZr�rg�PnPPPc�X��eZdZd�Zd�Zd�Zeeeed�ZW�eW�d��y)rc��|jSr4��_C__xrDs r�getxz+SizeofTest.test_objecttypes.<locals>.C.getx8s
��4�8�8�Orc��||_yr4r,)r%�values  r�setxz+SizeofTest.test_objecttypes.<locals>.C.setx9s��e�4�8rc��|`yr4r,rDs r�delxz+SizeofTest.test_objecttypes.<locals>.C.delx:s���rr�5PiN)rFrGrHr.r1r3�propertyr|r%s��rr+z&SizeofTest.test_objecttypes.<locals>.C7s*���+�3�(���t�T�2�.�A��!�T�%�[�!r�3l�A�3P�4Pi�r��3nP�2nP�P3nrI�P2nPI13Pl4Pn9Pn12PIPc�4P36P3P10P2P6P1PIc��eZdZy)�2SizeofTest.test_objecttypes.<locals>.newstyleclassNr�rIrr�
newstyleclassr@srrrAr@rr�)�d1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111udÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿuPĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀĀu,￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿ux𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀u�􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿􏿿�nnbrA�ii@z<stdin>r/�2Pn3P)Kr�r�r�r�calcobjsizer��check_sizeofr�r��	bytearray�	__alloc__�iter�__closure__r��complexr�r9�datetime�	timedelta�days�collections�defaultdict�default_factoryr��__add__�__iter__�DICT_KEY_STRUCT_FORMATrc�keys�values�itemsr��__dict__�
BaseException�UnicodeEncodeError�UnicodeDecodeError�UnicodeTranslateError�Ellipsisr�encodings.iso8859_3�
charmap_build�	iso8859_3�decoding_tabler�reversed�floatrrVr��re�finditerrMrXrYr�NotImplementedrrw�slice�superr�rRr�r"rbrW�g�h�ord�max�chrr.�weakref�ref�proxy)'r%r�r��samples�sampler|rrrrMrPr��longdictr+r�	encodingsr
r�r're�PyLong_BASE�
PySet_MINSIZEr��minused�tmp�newsize�fmtrAr�o�asciifields�
compactfields�
unicodefields�maxchar�Lrorfr��	__class__s'`                                   @@�r�test_objecttypeszSizeofTest.test_objecttypes�s�
����?�?���|�|�'�'�����)�)���!�!��
�d�E�"�I����.�/�
�e�U�2�Y����/�0�	�c�4��:����V��$���F��&�!�A��!�U�6�]�Q�[�[�]�2�3��	�d�9�;���d��,�
�c�5��:��>�"�
�i��s��b��)�	�
	�h�j�$�$�Q�'��c��3�	E���
�+�+�T�'�]�;���)�)�4��=�9�	�	�	�*�*�D��M�H�S�M�,I�J�
�g�a��l�D��J�'�
�c�i�i��f��&�	�
�h� � �%�%�t�E�{�3��
�k�%�%�5�5�t�E�{�C�
�c�k�k�4��<�(�
�b�k�k�4��:�&�
�b�$�v�,��
�s�A�h��V��x�0F�'G�G�!�K�v�W_�`d�We�Ne�e�f�',�Q�x�0�x�!�C��F�A�I�x��0�
�h��V��x�0F�'G�G�"�L�PW�Ya�bf�Yg�Og�g�h�
�q�!�f�d�6�l�X�.D�%E�E��I�V�U]�^c�Ud�Ld�d�e��1��Q�!�q�A��;��
�h��V��x�0F�'G�G�"�L�PW�Ya�bg�Yh�Oh�h�i�
�b�g�g�i��c��#�
�b�i�i�k�4��9�%�
�b�h�h�j�$�s�)�$�
�d�2�h��W�
�&�
�d�2�7�7�9�o�t�G�}�-�
�d�2�9�9�;���g��/�
�d�2�8�8�:���W�
�.����
�a�j�j�$�s�)�$�
�m�o�t�E�{�+�
� ��R��A�r�2�D��4E�F�
� ��S�!�Q��3�T�+�5F�G�
�#�B��1�b�1�4��3D�E�
�h��R��!�*� �F� � ��!4�!4�!C�!C�D��
�a��h�� �
�i��m�T�%�[�)�
�h�r�l�D��J�'�
�e�A�h��S�	�"�
�c�n�n�e�B�i�$�&�&�3�s�~�~�3F�*F�F�G�	#��F��
�a��&�'�(��
�d�D��L�!�
	#�
	#�	�
�g�i��/�0�1�
�d�5�k�4��:�&��
�b�k�k�"�R� �$�t�*�-�
�d�2�h��d��$�
�d�A�3�i��t��q����x�/�0�
�d�A�q�6�l�E�$�K�!�D�F�F�(�2�3�
�d�9�o�u�T�{�Q�t�v�v�X�5�6�	�d�2�h��T�
�#�
�h�r�l�D��J�'�
�a��r��T�^�^�+�,�
�a��r��T�^�^�+�,�
�b�%��)�d�n�n�,�-�����4�4�4��
�c�+���b�	�A�d�n�n�,<� <�=�
�c�+�q�.��"�#�U�2�Y��4�>�>�1A�%A�B�
�c�+�q�.�!�5��9�q����/?�#?�@�
�h��W�
�&�
�d�D��H��
�n�d�2�h�'�
�f�h��R��!�	"��	"�	�d�5��8�n�d�4�j�)�
�d�5��B��<� �$�t�*�-�
�h�r�l�D��J�'�
�e�A�h��T�
�#�
�e�E�l�D��J�'��
��u�R�y�%��)�,�����t�+�+�e�3�4���F��&�k�G��!�|�1�S��a�i�G�#�G��W�$�!�Q�,���W�$��!�|��c�&�k�1�%��i��'��+��c�&�k�1�w�x��~�'=�#=�>��i��'��W�X�d�^�-C�)C�D�� 	�d�3�5�k�4��;�'�
�e�A�h��T�
�#�
�e�C�j�$�t�*�%�
�b�%��)��
�g�u�R�y�1�T�V�V�8�+�,�&���$��*���
�c�1�
��#���
��	*�F�)�
�m�Q��*@�!A�A�B�F��H�UY�N�IZ�Z�[�"'��*�-�*�Q���*�-�
�m�o�&�&��V��t�v�v�(=�>��O��89�9���9�a�c�9�A�C�9�!�#�9���9�a�c�9�A�C�!�#�
�m�Q��*@�!A�A�B�F��H�UY�N�IZ�Z�[�
�m�o�&�&��V��t�v�v�(=�>�
6����#�d�*�
�%��+�
��A��#�a�&�k�G���}���%��A��.��2���3����'�#�a�&�0�1�4���5����'�!�S��V�a�Z�.�8����'�!�S��V�a�Z�.�8���!�Q�K��
��K��
�a��m�$�q�(�)�	��9�f�%�
�a��m�$�q�(�1�,�-�	�
�g�k�k�#���W�
�.�	�g�m�m�C� �$�w�-�0��g1��L	.s�%q&�+q+c��tj|�tj|�z}t	j
|�r$t	j
|�s||jz
}|jtj|�|�yr4)rr�r�r�rN�
is_trackedr�r)r%r7�base�extrar�s     r�check_slotszSizeofTest.check_slots�s^���=�=��&�����)?�?��
�=�=���b�m�m�D�&9���(�(�(�H�������s�+�X�6rc���|j}Gd�dt�}||�t�d�Gd�dt�}||g��dgid�Gd�d	t�}||�gd�Gd
�dt�}||�t	�d�Gd�d
t
�}||�t�d�ddlm}Gd�d|�}||g��|g��d�y)Nc��eZdZdZy)�!SizeofTest.test_slots.<locals>.BA�r�rRr�N�rFrGrH�	__slots__rIrr�BAr�����%�Irr�r8c��eZdZdZy)� SizeofTest.test_slots.<locals>.Dr�Nr�rIrr�Dr��r�rr�r�r|c��eZdZdZy)� SizeofTest.test_slots.<locals>.Lr�Nr�rIrrr�r��r�rr�c��eZdZdZy)� SizeofTest.test_slots.<locals>.Sr�Nr�rIrrr�r��r�rr�c��eZdZdZy)�!SizeofTest.test_slots.<locals>.FSr�Nr�rIrr�FSr��r�rr�r)�OrderedDictc��eZdZdZy)�!SizeofTest.test_slots.<locals>.ODr�Nr�rIrr�ODr��r�rr�)r�rHr�rMrrwrPr�)	r%rfr�r�r�r�r�r�r�s	         r�
test_slotszSizeofTest.test_slots�s���� � ��	&��	&�
�b�d�I�K��&�	&��	&�
�a�"�g��R�y�$�'�	&��	&�
�a�c�2�t��	&��	&�
�a�c�3�5�$��	&��	&�
�b�d�I�K��&�+�	&��	&�
�b�2�h��b�)�4�0rc���tjj}tjj}|j}ddl}||j
�|d��	t�#t$r'}|j}|�|||d��Yd}~nd}~wwxYw|tj|d�|jttj�zz�y)Nrr��2P2ir)
r�rrFr�rG�_ast�ASTr"r_rr�r�r�)r%r�r�rfr�rb�tbs       r�test_pythontypeszSizeofTest.test_pythontypes�s����|�|�'�'�����)�)���!�!���
�d�h�h�j�$�s�)�$�	(��O���	(����B��~��b�$�v�,�'���		(��	�c�i�i��r��T�V�V�c�#�)�)�n�%<�<�=s�#A)�)	B�2B�Bc��tj�}|j|j�|j|j�d�}tj
|��tj�}|j
|j|�|j
|d|�|j
|jd�|j
|dd�d�}tj
|��tj�}|j
|j|�|j
|d|�|j
|j|�|j
|d|�tj
|�tj�}|j|j�|j|j�y)Nc��yr4rI�r�s r�<lambda>z0SizeofTest.test_asyncgen_hooks.<locals>.<lambda>����tr)�	firstiterrrYc��yr4rIr�s rr�z0SizeofTest.test_asyncgen_hooks.<locals>.<lambda>�r�r)�	finalizer)r�get_asyncgen_hooksr�r�r��set_asyncgen_hooksr^)r%�oldr��hooksr��curs      r�test_asyncgen_hookszSizeofTest.test_asyncgen_hooks�sF���$�$�&�����#�-�-�(����#�-�-�(�#�	�����3��&�&�(���
�
�e�o�o�y�1��
�
�e�A�h�	�*��
�
�e�o�o�t�,��
�
�e�A�h��%�#�	�����3��&�&�(���
�
�e�o�o�y�1��
�
�e�A�h�	�*��
�
�e�o�o�y�1��
�
�e�A�h�	�*�����$��$�$�&�����#�-�-�(����#�-�-�(rc��tjd�}td|�\}}}|j|d�|j|d�y)Nz�
            import sys
            class MyStderr:
                def write(self, s):
                    sys.stderr = None
            sys.stderr = MyStderr()
            1/0
        r�r)r�r�rrr[s     r�/test_changing_sys_stderr_and_removing_referencez:SizeofTest.test_changing_sys_stderr_and_removing_reference�sK����� �
��-�T�4�8���C������c�"�����c�"r)rFrGrHr�r�rrGr�r�r�r�r�r�r�r�r��
__classcell__)r�s@rr�r�]sJ���>��<�<�,�,�L�J�<�>M�
O1�b7�1�0>�()�4#rr�r�)&rrrNrAr$r�r�r�r�r�rri�test.supportr�rrr?rrrrr�rr�r	rLrrU�TestCaserrMrsr�r�r�r�rF�mainrIrr�<module>r�s8���
�	�	�
��	�
�
��
����"�N�)�&�����)�
�"��7!�h�'�'�7!�t=�8�,�,�=�@"B�X�&�&�"B�PA5�H�%�%�A5�H �����N<��*�*�N<��N<�b�����b#��"�"�b#��b#�H
�z���H�M�M�O���S7���L��s�"D5�5D?�>D?

Youez - 2016 - github.com/yon3zu
LinuXploit