403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
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:/Python315/Lib/test/test_capi/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python315/Lib/test/test_capi/__pycache__/test_misc.cpython-315.opt-1.pyc
R
>lqjM�c��]PHs]QHGs]PHs]PHs]PHs]PHs]PH s]PH$s	]PH(s
]PH,s]PH0s]PH4s
]PH8s]PH<s]PH@s]PHDs]PHHs]PHLs]QHPGs]QHXGs]QHXGs]QHXGs]QHXGs]QHXGs]QHXGs]Q	HXGs]Q
HXGs]QH|G s G!s!G"s"]PH�s#]PH�s%]PH�s&]PH�s'\ORQ2s*]Q
H�G+s+G,s,]PH�s-]PH�s.Ps/Qs0Qs1Qs2QQ2s3\O<%fQLQs4\OjQQ\Ol22s7\QQ\Ol22s8QQ\Ol2s9QQ\Ol2s:\1QQ\Ol22s;\1QQ \Ol22s<Q!Q"\Ol2s=Q#Q$\Ol2s>Q?Q%ks?Q&Q'\Ol2s@Q(Q)\Ol2sAQ*Q+\Ol2sB\O�2Q,Q-\Ol22sD\O�\%PIQ.2Q/Q0\Ol22sFQ1Q2\Ol2sG]dsHQ3Q4\Ol2sIQ5Q6\Ol2sJ\O�\O<Q72Q8Q9\Ol22sLQ:Q;\Ol2sMQ<Q=\Ol2sN\OQ>6Xc\O�2P!P!\$cPs#CK�h9h\$cPs%CK�h9h\$cPs&CK�h9h\(cPs'CK�h9h)@�)�deque)�support)�MISSING_C_DOCSTRINGS)�
import_helper)�
script_helper)�threading_helper)�warnings_helper)�requires_limited_api)� expected_failure_if_gil_disabled)�Py_GIL_DISABLED)�assert_python_failure�assert_python_ok�run_python_until_end�	_testcapi)�HeapCTypeSubclass�HeapCTypeSubclassWithFinalizerc�H�UOQQ2OQP2!)�utf-8�replace�
)�decoder)�errs&�-C:\Python315\\Lib\test\test_capi\test_misc.py�
decode_stderrr<s ���:�:�g�y�)�1�1�$��;�;�c�J�[O[PIQ2U2!)z>Decorator to skip a test if subinterpreters are not supported.zsubinterpreters required)�unittest�skipIf�
_interpreters)�meths&r�requires_subinterpretersr @s%���?�?�=�D�0�5�7�7;�=�=rc��U!)zsome doc���selfs&r�testfunctionr%Fs���Krc�\�\sQs]Ks\O\2s\O\2sQsP!)�InstanceMethodr")	�__name__�
__module__�__qualname__�__firstlineno__r�instancemethod�idr%�__static_attributes__r"rrr'r'Ks"��	�	!�	!�"�	%�B��+�+�L�9�Lrr'zCurrent thread.*:\nzStack .*:\nc�2`�\sQs]SsnQs\O2Q2sQs\	O\Q2Q2s\	O\Q2Q2s
\	O\Q2Q2sQ	sQ
sQsQsQ
sQsQsQsQs\O4Q2\O62\O82Q222s\O4Q2\O62\O82Q222sQs\	O\Q2Q2s Qs!Qs"Qs#Qs$Qs%Qs&Qs'Qs(Qs)Q s*Q!s+Q"s,Q#s-Q$s.Q%s/Q&s0Q's1Q(s2Q)s3Q*s4Q+s5Q,s6Q-s7Q.s8Q/s9Q0s:Q1s;Q2s<Q3s=Q4s>Q5s?Q6s@Q7sAQ8sBQ9sCQ:sDUsEP!);�CAPITestc�@�[2oUO[U2UO22UOUO	2UI2UOUOO
[O
2UO[OO
[O
2Q[OmUO[OQ2UO[[UOQQ2P!)�test�	attribute)
r'�assertEqualr-�
assertTruer%�__doc__r3�assertRaises�AttributeError�setattr�r$�insts& r�test_instancemethod�CAPITest.test_instancemethodVs����������D��4�7�7�9�-�����)�)�+�t�3�4�����*�*�2�2�L�4H�4H�I�����4�4�<�<�l�>R�>R�S�06��#�#�-�����/�/��8����.�'�4�3D�3D�k�SY�Zrc�,�[OQ2o[QU2vq#UvqEoUOUQ2[O
%fQO
2oLQO
2oUOUO2U2P!)z�
            import _testcapi
            from test import support

            with support.SuppressCrashReport():
                _testcapi.crash_no_current_thread()
        �-crz�Fatal Python error: PyThreadState_Get: the function must be called with the GIL held, after Python initialization and before Python finalization, but the GIL is released (the current Python thread state is NULL)aFatal Python error: PyThreadState_Get: the function must be called with an active thread state, after Python initialization and before Python finalization, but it was called without an active thread state. Are you trying to call the C API inside of a Py_BEGIN_ALLOW_THREADS block?)	�textwrap�dedentrr4rr�encode�assertStartsWith�rstrip)r$�code�
run_result�	_cmd_line�_rc�outr�msgs&       r� test_no_FatalError_infinite_loop�)CAPITest.test_no_FatalError_infinite_loopas������ �
��!5�T�4� @��
�"�
��#�����c�"��&�&�&�?�AG���	
�`�bh�ag�ai�	
�
	
���c�j�j�l�C�0rc�P�UO[[O2P!�N)r7�
ValueErrorr�!make_memoryview_from_NULL_pointerr#s&r�!test_memoryview_from_NULL_pointer�*CAPITest.test_memoryview_from_NULL_pointer}s�����*�i�&Q�&Q�Rrz(_posixsubprocess required for this test.c��QQ[2oUO[Q29^tt^2[O]U2P	Q]]]]]	]
]]]
]P	P	]P
]]]]2PPP2QQ[2oUO[[O]U2P	Q]]]]]	]
]]]
]P	P	]P
]]]]2P!)%fhK`9h)c�(`�\sQs]�snQsQsUsP!)�1CAPITest.test_seq_bytes_to_charp_array.<locals>.Zc��]!��r"r#s&r�__len__�9CAPITest.test_seq_bytes_to_charp_array.<locals>.Z.__len__����rr"�r(r)r*r+rYr.�__classdictcell__��
__classdict__s@r�ZrU������
�
rr`�indexingc�.`�\sQs]�snQsQsQsUsP!)rUc�$�[O!rN)�sys�maxsizer#s&rrYrZ�s���{�{�"rc��Q!)�xr")r$�is&&r�__getitem__�=CAPITest.test_seq_bytes_to_charp_array.<locals>.Z.__getitem__����rr")r(r)r*r+rYrjr.r]r^s@rr`rU�s����
#�
�
r�rX�)�object�assertRaisesRegex�	TypeError�_posixsubprocess�	fork_execr7�MemoryError�r$r`s& r�test_seq_bytes_to_charp_array�&CAPITest.test_seq_bytes_to_charp_array�s���	��	��
#�
#�I�z�
:�
:��&�&��A�C��V�A�a��!�A�b��B�r�"�T�$�r�RW�XZ�[]�^`�ac�
e�;�	��	�
	
���+�'7�'A�'A��A�C��V�A�a��!�A�b��B�r�"�T�$�r�RW�XZ�[]�^`�ac�	e�;�
:�s�1B8�8C	�C	c��QQ[2oUO[[OU2Q,P	Q]]]]]	]
]]]
]P	P	]P
]]]]2P!)c�(`�\sQs]�snQsQsUsP!)�-CAPITest.test_subprocess_fork_exec.<locals>.Zc��]!rWr"r#s&rrY�5CAPITest.test_subprocess_fork_exec.<locals>.Z.__len__�r[rr"r\r^s@rr`rz�rarr`�1rm)ror7rqrrrsrus& r�test_subprocess_fork_exec�"CAPITest.test_subprocess_fork_exec�sa��	��	�
	
���)�%5�%?�%?��#�t�f�T�&��1�Q�q��2�b��B�r�$�t�TV�W\�]_�`b�ce�fh�	jrz6Signature information for builtins requires docstringsc�H�UO[OOP2UO[OOP2UO[O
OP2UO[O
OP2UO[OOQ2UO[OOP2UO[OOQ2UO[OOP2UO[OOQ2UO[OOP2UO[OOQ2UO[OOQ2UO[OOP2UO[OOQ2UO[OOQ2UO[OOQ2P!)Nz This docstring has no signature.z[docstring_with_invalid_signature($module, /, boo)

This docstring has an invalid signature.zedocstring_with_invalid_signature2($module, /, boo)

--

This docstring also has an invalid signature.z%This docstring has a valid signature.z($module, /, sig)z>
This docstring has a valid signature and some extra newlines.z($module, /, parameter))r4r�no_docstringr6�__text_signature__�docstring_empty�docstring_no_signature� docstring_with_invalid_signature�!docstring_with_invalid_signature2�docstring_with_signature�#docstring_with_signature_but_no_doc�+docstring_with_signature_and_extra_newlinesr#s&r� test_docstring_signature_parsing�)CAPITest.test_docstring_signature_parsing�s���	
����/�/�7�7��>�����/�/�B�B�D�I�����2�2�:�:�D�A�����2�2�E�E�t�L�����9�9�A�A�.�	0�����9�9�L�L�d�S�����C�C�K�K�
7�	�
	
����C�C�V�V�X\�]�����D�D�L�L�
<�	�	
����D�D�W�W�Y]�^�����;�;�C�C�3�	5�����;�;�N�N�Pc�d�����F�F�N�N�PT�U�����F�F�Y�Y��	!�	
����N�N�V�V�M�	O�����N�N�a�a�%�	'rc��[OoU2oU2oUOV#*QV#12UOU]**QU]*12UO]*U*Q]*U12SoVC*oUOUQV#12SoU]**oUOUQU]*12]*oVB*oUOUQ]*U12P!)�matmul�imatmul)r�
matmulTyper4)r$�M�m1�m2�os&    r�&test_c_type_with_matrix_multiplication�/CAPITest.test_c_type_with_matrix_multiplication�s���� � ��
�S��
�S�������8�R�"4�5�����b��8�R��"4�5�����b��8�R��"4�5���	�������Y��/�0���	�R�������Y��B�/�0���	�������X�r�2�.�/rc��[O2oUOUO]2Q2UOUO]]2Q2P!)rX)rXN)rnrn)r�ipowTyper4�__ipow__)r$r�s& r�test_c_type_with_ipow�CAPITest.test_c_type_with_ipow�sE��
��� ��������A��	�2�������A�q�)�6�2rc���[O%cW[OQ2o[	QU2vq#o[U2oUO
UQ[*Q*2P!UO[29^tt^2o[O2PPP2UO
[WO2Q2P!)%fhK79h)z�
                import _testcapi
                from test import support

                with support.SuppressCrashReport():
                    _testcapi.return_null_without_error()
            r?z�Fatal Python error: _Py_CheckFunctionResult: a function returned NULL without setting an exception\nPython runtime state: initialized\nSystemError: <built-in function return_null_without_error> returned NULL without setting an exception\n\nz   File .*", line 6 in <module>\nzFreturn_null_without_error.* returned NULL without setting an exception)r�Py_DEBUGr@rArr�assertRegex�CURRENT_THREAD_REGEXr7�SystemErrorr�return_null_without_error�str�	exception�r$rE�rcrIr�cms&     r�test_return_null_without_error�'CAPITest.test_return_null_without_error�s��������?�?�$��D�1��t�<�L�B�S���$�C����S��%�
%�4�4�
5��"�"�;�/�/�2��3�3�5�0����S����.�J�
K�0�/���C�C	�C	c���[O%cW[OQ2o[	QU2vq#o[U2oUO
UQ[*Q*2P!UO[29^tt^2o[O2PPP2UO
[WO2Q2P!)%fhK79h)z�
                import _testcapi
                from test import support

                with support.SuppressCrashReport():
                    _testcapi.return_result_with_error()
            r?a?Fatal Python error: _Py_CheckFunctionResult: a function returned a result with an exception set\nPython runtime state: initialized\nValueError\n\nThe above exception was the direct cause of the following exception:\n\nSystemError: <built-in function return_result_with_error> returned a result with an exception set\n\nz  File .*, line 6 in <module>\nzBreturn_result_with_error.* returned a result with an exception set)rr�r@rArrr�r�r7r�r�return_result_with_errorr�r�r�s&     r�test_return_result_with_error�&CAPITest.test_return_result_with_error�s��������?�?�$��D�1��t�<�L�B�S���$�C����S��)�)�7�
7�
8� �"�"�;�/�/�2��2�2�4�0����S����.�G�
H�0�/�r�c���[OQ2o[QU2vq#o[U2oQU7c'UO	UQ[
*Q*2P!UO
QU2P!)z�
            import _testcapi
            from test import support

            with support.SuppressCrashReport():
                _testcapi.getitem_with_error({1: 2}, 1)
        r?z
SystemError: z�Fatal Python error: _Py_CheckSlotResult: Slot __getitem__ of type dict succeeded with an exception set\nPython runtime state: initialized\nValueError: bug\n\nz4  File .*, line 6 in <module>\n\nExtension modules: z'returned a result with an exception set)r@rArrr�r��assertIn)r$rEr�rIrs&    r�test_getitem_with_error� CAPITest.test_getitem_with_errorsu����� �
��-�T�4�8�����C� ���#�%����S��)�
)�+�	+�

,�
�M�M�C�S�Irc	��
�[OoUOUP2P2UOUQ2Q&2UOUQ2,2UOUQ2-2UOUQ2Q&,-12UOUQ]2]2UOUQ]2Q'2UOUQ]2],2UO[UQ]2UOUQ	]]2Q(2UOUQ
]]2Q(2UOUQ]]2]],2UOUQ]]2]]-2UOUQ
]]]]2]]]]-2UOUQ]2Q)2UOUQ]]2Q*2UOUQ2P2UOUQ]2]2UOUQ]2]2UOUQ]2]2UOUQ]]2Q(2UOUQ]]2Q(2UOUQ]]2Q(2UOUQ]]2Q(2UOUQ]]2Q(2UOUQ]]2Q(2UOUQ]]2Q(2UOUQ]]2Q(2UOUQ]]2Q(2UOUQ]]2]],2UOUQ]]2]],2UOUQ]]2]],2UOUQ ]]2]],2UOUQ!]]2]]-2UOUQ"]]]]2]]]]-2UOUQ#]]]]2]]]]-2UOUQ$]]]]2]]]]-2UOUQ%]]]]2]]]]-2UO[UQ[
2UO[UQ[
2UO[UQ[
2UO[UQ[
2UO[UQ	][
2UO[UQ	[
]2UO[UQ
][
2UO[UQ
[
]2UO[UQ][
2UO[UQ[
]2UO[UQ][
2UO[UQ[
]2P!)+�z()z[]z{}z()[]{}�Oz(O)z[O]z{O}�OOz(OO)z[OO]z{OO}z{OOOO}z((O))z((OO))z 	,:zO,z   O   z	O	zO,OzO, OzO,	OzO OzO	Oz(O,O)z(O, O,)z	 ( O O ) z		(	O	O	)	z[O,O]z[O, O,]z	 [ O O ] z	 [	O	O	] z{O:O}z	{O:O,O:O}z
{O: O, O: O,}z
 { O O O O } z
	{	O	O	O	O	}	r"rWrm)rW)rm)r�
py_buildvaluer4r7r��NULL)r$�
buildvalues& r�test_buildvalue�CAPITest.test_buildvalue<s����,�,�
�����B���.�����D�)�2�.�����D�)�2�.�����D�)�2�.�����H�-��B��|�<�����C��+�Q�/�����E�1�-�t�4�����E�1�-��s�3����+�z�5�!�<�����D�!�Q�/��8�����F�A�q�1�6�:�����F�A�q�1�A�q�6�:�����F�A�q�1�A�q�6�:�����H�a��A�q�9�A�q�!�Q�<�H�����G�Q�/��9�����H�a��3�Y�?�����G�,�d�3�����D�!�,�a�0�����I�q�1�1�5�����G�Q�/��3�����E�1�a�0�&�9�����F�A�q�1�6�:�����G�Q��2�F�;�����E�1�a�0�&�9�����F�A�q�1�6�:�����G�Q��2�F�;�����I�q�!�4�f�=�����K��A�6��?�����$4�a��;�V�D�����G�Q��2�Q��F�;�����I�q�!�4�q�!�f�=�����K��A�6��A��?�����N�A�q�9�A�q�6�B�����G�Q��2�Q��F�;�����K��A�q�!�<�q�!�Q��l�K�����O�Q��1�a�@�1�a��A�,�O�����O�Q��1�a�@�1�a��A�,�O�����$:�A�q�!�Q�G�!�Q�PQ�ST��V����+�z�3��=����+�z�5�$�?����+�z�5�$�?����+�z�5�$�?����+�z�4��D�A����+�z�4��q�A����+�z�6�1�d�C����+�z�6�4��C����+�z�6�1�d�C����+�z�6�4��C����+�z�6�1�d�C����+�z�6�4��Crc�
�[Oo]QHGoGoGoGoGoGoUOUQU2U2UOUQU2U2UOUQU2U2UOUQU2U2UOUQU2U2UOUQU2U2UOUQ]2]2UOUQQ2Q2UOUQ]�2]�2UOUQ[Q	22Q
2UOUQ]�2Q2UOUQQ2Q
2UOUQP2Q2UOUQ]�2[]�22UOUQQ2[Q22UOUQ[O2[[O22UO[UQP2UO[UQ[O]*2UO[UQP]2UO[UQP]2UO[UQP]]2P!)r)�SHRT_MIN�SHRT_MAX�	USHRT_MAX�INT_MIN�INT_MAX�UINT_MAXri�I�h�H�b�B�c�A�A�����Cz(C )iz[C ]iz{Ci }ii����)r�py_buildvalue_intsr�r�r�r�r�r�r4�ord�chrre�
maxunicoder7rO)r$r�r�r�r�r�r�r�s&       r�test_buildvalue_ints�CAPITest.test_buildvalue_intsts���1�1�
�W�W�����C��1�7�;�����C��1�7�;�����C��2�H�=�����C��2�H�=�����C��2�H�=�����C��3�Y�?�����C��-�s�3�����C��.��5�����C��-�s�3�����C��S��2�D�9�����C��-�w�7�����C��-�w�7�����C��,�g�6�����C��-�s�3�x�8�����C��-�s�3�x�8�����C����8�#�c�n�n�:M�N����*�j�#�r�:����*�j�#�s�~�~�a�7G�H�	
���*�j�'�2�q�A����*�j�'�2�q�A����*�j�(�B��1�Erc�0�[O2P!rN)r�test_buildvalue_Nr#s&rr��CAPITest.test_buildvalue_N�s���#�#�%rc�P�]QHGoPo[]d2FDoUU12oJ	P!�r)�MyList)rr��range)r$r��Lris&   r�test_trashcan_subclass�CAPITest.test_trashcan_subclass�s%��	%����s��A���t��A�r�cpuc�2�UO[2P!rN)�do_test_trashcan_python_class�listr#s&r�test_trashcan_python_class1�$CAPITest.test_trashcan_python_class1�s��	
�*�*�4�0rc�6�]QHGoUOU2P!r�)rr�r�)r$r�s& r�test_trashcan_python_class2�$CAPITest.test_trashcan_python_class2�s��	%��*�*�6�2rc��QQU2oQFDkoPo[Q2FDoUU12oVTmJ	U%cU1oUOUO]2=UO	UO]2Jm	P!)c�D``�\sQsQsn]sU1QksU1QksQsUsU9s	!)�6CAPITest.do_test_trashcan_python_class.<locals>.PyList�c�Z:�R9O]*
tm[RU_UP!rW)�num�super�__init__)r$�args�	__class__s&*�rr��?CAPITest.do_test_trashcan_python_class.<locals>.PyList.__init__�s����
�
��"�
��� �$�'rc�<:�R9O]*tmP!rW)r��r$r�s&�r�__del__�>CAPITest.do_test_trashcan_python_class.<locals>.PyList.__del__�s����
�
��"�
rr")
r(r)r*r+r�r�r�r.r]�
__classcell__�r�r_s@@r�PyListr��s�����C�
(�
#�
#rr�)rrXi)r��attr�
assertGreaterr�r4)r$�baser��parityr�ris&&    rr��&CAPITest.do_test_trashcan_python_class�sv��	#�T�	#��F��A��5�\���A�4�L����"���D�����v�z�z�1�-�����V�Z�Z��+�rc��UO[OOQ2UO[OOQ2P!)�somedocz(arg1, arg2))r4r�HeapDocCTyper6r�r#s&r�&test_heap_ctype_doc_and_text_signature�/CAPITest.test_heap_ctype_doc_and_text_signature�s<��	
����/�/�7�7��C�����/�/�B�B�N�Src�\�UO[OOP2P!rN)r4r�
NullTpDocTyper6r#s&r�test_null_type_doc�CAPITest.test_null_type_doc�s������0�0�8�8�$�?rc�@�QQ[O2oU2o[OU2oUO	UO
]
2UO	UO]2=UO	U]*
[OU22P!)c�4``�\sQsQsnU1QksQsUsU9s!)�`CAPITest.test_subclass_of_heap_gc_ctype_with_tpdealloc_decrefs_once.<locals>.HeapGcCTypeSubclass��c�4:�]Um[RU_	2P!����value2r�r�r�s&�rr��iCAPITest.test_subclass_of_heap_gc_ctype_with_tpdealloc_decrefs_once.<locals>.HeapGcCTypeSubclass.__init__����� ����� �"r�r�r(r)r*r+r�r.r]r�r�s@@r�HeapGcCTypeSubclassr������
#�
#rr)r�HeapGcCTypere�getrefcountr4�valuer)r$r�subclass_instance�type_refcnts&   r�:test_subclass_of_heap_gc_ctype_with_tpdealloc_decrefs_once�CCAPITest.test_subclass_of_heap_gc_ctype_with_tpdealloc_decrefs_once�s���	#�)�"7�"7�	#�
0�1���o�o�&9�:��	
���*�0�0�"�5����*�1�1�2�6�
�����q��#�/�/�:M�*N�Orc��``�QQ[O2nUU1QkQR2nR2o[OR2o[OR2oUO	UO
]
2UO	UO]2=[O%cUO	URO2L#UO	U]*
RO2UO	U]*RO2UO	U]*
[OR22UO	U[OR22P!)c�4``�\sQsQsnU1QksQsUsU9s!)�dCAPITest.test_subclass_of_heap_gc_ctype_with_del_modifying_dunder_class_only_decrefs_once.<locals>.A��c�4:�]Um[RU_	2P!rr
r�s&�rr��mCAPITest.test_subclass_of_heap_gc_ctype_with_del_modifying_dunder_class_only_decrefs_once.<locals>.A.__init__�rrrrr�s@@rr�r�rrr�c�D:``�\sQsQsnU1QksUU1QksQsUsU9s!)�dCAPITest.test_subclass_of_heap_gc_ctype_with_del_modifying_dunder_class_only_decrefs_once.<locals>.B��c�&:�[RU_2P!rN)r�r�r�s&�rr��mCAPITest.test_subclass_of_heap_gc_ctype_with_del_modifying_dunder_class_only_decrefs_once.<locals>.B.__init__�s����� �"rc�:�RUm[OR2Rm[OR2RmP!rN)r�rer�
refcnt_in_del)r$r�r�s&��rr��lCAPITest.test_subclass_of_heap_gc_ctype_with_del_modifying_dunder_class_only_decrefs_once.<locals>.B.__del__�s*���!"���"%�/�/�!�"4���"%�/�/�!�"4��r)r�)	r(r)r*r+r�r�r.r]r�)r�r_r�r�s@@��rr�r#�s����
#�
5�
5rr�)
rrrerr4rrrr�r()r$rr�new_type_refcntr�r�s&   @@r�Ptest_subclass_of_heap_gc_ctype_with_del_modifying_dunder_class_only_decrefs_once�YCAPITest.test_subclass_of_heap_gc_ctype_with_del_modifying_dunder_class_only_decrefs_once�s���	#�	�%�%�	#�
	5�	5��	5��C���o�o�a�(���/�/�!�,��	
���*�0�0�"�5����*�1�1�2�6������
���[�!�/�/�:����[�1�_�a�o�o�>�����1�,�a�o�o�>�	
����q��#�/�/�!�*<�=�	
����#�/�/�!�*<�=rc	���[O[O1FD�oUO	UQ59^tt^2U2o]*UmUO
UO
]*2UO
UOUO2UO
UOQ]*-2U2oUO
-UO2PPP2J�	P!)%fhJ�9h)��cls�foo)	r�HeapCTypeWithDict�_testlimitedcapi�HeapCTypeWithRelativeDict�subTestr0r4�dictobj�__dict__)r$r/r;s&  r�test_heaptype_with_dict� CAPITest.test_heaptype_with_dict
s����'�'��6�6�
�C����#��&�&��u������ � ����2�.�� � ����t�}�}�=�� � �����r�{�;��u��� � ��T�]�]�3�'�&�	
�'�&�&�s�BC 	� C1
�)C1
c�~�[O2o]*UmUOUO]*2UOUOQ]*-2[O2oUO-UO2[O2o[O2oV2mV#m==P!��*r0)r�HeapCTypeWithManagedDictr0r4r6r��a)r$r;r=r�s&   r�test_heaptype_with_managed_dict�(CAPITest.test_heaptype_with_managed_dicts����1�1�3�����������2�&����������4��1�1�3������T�]�]�+��.�.�0���.�.�0������
�qrc�V�QQ[O2oU2oV"m=P!)c��\sQsQsQsP!)�2CAPITest.test_sublclassing_managed_dict.<locals>.C�*r"�r(r)r*r+r.r"rrr�rB*���rr�)rr<�spam)r$r�ris&  r�test_sublclassing_managed_dict�'CAPITest.test_sublclassing_managed_dict(s%��	�	�2�2�	�
�C����
rc�^�[O2o]*UmUOUO]*2UOUOUO
2UOUOQ]*-2[O2oUO-UO
2P!r:)r�HeapCTypeWithNegativeDictr0r4r5r6r:s& r� test_heaptype_with_negative_dict�)CAPITest.test_heaptype_with_negative_dict1s}���2�2�4�����������2�&�������t�}�}�5��������r�{�3��2�2�4������T�]�]�+rc	�f�[O[O1FDvoUO	UQ59^tt^2U2o[
OU2oUOU2U2UOUOU2PPP2Jx	P!)%fhJ�9h)r.)	r�HeapCTypeWithWeakrefr2�HeapCTypeWithRelativeWeakrefr4�weakref�refr4�weakreflist)r$r/r;rQs&   r�test_heaptype_with_weakref�#CAPITest.test_heaptype_with_weakref;s����*�*��9�9�
�C����#��&�&��u���k�k�$�'��� � ����-�� � ��!1�!1�3�7�	'�&�	
�'�&�&�s�AB	�B0
�(B0
c��[O2o[OU2oUO	U2U2P!rN�r�HeapCTypeWithManagedWeakrefrPrQr4)r$r;rQs&  r�"test_heaptype_with_managed_weakref�+CAPITest.test_heaptype_with_managed_weakrefFs0���4�4�6���k�k�$���������%rc��QQ[O2oU2o[OU2oUO	U2U2P!)c��\sQsQsQsP!)�5CAPITest.test_sublclassing_managed_weakref.<locals>.C�Mr"rDr"rrr�r\MrErr�rV)r$r�r;rQs&   r�!test_sublclassing_managed_weakref�*CAPITest.test_sublclassing_managed_weakrefKs=��	�	�5�5�	��s���k�k�$���������%rc��QQ[O[O2oQQ[O[O2oV1FDpoU2o[OU2oUOU2U2VDm=[OU22oUOU2P2Jr	P!)c��\sQsQsQsP!)�3CAPITest.test_sublclassing_managed_both.<locals>.C1�Vr"rDr"rr�C1rbVrErrdc��\sQsQsQsP!)�3CAPITest.test_sublclassing_managed_both.<locals>.C2�Yr"rDr"rr�C2rfYrErrh)rrWr<rPrQr4rF�assertIs)r$rdrhr/r;rQs&     r�test_sublclassing_managed_both�'CAPITest.test_sublclassing_managed_bothTs���	��6�6�	�8Z�8Z�	�	��3�3�Y�5Z�5Z�	��8�C��5�D��+�+�d�#�C����S�U�D�)��I���+�+�c�e�$�C��M�M�#�%��&�rc�j�[O2o[U2oUOUQ2P!)s1234)r�HeapCTypeWithBuffer�bytesr4)r$r;r�s&  r�test_heaptype_with_buffer�"CAPITest.test_heaptype_with_bufferes)���,�,�.���$�K������G�$rc�`�[O2o[O[O2oUO	UO
]
2UO	UO]2=UO	U]*
[O[O22P!��
)rrrerr4rr)r$rrs&  r�9test_c_subclass_of_heap_ctype_with_tpdealloc_decrefs_once�BCAPITest.test_c_subclass_of_heap_ctype_with_tpdealloc_decrefs_oncejs}��%�7�7�9���o�o�i�&A�&A�B��	
���*�0�0�"�5����*�1�1�2�6�
�����q��#�/�/�)�:U�:U�*V�Wrc��[2o[O[2o[O[2oUO	UO
]
2UO	UO]2=SoU]*o[%fU]*oU]*o[O%c
U]*
oUO	U[O2UO	U[O2UO	U]*
[O[22UO	U[O[22P!rr)rrerrr4rrrrr�r()r$rrr*�expected_type_refcnt�expected_new_type_refcnts&     r�Otest_c_subclass_of_heap_ctype_with_del_modifying_dunder_class_only_decrefs_once�XCAPITest.test_c_subclass_of_heap_ctype_with_del_modifying_dunder_class_only_decrefs_oncevs��:�<���o�o�&D�E���/�/�*;�<��	
���*�0�0�"�5����*�1�1�2�6�
� +��#2�Q�#6� ���
!�A�%� �$��)�$�����
!�A�%� ����-�/M�/[�/[�\����1�3D�3R�3R�S�	
����q��#�/�/�:X�*Y�Z�	
����#�/�/�:K�*L�Mrc���[O2oUOUO]
2]UmUOUO]2U;UOUO]2P!rr)r�HeapCTypeSetattrr4�pvaluer)r$�objs& r�test_heaptype_with_setattro�$CAPITest.test_heaptype_with_setattro�sX���(�(�*��������R�(���	�������R�(��I�������Q�'rc��[OoUOU[2[O	U2oUOU[2UO
UOQ2UO[U2U2UQQ-2oUOU[2UO
UOQ2P!)�HeapCTypeViaMetaclass�PyClassViaMetaclassr")	r�HeapCTypeMetaclass�assertIsSubclass�type�pytype_fromspec_meta�assertIsInstancer4r(ri�r$�	metaclass�ts&  r�#test_heaptype_with_custom_metaclass�,CAPITest.test_heaptype_with_custom_metaclass�s����0�0�	����i��.�
�*�*�9�5�����a��&�������%<�=��
�
�d�1�g�y�)�
�+�R��4�����a��&�������%:�;rc��[OoUOU[2[O	U2oUOU[2UO
UOQ2UO[U2U2UO[Q29^tt^2UQQ-2PPP2P!)%fhP!9h)r�zcannot create .* instancesr�r")r�HeapCTypeMetaclassNullNewr�r�r�r�r4r(rirprqr�s&  r�,test_heaptype_with_custom_metaclass_null_new�5CAPITest.test_heaptype_with_custom_metaclass_null_new�s����7�7�	����i��.�
�*�*�9�5�����a��&�������%<�=��
�
�d�1�g�y�)��
#�
#�I�/K�
L�
L��+�R��4�M�
L�
L�
L�s�(B=�=C	�C	c��[OoUO[O[2QoUO	[
U29^tt^2[O
U2oPPP2P!)%fhP!9h)�1Metaclasses with custom tp_new are not supported.)r�HeapCTypeMetaclassCustomNewr�r�rprqr�)r$r�rJr�s&   r�.test_heaptype_with_custom_metaclass_custom_new�7CAPITest.test_heaptype_with_custom_metaclass_custom_new�sZ���9�9�	����i�C�C�T�J�A��
�
#�
#�I�s�
3�
3��.�.�y�9�A�4�
3�
3�
3�s�A6�6B	�?B	c���[OoQQUQ5oQoUO[U29^tt^2[O	U2oPPP2P!)%fhP!9h)c��\sQsQsQsP!)�?CAPITest.test_heaptype_base_with_custom_metaclass.<locals>.Base��r"rDr"rr�Baser��rErr�)r�r�)rr�rprq�make_type_with_base)r$r�r�rJ�subs&    r�(test_heaptype_base_with_custom_metaclass�1CAPITest.test_heaptype_base_with_custom_metaclass�sS���9�9�	�	�Y�	�B��
�
#�
#�I�s�
3�
3��/�/��5�C�4�
3�
3�
3�s�A�A/	�'A/	c���[OoUOU2oUO2U2oUO	UO
]2UO	UO
]2P!�rn)r�HeapCTypeVectorcall�__new__r�r4r)r$�tp�v0�v1s&   r� test_heaptype_with_tp_vectorcall�)CAPITest.test_heaptype_with_tp_vectorcall�sR��
�
*�
*��
�Z�Z��^��
���
�
�T��������1�%�������1�%rc�&�[O[O1FD�o[O[O
1FD�oUO
VQ59^tt^2UO[29^tt^2QQV2oPPP2UO[29^tt^2QQV!2oPPP2PPP2J�	J�	P!)%fhKS9h)%fhK59h)%fhJ�9h))�weakref_cls�dict_clsc��\sQsQsQsP!)�MCAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict.<locals>.Both1�r"rDr"rr�Both1r����� rr�c��\sQsQsQsP!)�MCAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict.<locals>.Both2�r"rDr"rr�Both2r��r�rr�)	rrNr2rOr1r3r4r7rq)r$r�r�r�r�s&    r�5test_multiple_inheritance_ctypes_with_weakref_or_dict�>CAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict�s���%�:�:�,�I�I�K�K�&�8�8�-�G�G�I���\�\�k�\�M�M��*�*�9�5�5�!�K�!�6��*�*�9�5�5�!�H�!�6�N�M�I�K�6�5��6�5��N�M�M�sN�$C?
�C�%C?
�3C,�?C?
�C)�"C)�$C?
�,C<�5C<�7C?
�?D�Dc��[O[O1FCD�o[O[O
1FCD}oUO
VQ59^tt^2UO[29^tt^2QQU[2oPPP2UO[29^tt^2QQU[2oPPP2QQ[O[2oQQ[O[2oU2oUO]2[UO2U2oUO]2[UO2[O[O1FD/oV1FDo	Q	Q
V�2o
J	QQVX2oQ
QVh2oJ1	PPP2CJ�	CJ�	P!)%fhCKE9h)%fhCK#9h)%fhCJ�9h))r�r�c��\sQsQsQsP!)�\CAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict_and_other_builtin.<locals>.C1�r"rDr"rrrdr�r�rrdc��\sQsQsQsP!)�\CAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict_and_other_builtin.<locals>.C2�r"rDr"rrrhr�r�rrhc��\sQsQsQsP!)�\CAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict_and_other_builtin.<locals>.C3�r"rDr"rr�C3r����rr�c��\sQsQsQsP!)�\CAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict_and_other_builtin.<locals>.C4�
r"rDr"rr�C4r�
r�rr�c��\sQsQsQsP!)�[CAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict_and_other_builtin.<locals>.S�r"rDr"rr�Sr�s�� $rr�c��\sQsQsQsP!)�\CAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict_and_other_builtin.<locals>.B1�r"rDr"rr�B1r�r�rr�c��\sQsQsQsP!)�\CAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict_and_other_builtin.<locals>.B2�r"rDr"rr�B2r�r�rr�)rr1r2r3rNrOr4r7rqr�r<rW�appendr�r6�__weakref__)
r$r�r�rdrhr�r�r;r/�cls2r�r�r�s
&            r�Gtest_multiple_inheritance_ctypes_with_weakref_or_dict_and_other_builtin�PCAPITest.test_multiple_inheritance_ctypes_with_weakref_or_dict_and_other_builtin�s���"�4�4�)�C�C�E�H� )� >� >� 0� M� M� O���\�\�8�\�M�M��*�*�9�5�5�!��4�!�6��*�*�9�5�5�!��d�!�6��Y�?�?����Y�B�B�D���4�D��K�K��N���
�
�&��4�D��K�K��N���(�(�)� )� B� B� )� E� E� G��%-�$;�D�%�C�%�%<�!��!�!��!� G�/N�M� O�E�6�5�5��6�5�5��
N�M�M�sO�&G9
�G�%G9
�:G%�C2G9
�G"�G"�	G9
�%G6�.G6�0	G9
�9H�Hc�8�[]2FDaoUOUQ59^tt^2UO[29^tt^2[OU2PPP2PPP2Jc	P!)%fhK9h)%fhJ�9h)rn)�variant)r�r4r7r�r�create_type_from_repeated_slots)r$r�s& r�(test_pytype_fromspec_with_repeated_slots�1CAPITest.test_pytype_fromspec_with_repeated_slots"s`���Q�x�G����g��.�.��&�&�{�3�3��=�=�g�F�4�/�.� �3�3��/�.�.�s/�B	�	A5
�B	�5B�>B�B	�B
�B
c��QQ2oUO[Q29^tt^2[OU2PPP2P!)%fhP!9h)c��\sQsQsQsP!)�CCAPITest.test_immutable_type_with_mutable_base.<locals>.MutableBase�)r"rDr"rr�MutableBaser�)s��3rr�zCreating immutable type)rprqr�make_immutable_type_with_base)r$r�s& r�%test_immutable_type_with_mutable_base�.CAPITest.test_immutable_type_with_mutable_base(s:����
�
#�
#�I�/H�
I�
I��3�3�K�@�J�
I�
I�
I�s�A
�
A	�A	c�$�]QHGo]{oQoQQ2oQ	oSFD�vqgoUOVgUQ59^tt^2UOUV&2U2UOUU'U2QU*2UOUUU2U2U2UOUV62U2UOUU'U2QU*2UOUUU2U2U2PPP2J�	UO	[
VQ2]
2UO	[
VQ2]
2UO	[
UQ]
2UO	[
UQ]
2UO	[U]{]2P!)%fhCJt9h)
r)�pynumber_tobasec�.`�\sQsQsnQsQsQsUsP!)�*CAPITest.test_pynumber_tobase.<locals>.IDX�2c��VmP!rN��val)r$r�s&&rr��3CAPITest.test_pynumber_tobase.<locals>.IDX.__init__3s���rc��UO!rNr�r#s&r�	__index__�4CAPITest.test_pynumber_tobase.<locals>.IDX.__index__5s���x�x�rr�)r(r)r*r+r�r�r.r]r^s@r�IDXr�2s����
�
 �
 rr��123)r��st�lt�-g�^@�))rn�	0b1111011�C0b10000000000000000000000000000000000000000000000000000000000000000)��0o173�0o2000000000000000000000)rsr��18446744073709551616)��0x7b�0x10000000000000000)rr�r4r4r7rqr�)	r$r��small_number�large_numberr��
test_casesr��small_target�large_targets	&        r�test_pynumber_tobase�CAPITest.test_pynumber_tobase.sf��-�����	 �	 �;�
�1;�,�D�����4�\��J�J�� � ���!D�l�S�� � ��,���!E�s�\�GY�Z�� � ���\�1B�D�!I�<�X�� � ���!D�l�S�� � ��,���!E�s�\�GY�Z�� � ���\�1B�D�!I�<�X�K�J�1;�	
���)�_�c�%�j�"�E����)�_�c�%�j�"�E����)�_�e�R�@����)�_�e�R�@����+���Q�?�K�J�J�s�B1E=	�=F
�F
c�T�[O2oUOUQ2P!�z<NULL>)r�pyobject_repr_from_nullr4�r$�ss& r�test_pyobject_repr_from_null�%CAPITest.test_pyobject_repr_from_nullLs ���-�-�/������H�%rc�T�[O2oUOUQ2P!r)r�pyobject_str_from_nullr4r
s& r�test_pyobject_str_from_null�$CAPITest.test_pyobject_str_from_nullPs ���,�,�.������H�%rc�T�[O2oUOUQ2P!)s<NULL>)r�pyobject_bytes_from_nullr4r
s& r�test_pyobject_bytes_from_null�&CAPITest.test_pyobject_bytes_from_nullTs ���.�.�0������I�&rc��[OoQoUU2o[UQQ2oUOUOUO2P!)s%# -*- coding: latin1 -*-
print('¤')
z<string>�exec)r�Py_CompileString�compiler4�	co_consts)r$�_compilerE�result�expecteds&    r�test_Py_CompileString�CAPITest.test_Py_CompileStringXsE���-�-��?���$����4��V�4������)�)�8�+=�+=�>rc��[OQ2o,o[[Q2%cUO	Q2[
OQ6wcUO	Q2SFDoUOUOU2J!	P!)�ctypes�
get_native_id�PyThread_get_thread_native_id�nt�
Py_FrozenMain)	r�
import_module�hasattr�_threadr��os�name�
assertHasAttr�	pythonapi)r$r!�namesr*s&   r�test_export_symbols�CAPITest.test_export_symbols`sn���,�,�X�6�����7�O�,�,��L�L�8�9��7�7�d�?��L�L��)��D����v�/�/��6�rc�8�QQ2oU2o[OU2UOUO-2U2oUOUOQ]-2[OU2UOUO-2P!)c�(`�\sQsQsnQsQsUsP!)�+CAPITest.test_clear_managed_dict.<locals>.C�xc��]UmP!rW�r=r#s&rr��4CAPITest.test_clear_managed_dict.<locals>.C.__init__ys	����rr5)r(r)r*r+r�r.r]r^s@rr�r2xs����
�
rr�r=)r�clear_managed_dictr4r6)r$r�r�s&  r�test_clear_managed_dict� CAPITest.test_clear_managed_dictvsx��	�	�
�C���$�$�Q�'�������R�(�
�C��������c�!�W�-��$�$�Q�'�������R�(rc�T�QQ[O2oU2o]
Um]Um]UmUOUO]
2UOUO]2UOUO]2U;UO
UO2P!)c��\sQsQsQsQsP!)�;CAPITest.test_unstable_gc_new_with_extra_data.<locals>.Data�r")�x�y)r(r)r*r+�	__slots__r.r"rr�Datar<�s��"�IrrA)r�ObjExtraDatar>r?�extrar4�assertIsNone)r$rA�ds&  r�$test_unstable_gc_new_with_extra_data�-CAPITest.test_unstable_gc_new_with_extra_data�s���	#�9�)�)�	#�
�F�����������������b�!�������b�!�������"�%�
�G����!�'�'�"rc�z�QoU2oUO[OU2UO2P!)c3� �Pw�	P!3hrNr"r"rr�genf�(CAPITest.test_gen_get_code.<locals>.genf�s���E���	)r4r�gen_get_code�gi_code)r$rJ�gens&  r�test_gen_get_code�CAPITest.test_gen_get_code�s+����f������/�/��4�c�k�k�Brc��[OoUOUO[12UOUO
[2P!rN)r�HeapCTypeWithBasesSlotr4�	__bases__�int�__base__�r$r/s& r�test_tp_bases_slot�CAPITest.test_tp_bases_slot�s7���.�.����������/�������s�+rc�R�UO[Q[O2P!)zbases must be types)rprqr�%create_heapctype_with_none_bases_slotr#s&r�test_tp_bases_slot_none� CAPITest.test_tp_bases_slot_none�s������!��;�;�	
rr")Fr(r)r*r+r<r�requires_subprocessrKrQr�
skipUnlessrrrvr~rrr�r�r�r�r�r�r�r�r�r��requires_resource�skip_emscripten_stack_overflow�skip_wasi_stack_overflowr�r�r�rrrr+r7r>rGrKrSrXr^rjrortryrr�r�r�r�r�r�r�r�r�rrrrrr.r8rFrPrXr\r.r]r^s@rr0r0SsB����	[�
� � �"�1�#�1�6S����)�+U�V�e�W�e�"���)�+U�V�j�W�j��_�_�)�M�O�''�O�''�R0�"3�K�: H�DJ�<6D�pF�@&��
���u�%��+�+�-��%�%�'�1�(�.�&�1�
���u�%��+�+�-��%�%�'�3�(�.�&�3�,�8�_�_�)�M�O�T�O�T�@�P�"&>�P
4�
��,�	8�&�
&�'�"%�

X�4N�l(�
<�
5�:�	6�&�!�$!�LG�A�@�<&�&�'�?�7�,)�#�C�
,�

�
rr0c�``�\sQsQsnQs\Q2sQsQsQs	Qs
QsQ	sQ
s
QsUsP!)�TestHeapTypeRelative�z-Test API for extending opaque types (PEP 697)c�v`�U1Qko[]]]]]]]]{[O[O]*
[O]*.2oSFDGoSFD=o[UUQ5oROQ-U@9^tt^2UQ-U@PPP2J?	JI	P!)%fhJX9h)c�:�[OV'2vq#qEqgU]6Xc:R
OUOUO2R
OU]2L�Q	UOQ1UQ1Va*Q1Vg*Q1UOQ1,o[	U[
O]2Q5o	R
OV�QU	0Q5R
OUOVg*2R
OVq*
[O2R
OU[O*]2R
OU[O*]2P!)
rzend of base dataz
subclass datazend of requested subcls datazend of reserved subcls dataz
end of object)�keyz$Offsets not in expected order, got: �rJ)rzstart of object)	r2�make_sized_heaptypesr4�
__basicsize__�sorted�operator�
itemgetter�
assertLess�ALIGNOF_MAX_ALIGN_T)�extra_base_size�
extra_sizer��Sub�instance�data_ptr�data_offset�	data_size�offsets�ordered_offsetsr$s&&        �r�check�@TestHeapTypeRelative.test_heaptype_relative_sizes.<locals>.check�sN��� �5�5�#�[�2�
B�D�x�;�
�Q��� � ��!3�!3�S�5F�5F�G�� � ��A�.�
+��'�'�);�<� �/�2� �-�/M�N� �,�.K�L��&�&��8�
��#)��h�6I�6I�!�6L�"M��� � ��>��>O�P�!�R�
� � ��!2�!2�K�4K�L����	� 6� 0� D� D�F�
���[�+;�+O�+O�O�QR�S����Y�)9�)M�)M�M�q�Qr�rqrrr")rlrork�dictr4)r$rz�sizesrqrrr�sf     r�test_heaptype_relative_sizes�1TestHeapTypeRelative.test_heaptype_relative_sizes�s����"	R�H��1�a��A�q�!�S��,�,��,�,�Q�.��,�,�Q�.�0�1�� %�O�#�
��O�'1�3���\�\�)�D�)�)��M�D�M�*�)�$� %�*�)�)�s�
B'
�'B8�0B8c�p�[O]]]2oUO[U2,QN2P!)z2Make sure HeapCCollection works properly by itself�rXrn�)r�HeapCCollectionr4r�)r$�
collections& r�test_HeapCCollection�)TestHeapTypeRelative.test_HeapCCollection�s+���.�.�q�!�Q�7�
�����j�)�9�5rc��[]]]]]]]]{[O[O]*
[O]*.2oSFD�oUOUQ59^tt^2[O
[OU']]2oU]]]2oUO2UO[U2,QN2UO2oUO[U2U2UO[U2].6*QU802PPP2J�	P!)%fhJ�9h)�-Test HeapCCollection subclasses work properly)rrzgot r�)rlrorkr4r2�subclass_var_heaptyperr��set_data_to_3sr4r��get_data�assertGreaterEqual�lenr5�set)r$r~rrrsr��mems&     r�test_heaptype_inherit_itemsize�3TestHeapTypeRelative.test_heaptype_inherit_itemsize�s����1�a��A�q�!�S��,�,��,�,�Q�.��,�,�Q�.�0�1�� �J������4�4�&�<�<��-�-�
�{�A�q�B�� ��A�q�\�
��)�)�+�� � ��j�!1�9�=� �)�)�+���'�'��C��*�=�����C��Q�C��4��w��@�5�4� �4�4�4�s�0B.D,	�,D=
�5D=
c��UO[QQ59^tt^2[O[Q]2PPP2P!)%fhP!9h)z*Cannot extend variable-size class without rizACannot extend variable-size class without Py_TPFLAGS_ITEMS_AT_END���)r7r�r2�subclass_heaptyperUr#s&r�!test_heaptype_invalid_inheritance�6TestHeapTypeRelative.test_heaptype_invalid_inheritance�sJ��
�
�
�{�$;��<�<�
�.�.�s�B��:�<�<�<�<�s�A�A	�A	c��[]]]]]]]]{[O[O]*
[O]*.2oSFCD�oSFCD�oSFCD{oUOV#UQ59^tt^2VC6Cc�[O
V#'UP	2oUO
2]*oU2oUOUOUO22UO]
2UOUOUO22UOUO2]
2]UmUOUOUO22UOUO2]2UOUO2UO2UOUO2UO2UO[29^tt^2UO!2PPP2UO[29^tt^2UO#]2PPP2L?UO[29^tt^2[O
V#'UP	2oPPP2UO[29^tt^2[O
V#UP	2oPPP2PPP2CJ~	UOV#Q59^tt^2UO[29^tt^2[O
V#'PP	2oPPP2PPP2CJ�	CJ�	P!)%fhCKA9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhCJM9h)%fhK�9h)%fhCJ|9h)r�)rqrr�offsetr|)rlrorkr4r2�make_heaptype_with_member�mror4�memb�get_memb�set_membr��get_memb_offsetror7r��get_memb_relative�set_memb_relative)r$r~rqrrr�rsr�rts&       r�test_heaptype_relative_members�3TestHeapTypeRelative.test_heaptype_relative_members�s�����1�a��A�q�!�S��,�,��,�,�Q�.��,�,�Q�.�0�1�� %�O�#�
�#�F����o�ek��l�l�!�.�"2�"L�"L� /��f�d�#L�C�#&�7�7�9�Q�<�D�'*�u�H� �,�,�X�]�]�H�<M�<M�<O�P�$�-�-�b�1� �,�,�X�]�]�H�<M�<M�<O�P� �,�,�X�->�->�-@�"�E�,.�H�M� �,�,�X�]�]�H�<M�<M�<O�P� �,�,�X�->�->�-@�"�E� �3�3�H�4L�4L�4N�PT�Pb�Pb�c� �O�O�H�,D�,D�,F��HY�HY�Z�!%�!2�!2�;�!?�!?� (� :� :� <�"@�!%�!2�!2�;�!?�!?� (� :� :�1� =�"@�!?�"&�!2�!2�;�!?�!?�&6�&P�&P�$3�[�&�$�'P��"@�"�.�.�{�;�;�"2�"L�"L� /�V�T�#K�C�<�/m�l�$�6�\�\�/�\�Y�Y��*�*�;�7�7�.�H�H�+�[�"�d�D��8�Z�Y�9$� %�$"@�!?�!?��!?�!?��"@�!?��<�;��/m�l�l��68�7��Z�Y�Y�s��N�E>N�M�%N�<M#�&N�4M6�%N�3N	�N�;O
�N1�3O
�M �M �	N�#M3�,M3�.N�6N�?N�N�	N�N�N�N.�%N.�1O�:O�<O
�O�
Oc�h�UO[Q29^tt^2[O]Q]P	2PPP2UO[Q29^tt^2[O]QQP	2PPP2UO[Q29^tt^2[O]QPP	2PPP2[O]Q]P	2oU2oUO[Q29^tt^2UO	2PPP2UO[Q29^tt^2UO]2PPP2P!)%fhCK"9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhP!9h)�3With Py_RELATIVE_OFFSET, basicsize must be extended���3Member offset out of range \(0\.\.extra_basicsize\)�"Member offset must not be negativez,PyMember_GetOne used with Py_RELATIVE_OFFSETz,PyMember_SetOne used with Py_RELATIVE_OFFSETr�)rpr�r2r�r�r�)r$rsrts&  r�%test_heaptype_relative_members_errors�:TestHeapTypeRelative.test_heaptype_relative_members_errorssw��
�
#�
#��F�H�H�
�6�6�q�$��4�H�H��
#�
#��S�U�U��6�6�q�"�d�D�I�U��
#�
#��B�D�D��6�6�q�"�b�$�G�D��8�8��B��4�H���5��
�
#�
#��L�N�N��&�&�(�N��
#�
#��L�N�N��&�&�q�)�N�N�!H�H�H��U�U��D�D��N�N��N�N�N�sY�E� E'� E:�F
�7F �E$	�E$	�'E7	�0E7	�:F
	�F
	�
F	�F	� F1	�)F1	c�0�Q
FCDoUOUQ59^tt^2UO[Q29^tt^2[O[
O[22]d*P	U][O[OQ5PPP2UO[Q29^tt^2[OQP	UP[O[OQ5PPP2UO[Q29^tt^2[OQP	UQ[O[OQ5PPP2UO[QU*29^tt^2[OQP	U][OQ5PPP2UO[Q	U*29^tt^2[OQP	U][O]Q5PPP2PPP2CJ	P!)%fhCK�9h)%fhCKB9h)%fhK�9h)%fhK�9h)%fhKm9h)%fhCJ�9h)
�__vectorcalloffset__)�member_namer�)�	basicsize�add_relative_flagr��
member_offset�member_type�member_flagsr�r�r�z type of %s must be Py_T_PYSSIZET)r�r�r�r�r�zflags for %s must be )r��__dictoffset__�__weaklistoffset__r�i����)
r4rpr�r2r�re�	getsizeofro�
Py_T_PYSSIZET�Py_READONLY)r$r�s& r�-test_heaptype_relative_special_members_errors�BTestHeapTypeRelative.test_heaptype_relative_special_members_errors4s��Y�K����+��6�6��+�+�#�N�P�P�%�>�>�"%�-�-���"9�C�"?�*.�$/�&'�$4�$B�$B�%5�%A�%A�
�P��+�+�#�=�?�?�%�>�>�"$�*.�$/�&(�$4�$B�$B�%5�%A�%A�
�?��+�+�#�N�P�P�%�>�>�"$�*.�$/�&*�$4�$B�$B�%5�%A�%A�
�P��+�+�#�;�k�I�K�K�%�>�>�"&�*.�$/�&'�%5�%A�%A��K��+�+�#�0�;�>�@�@�%�>�>�"&�*.�$/�&'�$4�$B�$B�%&�
�@�Y7�6�Z�P�P�P��?�?�?��P�P��K�K��@�@��Y7�6�6�s��J	�AH"
�&J	�9H6
�=&J	�#9I

�-J	�	*I
�3-J	� +I0
�J	�"H3�+H3�-	J	�6I�?I�	J	�
I�I�J	�I-�&I-�(J	�0J�9J�;J	�J
�J
c�B�UO[29^tt^2[OP2PPP2UO[29^tt^2[O]2PPP2P!)%fhKM9h)%fhP!9h)z4Test PyObject_GetItemData fails on unsupported types)r7rqr�pyobject_getitemdatar#s&r�test_pyobject_getitemdata_error�4TestHeapTypeRelative.test_pyobject_getitemdata_errornsf��
�
�
�y�
)�
)��*�*�4�0�*��
�
�y�
)�
)�
�*�*�1�-�*�
)�*�
)��*�
)�
)�s#�A:�B
�:B
	�B
	�
B	�B	r")r(r)r*r+r6r	rr�r�r�r�r�r�r�r.r]r^s@rrdrd�sG����7��/"��/"�b6�
A�$;�&D�P*�*8�t.�.rrdc�v`�\sQsQsnQsQP	QP
-QksQQks\O2Q2s	Qs
Q	sQ
sQQ\
O2s\O2Q
2s\O2Q2s\\O(QP	Q5Q22s\O2Q2sQsUsP!)�TestPendingCallsiyc��`�U1Qko[U2FDQo[O[O2Q*2[OU2%fJJS	P!)c�,:�ROP2P!rN�r���ls�r�callback�;TestPendingCalls.main_pendingcalls_submit.<locals>.callback�����
�H�H�T�Nrg{�G�z�?)r��time�sleep�randomr�_pending_threadfunc)r$r��nr�ris&f&  r�main_pendingcalls_submit�)TestPendingCalls.main_pendingcalls_submitsH���	�
�q��A��J�J�v�}�}��t�+�,���0�0��:�:��r�main�ensurec�`�U1QkoU%c[OVRP
UQ5![OVRP
UQ5!)c�,:�ROP2P!rNr�r�s�rr��6TestPendingCalls.pendingcalls_submit.<locals>.callback�r�r)�blocking�ensure_added)rr��_testinternalcapi�pending_threadfunc)r$r�r�r�r�r�s&f&$$ r�pendingcalls_submit�$TestPendingCalls.pendingcalls_submit�sN���	�
��0�0��:?�>D�1�F�
F�%�7�7��AF�EK�M�
Mrc��]o[U2U6wcy[	Q2FDoVU*oJ
	U%c#UO
O
2%fJVU]*
oUOUQ6QU[U21*2J�P!)r��i'z(timeout waiting for %i callbacks, got %i)r�r�verbose�printr��event�is_setr5)r$r��numadded�context�countrir=s&&&&   r�pendingcalls_wait�"TestPendingCalls.pendingcalls_wait�su�����!�f�� ���4�[���C��!��w�}�}�3�3�5�5���Q�J�E��O�O�E�E�M�:�H�c�!�f�;M�M�
O�rc	�@�] o,oQQ[2oU2o,Um]UmVO*Um]Um[
O2Um[
O2Um	[UO2Tt,tFD&o[
OUOU1Q5MJ(	oo[OU29^tt^2UOUOV2PPP2P!ttoh)%fhP!9h)� c��\sQsQsQsP!)�=TestPendingCalls.test_main_pendingcalls_threaded.<locals>.fooi�r"rDr"rrr0r��s��$rr0��targetr�)ror�r��nThreads�	nFinished�	threading�Lock�lock�Eventr�r��Thread�main_pendingcalls_threadr�
start_threadsr�)r$r��threadsr0r�ris&     r�test_main_pendingcalls_threaded�0TestPendingCalls.test_main_pendingcalls_threaded�s���
�����&���%����	���	��	�	�>������ �~�~�'���!���)��
�"�'�"2�"2�3�5�3�q��#�#�4�+H�+H�*1��5�3�	�5��
+�
+�G�
4�
4��"�"�7�9�9�a�9�5�
4��5�5�
4�
4�s�.D� D�D	�D	c	�l�UOUOUO2UO9^tt^2U9O]*
tmUOoPPP2WUO6XcUOO2P!P!)%fhK?9hSO9^tt^2S9O]*
tmSOoPPP2L)%fhL9hWSO6XcSOO2hh9hrW)r�r�r�r�r�rr�r�r�r�r�)r$r�r�s&& rr��)TestPendingCalls.main_pendingcalls_thread�s���		$��)�)�'�)�)�W�Y�Y�?������!�!�Q�&�!�#�-�-�	���
�G�,�,�,��
�
�!�!�#�-���������!�!�Q�&�!�#�-�-�	�������
�G�,�,�,��
�
�!�!�#�-�s@�&B.�'B�B+	�$B+	�.D3�'C3	�*	D3�3D
�<D
�>D3�D3c�T�,o]@oUOV2UOV2P!)�@)r�r�)r$r�r�s&  r�#test_main_pendingcalls_non_threaded�4TestPendingCalls.test_main_pendingcalls_non_threaded�s*��

�����%�%�a�+����q�$rc��UOQ29^tt^2] o,oUOU]P	Q5oUOV#2UOU]2,oUOV!P	Q5oUOV#2UOV12,oUOV!]*P	Q5oUOV#2UOV12PPP2UOQ29^tt^2Qo,oUOU]P
Q5oUOV#2UOU]2,oUOV!P
Q5oUOV#2UOV12,oUOV!]*P
Q5oUOV#2UOV12PPP2P!)%fhK�9h)%fhP!9h)z	main-only)r�z
not main-only�,)r4r�r�r4)r$�
maxpendingr��addeds&   r�test_max_pending�!TestPendingCalls.test_max_pending�s���
�\�\�+�
&�
&��J��A��,�,�Q���,�=�E��"�"�1�,����U�A�&��A��,�,�Q��,�F�E��"�"�1�,����U�/��A��,�,�Q�1��4�,�H�E��"�"�1�,����U�/�!'�$�\�\�/�
*�
*��J��A��,�,�Q���,�>�E��"�"�1�,����U�A�&��A��,�,�Q��,�G�E��"�"�1�,����U�/��A��,�,�Q�1��5�,�I�E��"�"�1�,����U�/�%+�
*�%'�
&��$+�
*�
*�s%�B1F(�-B1F;�(F8	�1F8	�;G	�G	c�b`�\sQsQsn\O
sQ	QksQsQs	Qs
QsQsQs
UsP!)
�TestPendingCalls.PendingTaskic��V mVmV0m[O2UmPUmPUmPUmP!rN)	r-�req�notify_doner��	get_ident�creator_tid�
requester_tid�
runner_tidr)r$r�taskidrs&&&&rr��%TestPendingCalls.PendingTask.__init__s9���G��H�*��(�2�2�4�D��!%�D��"�D�O��D�Krc��[O2UmUO2UOdUO	2P!P!rN)r�rr�_runrr#s&r�run� TestPendingCalls.PendingTask.runs8��'�1�1�3�D�O��I�I�K����+�� � �"�,rc�*�UOUmP!rN)rrr#s&rr�!TestPendingCalls.PendingTask._runs
���(�(�D�Krc�x```�[O2RmUUU1QknRORP	Q5P!)c�:�[O2R7cRORP	Q5P!RO2P!)T�r�)r�r�_add_pendingr)r�r$�worker_tidss���rr��BTestPendingCalls.PendingTask.run_in_pending_call.<locals>.callbacks5���
�&�&�(��;��%�%�h�T�%�B�����
rr)r�rr
r)r$rr�sff@r�run_in_pending_call�0TestPendingCalls.PendingTask.run_in_pending_calls.���!*�!4�!4�!6�D��
�
���h�T��:rc�J�[OUOU1Q5!)r�)r�r�r)r$rs&&r�
create_thread�*TestPendingCalls.PendingTask.create_thread(s#���#�#��/�/�!�^��
rc�T�UOe[OQ2J&P!�N�{�G�z�?)rr�r�r#s&r�wait_for_result�,TestPendingCalls.PendingTask.wait_for_result.s���+�+�%��
�
�4� �&r)r	r-rrr
rr)NN)r(r)r*r+r�r�rr�rrrrr"r.r]r^s@r�PendingTaskrs3����(�;�;��	�	#�	#�	;�	�	!�	!rr$c�`�QoUOU2nU1Qko[OUQ5o[OU,29^tt^2PPP2UOROU2P!)%fhK.9h)z1Spam spam spam spam. Lovely spam! Wonderful spam!c��:�[O2oROU.2o[OU,29^tt^2RO2PPP2P!)%fhP!9hrN)r�rrrr�r")�tidr��tasks  �r�do_the_work�NTestPendingCalls.test_subthreads_can_handle_pending_calls.<locals>.do_the_work7sQ����%�%�'�C��"�"�C�5�)�A�!�/�/���4�4��$�$�&�5�4�4�4�s�	A$�$A5	�-A5	�r�)r$r�r�rr�r4r)r$�payloadr)r�r(s&   @r�(test_subthreads_can_handle_pending_calls�9TestPendingCalls.test_subthreads_can_handle_pending_calls2si���E������(��	'�

���K�0��
�
+�
+�Q�C�
0�
0��1�	
������g�.�1�
0�s�A:�:B
	�B
	c�``````�[O2oUO[O2OU2[2n[2n[O2nUU1QkoU1QknUU1QkoU1QknU1Qko,o[]2FD3oUOQU0UUQ5oUOU2UU2J5	RO2UU1QkoP
nUU1Qko	[]2T
t,tFDo
[OU	Q	5MJ	oo
[OU29^tt^2STt,tFDp�OMJ	o
o[]2T
t,tFDo
[OV�1Q
5MJ	oo
[OU29^tt^2PPP2U2P	nPPP2STt,tFDp�OMJ	ooUO!V2SFD�oUO#QUO$029^tt^2UO'UO(U2UO'UO(UO2UO!UO(U2PPP2J�	P!tto
httohtto
h[cP	ngh9h)%fhCK	9h[cP	ngh9h)%fhCK9httoh)%fhCJ9h)c�N:�ROU2ROP	2P!�Tr�)r(�_active�_queues&��r�	queue_put�QTestPendingCalls.test_many_subthreads_can_handle_pending_calls.<locals>.queue_putLs����M�M�$���N�N�4� rc�j:�RO2oU![c[Ogh9hrN)�popleft�
IndexError�queue�Empty)r(r3s �r�	queue_get�QTestPendingCalls.test_many_subthreads_can_handle_pending_calls.<locals>.queue_getOs6���
"��~�~�'���K���
"��k�k�!�
"�s��	2�2c�:�RO2R%fRO2P!P![cP!h9hrN)�pop�release�RuntimeError)r2�
_done_locks��r�queue_task_done�WTestPendingCalls.test_many_subthreads_can_handle_pending_calls.<locals>.queue_task_doneUs6����K�K�M��3��&�&�(���$�3�3�s�0�	?�?�?c�:�R%(!rNr")r3s�r�queue_empty�STestPendingCalls.test_many_subthreads_can_handle_pending_calls.<locals>.queue_empty\s����:�rc�J:�RO2RO2P!rN)�acquirer?)rAs�r�
queue_join�RTestPendingCalls.test_many_subthreads_can_handle_pending_calls.<locals>.queue_join^s������ ���� rzrequest )rrrc�:�R%cP!R2oUOU2J&[OcP!h9hr1)r9r:r)rr(�doner;s& ��r�	add_tasks�QTestPendingCalls.test_many_subthreads_can_handle_pending_calls.<locals>.add_tasksns@�������$�;�D��(�(��5���{�{����s�)�A�A�Ac�:�R2%f#R%cP![OQ2J/R%f[OQ2J P!r )r�r�)rLrEs��r�	run_tasks�QTestPendingCalls.test_many_subthreads_can_handle_pending_calls.<locals>.run_tasksys0���!�m�m����
�
�4� ���
�
�4� �rr+r�ztask )r�rr4�main_thread�identrr�r�r$r�rHr�rr��
BaseExceptionr�assertNotInr4r-�assertNotEqualr
)r$�main_tidr4rBrI�tasksrir(rMrP�_�worker_threadsr�rr��runner_tidsr2rAr3rLrEr;s&               @@@@@@r�-test_many_subthreads_can_handle_pending_calls�>TestPendingCalls.test_many_subthreads_can_handle_pending_callsBs�����&�&�(������.�.�0�6�6��A�����'���^�^�%�
�	!�	�	3�	�	!����r��A��#�#��q�c�N��+�$��D�

�L�L����d�O��	����	6���	!�$)��8�-�#+�a�$�*�*�)�<�#+�	�-�
�
+�
+�N�
;�
;�
�0>�?��1�w�w���?�$)�!�H�.�$,�q�%�+�+�9�>�R�$,��.�%�3�3�G�<�<���=�����<�&.3�3�U��|�|�U��3�����/��D�����d�g�g�Y�/�0�0��#�#�D�$6�$6��A��#�#�D�$6�$6����H�� � ��!3�!3�[�A�1�0���1-��
@��.��
)��#�����=�<�<��!�
����
��!<�
;�
;��&4�1�0�0�s��"J�K�
K�
J�#K�1#J � K�4J7	�7K�K1�)AK6	�
K�%	J4�/J4�4J7	�7K
�K
�	K�	K�K�K�K.	�&K.	�6L
�?L
z%gh-129824: race on assign_version_tag)�threadc	�j```````````�]�o]n[O2nROU1Qk2[ORQ2U1QkoRO	Q29^tt^2U2vnnU2vnn[
O
2]*nUUUU1Qko[OUQ5o[OU,29^tt^2[OR]2[OR2o[ORQ2PPP2ROW[!R22PPP2RO	Q29^tt^2U2vnnU2vnn[
O
2]*nUUUU1Q	ko[OUQ5o[OU,29^tt^2[OR]2[OR2o[ORQ2PPP2ROW[!R22PPP2RO	Q
29^tt^2U2vnnU2vnnU2von[
O
2]*nUUUUU1QkoP
nP
n[O1UUU1Qkko[OUQ5o	[OUQ5o
[OV�,29^tt^2R%fJ
[ORQ2R%f>[
O"Q
2[
O
2R6�fJ:[%Q2g[OU]2oPPP2[ O'WQ2oROU[!R22PPP2RO	Q29^tt^2U2vnnU2vnnU2von[
O
2]*nUUUUU1QkoP
nP
n[O1UUU1QkkoUUUU1Qko[OUQ5o	[OUQ5o
[OUQ5o
[OV�U
,29^tt^2PPP2[OU]2o[ O'UQ2oROU[!R22PPP2P!)%fhCK�9h)%fhCK�9h)%fhCK(9h)%fhCK9h)%fhCK�9h)%fhCK�9h)%fhK�9h)%fhP!9h)�c�2:�[OR2!rN)r�destroy��interpids�r�<lambda>�?TestPendingCalls.test_isolated_subinterpreter.<locals>.<lambda>�s���
� 5� 5�h� ?rz�if True:
            import json
            import os
            import threading
            import time
            import _testinternalcapi
            from test.support import threading_helper
            c�:``�[O2vnnROU1Qk2ROU1Qk2RR1!)c�2:�[OR2!rN�r)�close)�rs�rre�TTestPendingCalls.test_isolated_subinterpreter.<locals>.create_pipe.<locals>.<lambda>��
���B�H�H�Q�Krc�2:�[OR2!rNri)�ws�rrerl�rmr)r)�pipe�
addCleanup)rkror$s@@�r�create_pipe�BTestPendingCalls.test_isolated_subinterpreter.<locals>.create_pipe�s5����7�7�9�D�A�q��O�O�/�0��O�O�/�0��a�4�Krz"add in main, run in subinterpreterc
�L:�[ORQRQRQRQ02P!)a<if True:
                    # Wait until this interp has handled the pending call.
                    waiting = False
                    done = False
                    def wait(os_read=os.read):
                        global done, waiting
                        waiting = True
                        os_read(a
, 1)
                        done = True
                    t = threading.Thread(target=wait)
                    with threading_helper.start_threads([t]):
                        while not waiting:
                            pass
                        os.write(��, b'\0')
                        # Loop to trigger the eval breaker.
                        while not done:
                            time.sleep(0.01)
                            if time.time() > zT:
                                raise Exception('timed out!')
                    �r�
run_string�rd�r_done�timeout�w_readys����r�do_work�>TestPendingCalls.test_isolated_subinterpreter.<locals>.do_work�sA����(�(��8!�"(��)"�#*��+.�/6�Y�7�#4�rr+r�z-add in main, run in subinterpreter sub-threadc
�L:�[ORQRQRQRQ02P!)z�if True:
                    waiting = False
                    done = False
                    def subthread():
                        while not waiting:
                            pass
                        os.write(ruaO:
                                raise Exception('timed out!')
                    t = threading.Thread(target=subthread)
                    with threading_helper.start_threads([t]):
                        # Wait until this interp has handled the pending call.
                        waiting = True
                        os.read(z=, 1)
                        done = True
                    rvrxs����rr|r}�sA����(�(��8"�#*��+.�/6�Y�7!�"(��)�!4�rz"add in subinterpreter, run in mainc
�z:�[OR]2[ORQRQRQRQ02P!�rXz�if True:
                    # Add the pending call and wait for it to finish.
                    actual = _testinternalcapi.pending_identify(zX)
                    # Signal the subinterpreter to stop.
                    os.write(z&, b'\0')
                    os.write(z4, actual.to_bytes(1, 'little'))
                    �r)�readrrw�rd�
main_interpid�r_ready�w_data�w_dones�����r�add_job�>TestPendingCalls.test_isolated_subinterpreter.<locals>.add_job
�K��������#��(�(��8A�AN��P�$�X�&�$�X�&�4�rc�$:�P	nUR]2P	nP!r1r"��os_readrLry�waitings&���r�wait�;TestPendingCalls.test_isolated_subinterpreter.<locals>.wait���������"��rr!�
timed out!�littlez(add in subinterpreter, run in sub-threadc
�z:�[OR]2[ORQRQRQRQ02P!r�r�r�s�����rr�r�1r�rc�$:�P	nUR]2P	nP!r1r"r�s&���rr�r�=r�rc��:�R%fJ
[ORQ2R%f>[OQ2[O2R6�fJ:[	Q2gP!)r�r!r�)r)�writer�r��	Exception)rLrzr{r�s����r�	subthread�@TestPendingCalls.test_isolated_subinterpreter.<locals>.subthreadBsD���!������%�(���J�J�t�$��y�y�{�W�,�'��5�5�r)r�createrqrwr4r�r�r�rr�r)r�r��pending_identifyr�r4rUr�r��
from_bytes�start�join)r$�maxtextrrr|r��actual�r_datar�r��t1�t2�textr��t3rLrdr�ryr�rzr�r�r{r�sf             @@@@@@@@@@r�test_isolated_subinterpreter�-TestPendingCalls.test_isolated_subinterpreter�sB�������
� �'�'�)�����?�@�� � ��0
�	�	��\�\�>�
?�
?�*�}��G�W�'�M�N�F�F��i�i�k�B�&�G�
�
�*� � ��0�A�!�/�/���4�4������#�*�;�;�H�E�������'�5�
���V�S��]�3�E@�H�\�\�I�
J�
J�*�}��G�W�'�M�N�F�F��i�i�k�B�&�G�
�
�(� � ��0�A�!�/�/���4�4������#�*�;�;�H�E�������'�5�
���V�S��]�3�CK�F�\�\�>�
?�
?�*�}��G�W�'�M�N�F�F�'�M�N�F�F��i�i�k�B�&�G�
�
��G��D��W�W�
�
�
�!�!��1�B��!�!��.�B�!�/�/���9�9�!������%�(���J�J�t�$��y�y�{�W�,�'��5�5��w�w�v�q�)��:��^�^�D�(�3�F����V�S��%7�8�K@�N�\�\�D�
E�
E�*�}��G�W�'�M�N�F�F�'�M�N�F�F��i�i�k�B�&�G�
�
��G��D��W�W�
�
�

6�
6��!�!��1�B��!�!��.�B��!�!��3�B�!�/�/����=�=��>��7�7�6�1�%�D��^�^�D�(�3�F����V�S��%7�8�QF�V	�}5�4�4��7@�
?�
?��|5�4�4��5K�
J�
J��x:�9�9��3@�
?�
?��T>�=��GF�
E�V	�s��1A0T*�!AT	�&#T*�*A0U�AT>	�#U�#B/U:�U&	� U&	�<-U&	�."U&	�9U:�*CV!�:V	�<AV!�T'
�T'
�!	T*�*T;	�3T;	�>U
�U
�		U�U#	�U#	�&U7
�/U7
�1	U:�:V	�V	�V
�V
�V!�!V2	�*V2	c�6�Qo[OQ[OU22vq#oUO	U]2UO	UQ[
OQ[
O0OQ22UO	UQ2P!)a�
        import _testinternalcapi
        import threading
        import time


        def output():
            print(24)
            time.sleep(1)
            print(42)


        def callback():
            threading.Thread(target=output).start()


        def create_pending_call():
            time.sleep(1)
            _testinternalcapi.simple_pending_call(callback)


        threading.Thread(target=create_pending_call).start()
        r?�24�42rr)rr
r@rAr4r)�lineseprB)r$�source�return_code�stdout�stderrs&    r� test_pending_call_creates_thread�1TestPendingCalls.test_pending_call_creates_thread�s|����.'4�&D�&D�T�8�?�?�[a�Kb�&c�#��V�����a�(�����2�b�j�j�\��B�J�J�<�!@�!G�!G��!P�Q������%rr"rN)r(r)r*r+r�r�r�r�requires_working_threadingr�r�r�r�types�SimpleNamespacer$r-r\r r�skip_if_sanitizerr�r�r.r]r^s@rr�r�ys�����
�
M��
M�U�
M�$�&�0�0�2�:�3�:�(
$�%�%0�N.!�e�+�+�.!�`�0�0�2�
/�3�
/��0�0�2�\B�3�\B�|����F�t�T�_4�U��_4�B�0�0�2�&�3�&rr�c�``�\sQsQsn\O
\\Q2Q2Q2s\O
\\Q2Q2Q2s	\
O2Q2s\
\O
\\Q2Q2Q22s\O\PIQ2\O
\\Q2Q2\2Q	222sQ
s\O\PIQ2\2Q22s\O.2\O
\\Q2Q2\
Q
222sQsUsP!)�SubinterpreterTesti�rpzrequires os.pipe()c���]PHo[O2vq#QOU2o[	UQ29^tt^2o[
OU2oUOU]2UO[OU2[[O22UO[OU2[U22PPP2P!)%fhP!9h)rz�if 1:
            import sys, builtins, pickle
            with open({:d}, "wb") as f:
                pickle.dump(id(sys.modules), f)
                pickle.dump(id(builtins), f)
            �rb)�builtinsr)rp�format�openr�run_in_subinterpr4rV�pickle�loadr-re�modules)r$r�rkrorE�f�rets&      r�test_subinterps�"SubinterpreterTest.test_subinterps�s�����w�w�y����
��q�	�	
��!�T�]�]�a��*�*�4�0�C����S�!�$�������A���3�;�;��@�������A���8��=�	�]�]�]�s�BC!�!C2	�*C2	c	�^�[O2vqQOU2o[UQ29^tt^2o[O
U2oUO
U]2UO
[OU2QQQQ-2PPP2P!)%fhP!9h)aaif 1:
            import pickle
            with open({:d}, "wb") as f:

                @(lambda x:x)  # Py 3.9
                def noop(x): return x

                a = (b := f'1{{2}}3') + noop('x')  # Py 3.8 (:=) / 3.6 (f'')

                async def foo(arg): return await arg  # Py 3.5

                pickle.dump(dict(a=a, b=b), f)
            r�r=�123xr�r�)	r)rpr�r�rr�r4r�r�)r$rkrorEr�r�s&     r�(test_subinterps_recent_language_features�;SubinterpreterTest.test_subinterps_recent_language_features�s����w�w�y������q�	�	
��!�T�]�]�a��*�*�4�0�C����S�!�$����V�[�[��^�c�6�3��-F�G��]�]�]�s�AB�B,	�$B,	c��Qo[OQ2oUO[OU2]Q2[OQ2oUOV#Q2UOV#Q2P!)aUif 1:
        import sys, _testcapi

        # Any config value would do, this happens to be the one being
        # double checked at the time this test was written.
        _testcapi.config_set('int_max_str_digits', 55555)
        sub_value = _testcapi.config_get('int_max_str_digits')
        assert sub_value == 55555, sub_value
        �int_max_str_digitsz%subinterp code failure, check stderr.z7Expected get_config() to return a new dict on each callzJCAUTION: Tests executed after this may be running under an altered config.)r�
config_getr4rr��assertIsNot)r$rE�
before_config�after_configs&   r�(test_py_config_isoloated_per_interpreter�;SubinterpreterTest.test_py_config_isoloated_per_interpreter�sz����"�,�,�-A�B�
�����1�1�$�7��@�	B� �+�+�,@�A������I�	K�	
����<�	=rc���] oQ	oQ
oQoQoQ
oV*U*U*U*U*o,QNoST	t,tFDo	QU	0MJ
	o
o	QU
]$QU
Q$QU
P$QUP	1QUP
1QV2*P
1-oQ.o[%cZ[UO22FD;o
[[	V�22oUQ*%cJ(V�UOU
2J=	UO
2FCDvq�[[	V�22oUvooQUQU-oUOU
29^tt^2[O2voo[OQUQ02o[OU29^tt^2o[OU1-U@oUOU]2UO!2oPPP2["O$W2oUOUU2PPP2CJ	SFD�o
[[	V�22oUOU
29^tt^2[OQ2oUO'[(O*29^tt^2[OU1-U@PPP2PPP2J�	P!tto	h)%fhK�9h)%fhCJ�9h)%fhKK9h)%fhJ�9h)z�
The config with which an interpreter is created corresponds
1-to-1 with the new interpreter's settings.  This test verifies
that they match.
�own_gil�allow_�use_main_obmalloc�check_multi_interp_extensions�
feature_flagsz�
                    import _testinternalcapi, json, os
                    settings = _testinternalcapi.get_interp_settings()
                    with os.fdopen(zX, "w") as stdin:
                        json.dump(settings, stdin)
                    z�
                    import _testinternalcapi
                    _testinternalcapi.get_interp_settings()
                    raise NotImplementedError('unreachable')
                    r������)�obmalloc�forkrr��daemon_threads�
extensionsr����)TTTTTTT)TFFFFFF)FFFTFTF)FFFFFFF)rr��keysr}�zip�add�itemsr4r)rpr@rA�fdopenr�run_in_subinterp_with_configr4r��json�loadsr7r�InterpreterError)r$�OBMALLOC�
EXTENSIONS�THREADS�DAEMON_THREADS�FORK�EXEC�	ALL_FLAGS�featuresr��kwlist�expected_to_work�expected_to_fail�config�kwargsr�	exp_flags�exp_gilrkro�scriptr�r�rI�settingss&                        r�test_configured_settings�+SubinterpreterTest.test_configured_settings�s������
����������_�t�+�g�5��F�!�"�	�
��)1�1��1�F�1�#�,���1�'��q�	�4��r�
���r�
�
7��D�!�<��5�!�;��%�u�-�

��
>�
���?��/�4�4�6�7���c�&�1�2���=�>�>�(�0�$�(�(��0�	8�!1� 6� 6� 8� 8��F��#�f�-�.�F�!)��I�w����7��H����f�%�%��w�w�y���1�!���.$�%&�3�'�*����Y�Y�q�\�\�V�!�>�>�v�P��P�C��$�$�S�!�,� �+�+�-�C�"� �:�:�c�?��� � ��8�4�&�%�!9�0'�F��#�f�-�.�F����f�%�%�!���.���
�&�&�}�'E�'E�F�F��8�8��J�6�J�G�
&�%�'��i2�V"�\��&�%�%��2G�F��
&�%�%�sf�J�%AJ&	�6;J
�10J&	�!>K	�J;
�8K	�J#�J#�J&	�&J8
�/J8
�;K�K�K	�K
�K
z%test requires _testsinglephase modulec�````	�] oQnQoQoQoQoV*U*U*U*nQP	QP	QP	QP	QP	QP
-n	UUU	U1QkoPRmROQ29^tt^2UP
P2PPP2ROQ	29^tt^2UP
]2PPP2ROQ
29^tt^2UP
]2PPP2ROQ29^tt^2UP	P2PPP2ROQ29^tt^2UP	]2PPP2ROQ
29^tt^2UP	]2PPP2P!)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhP!9h)z�
PyInterpreterConfig.check_multi_interp_extensions can be overridden
with PyInterpreterState.override_multi_interp_extensions_check.
This verifies that the override works but does not modify
the underlying setting.
r��
allow_fork�
allow_exec�
allow_threads�allow_daemon_threadsr�c�:�[RUQ5oU%c
R
R*LR
oQUQP
-oQSQ]QSQ]QSQSQ	SQ
U%(QU%cU]6�LS%(QU%(-
o[O2vqg[%c!RO	[O
U2[OQ
UQUQ02o[OU29^tt^2o	[OU1-U@o
ROU
]2U	O2oPPP2[OW2oROV�2P!)%fhK99h)�r�r�r��	requested�override__initial�override_after�override_restored�settings__initial�settings_after�settings_restored�allowed__initial�
allowed_after�allowed_restoredzu
                from test.test_capi.check_config import run_singlephase_check
                run_singlephase_check(z, z)
                )r}r)rprrqrjr@rAr�rr�r4r�r�r�)�enabled�overrider��flagsr�rrkror�r�r�rI�results�
BASE_FLAGSr��base_kwargsr$s&&           ����rrz�TSubinterpreterTest.test_overridden_setting_extensions_subinterp_check.<locals>.checkcs7�����.5��F�07�J��+�J�E����5��H��X�#�Q� �(�#�Q�#�X� �(�#�X�"��K���x�!�|�g�!N�"��K�
�H��7�7�9�D�A���������!�,��_�_�*'�'/�j��1�#�6�&��F����1�����:�:�6�L�V�L��� � ��a�(��k�k�m����j�j��o�G����W�/�
��s�;E�E	�E	z*config: check disabled; override: disabledz,config: check disabled; override: use configz)config: check disabled; override: enabledz)config: check enabled; override: disabledz+config: check enabled; override: use configz(config: check enabled; override: enabledr�r�r�r�r�)�maxDiffr4)
r$r�r�r�r�r�rzrr�rs
f      @@@r�2test_overridden_setting_extensions_subinterp_check�ESubinterpreterTest.test_overridden_setting_extensions_subinterp_checkFsg������
����������_�t�+�g�5��F�
����$��$��T�"�D��u�

��(	0�(	0�T����\�\�F�
G�
G��%���H�
�\�\�H�
I�
I��%��O�J�
�\�\�E�
F�
F��%��O�G��\�\�E�
F�
F��$��O�G�
�\�\�G�
H�
H��$��N�I�
�\�\�D�
E�
E��$��N�F�
E�H�
G��
I�
I��
F�
F��G�
F��
H�
H��
E�
E�
E�sl�&
E�
E$�<
E7�'
F
�
F�=
F0�E!	�E!	�$E4	�-E4	�7F	�F	�
F	�F	�F-	�&F-	�0G	�9G	c�t�]PHo[OQ2UOUOQ2P!)z�
Exceptions saved in global module state get shared between
individual module instances. This test checks whether or not
a change in one interpreter's module gets reflected into the
other ones.
z1import binascii; binascii.Error.foobar = 'foobar'�foobar)�binasciirr��assertNotHasAttr�Error)r$rs& r�test_mutate_exception�(SubinterpreterTest.test_mutate_exception�s*��	�� � �!T�U����h�n�n�h�7r�$test requires _testmultiphase modulec�
�[O2vqUO[OU2UO[OU2[O
%cQoLQo[OQUQUQ02o[U2[OU]d2o[OU2oUOU]2[OU]d2oUOVW2P!)zs
bpo-44050: Extension module state should be shared between interpreters
when it doesn't support sub-interpreters.
�AppleFrameworkLoader�ExtensionFileLoadera
            import importlib.machinery
            import importlib.util
            import os

            fullname = '_test_module_state_shared'
            origin = importlib.util.find_spec('_testmultiphase').origin
            loader = importlib.machinery.z�(fullname, origin)
            spec = importlib.util.spec_from_loader(fullname, loader)
            module = importlib.util.module_from_spec(spec)
            attr_id = str(id(module.Error)).encode()

            os.write(z, attr_id)
            )r)rprqrjr�is_apple_mobiler@rArr�r�r4)r$rkro�loaderr��main_attr_idr��subinterp_attr_ids&       r�"test_module_state_shared_in_global�5SubinterpreterTest.test_module_state_shared_in_global�s����w�w�y���������!�$�������!�$��"�"�"�+�F�*�F����&*�+1��2�
�S�
�
"�
��	
�V���w�w�q�#����&�&�v�.������a� ��G�G�A�s�O������9rc�T�[OQ2o[O2vq#QUQUQ0oUO	2oUOU2UO
2[OU]2oUOUQ2[OU2P!)zconcurrent.interpretersz�if True:
        import _testinternalcapi
        import threading
        import time
        import os


        def output():
            time.sleep(1)
            os.write(z, b"x")
            os.close(a)


        def callback():
            threading.Thread(target=output).start()


        def create_pending_call():
            time.sleep(1)
            _testinternalcapi.simple_pending_call(callback)


        threading.Thread(target=create_pending_call).start()
        rh)	rr&r)rpr�rrjr�r4)r$�interpretersrkror��interp�datas&      r�/test_pending_call_creates_thread_subinterpreter�BSubinterpreterTest.test_pending_call_creates_thread_subinterpreter�s���%�2�2�3L�M���w�w�y���	��S���S�
	���0�$�$�&�����F�������w�w�q�!�}������t�$�
����r)r)r(r)r*r+rr_r'r)r�r�r�requires_gil_enabledr�r r�r�_testsinglephaser
rr�_testmultiphaser'rr�r-r.r]r^s@rr�r��s~����
�����V�,�.B�C�
>�D�
>������V�,�.B�C�H�D�H�,
�!�!�#�=�$�=�>�
�����V�,�.B�C�VK�D��VK�p�_�_�%��-�/V�W�
�����V�,�.B�C�&�'�R�(�D�X�
R�h8��_�_�_��,�.T�U�&�'�$:�(�V�$:�L�0�0�2�
�����V�,�.B�C�� ��D�3� rr�c�`�\sQsQsnQ\O
P
P
P
P	P
P	QQ5Q\O
P	P	P	P	P	\\2QQ5Q\O
P
P
P
P
P
P
QQ5-s,QNs	Q	s
QQ
ksQsQs
Q
sQsQsUsP!)�InterpreterConfigTestsi��isolated�own�r�r�r�rrr��gil�legacy�shared�empty�defaultc#�� �QFD_oQFDUoQFDKoQFDAoQFD7oQFD-oQFD#o[OUUUUUUUQ5w�	J%	J/	J9	JC	JM	JW	Ja	P!3h)Tr6)TF)r9r5r;)r�r�)r$r�r�r�r�allow_daemon�checkextr7s&       r�iter_all_configs�'InterpreterConfigTests.iter_all_configssu���!.��+�
�"/�J�)6�
�,9�L�,9��+G�C�*/�*?�*?�:K�3=�3=�6C�=I�FN�,/�+&�%&�,H�-:�-:�*7�#0�,�"/�s�A*A,c���UO[U2[U22V6XcP!]PH
o]PHo]QHGoQUV2*oQQO
UOUO[U22O2UO[U22O222*oQUQ0oUOVx2oUOUOV722P!)N)�_common_shorten_reprz%s != %s�
z
namespace(�))r4r��difflib�pprint�
unittest.utilrBr��ndiff�pformat�vars�
splitlines�_truncateMessage�fail�_formatMessage)	r$�ns1�ns2rJrErFrB�standardMsg�diffs	&&&&     r�assert_ns_equal�&InterpreterConfigTests.assert_ns_equal0s�������c��D��I�.��:����6� �#7��#A�A���t�y�y�����~�~�d�3�i�0�;�;�=��~�~�d�3�i�0�;�;�=�"?�@�@���D�6��#���+�+�K�>���	�	�$�%�%�c�7�8rc	�6`�U1QkoROQ29^tt^2UPQ2PPP2ROFD-oROU29^tt^2UV"2PPP2J/	P!)%fhKP9h)%fhJW9h)c�H:�ROU*oU%cU1LQo[OUoROV12RO	V12[OUoROVA2RO	VA2RO	VC2P!)Nr")�	supportedr�
new_configrSr�)r*rr��config1�config2r$s&&   �rrz�<InterpreterConfigTests.test_predefined_config.<locals>.checkBs�����~�~�h�/�H�"�D�7��D�#�.�.��5�G�� � ��3����W�/�#�.�.��5�G�� � ��3����W�/����W�.rr;r4)r4rW)r$rzr*sf  r�test_predefined_config�-InterpreterConfigTests.test_predefined_configAsl���	/��\�\�)�
$�
$��$�
�#�%��N�N�D����d�#�#��d�!�$�#�#�%�
$��$�#�#�s#�
A4�	B	�4B	�=B	�B
�B
c�l
�UOO2FCD
vqUOQUQ029^tt^2So[U2o[O
U1-U@oUO
VS2PPP2UOQUQ029^tt^2[U2O2TTt-tFDvqgVg%(aJ	oooUOFDZoUOU6XcJV�Q$[OQ-U@o[O
U1-U@oUO
VS2J\	PPP2[U2O2FD�vq�U	Q6Xc&UOTt,tFD
pwU
6wfJUMJ	ooLU
%(,oSFD�oUOUQU	QU
8QU8Q029^tt^2V�-o[OQ-[[U21-U@@o[O
U1-U@oUO
VS2PPP2J�	J�	CJ	UOQ29^tt^2UOFDAoUO[29^tt^2[O
UP	Q5PPP2JC	PPP2[UOQ	*2O2FD�vq�U	Q6XcJ]PQ
QP[21FDko
UOQU	Q
U
8Q029^tt^2UO[29^tt^2[O
Q-V�-@PPP2PPP2Jm	J�	P	]QP[21FDgo
UOQU
8Q029^tt^2UO[29^tt^2[O
U
Q5PPP2PPP2Ji	QFDgo
UOQU
8Q029^tt^2UO[29^tt^2[O
U
Q5PPP2PPP2Ji	P!)%fhCK�9httooh)%fhCK49httoh)%fhCJ�9h)%fhCJO9h)%fhCK9h)%fhCK}9h)%fhCJ�9h)%fhCK'9h)%fhCJ�9h)%fhK�9h)%fhCJU9h)znoop (rDzchange all (r7�.z (z -> zunsupported field)rFr:rFg�?zunsupported value (�=zunsupported value(gil=)r7zunsupported value (gil=r")r�rF)rWr�r4rJrrXrS�
gil_supportedr7r�r�r}r7rOrorq)r$r*�vanillar�	overridesr��k�vr7�field�old�valuesr�rs&             r�test_update_from_dict�,InterpreterConfigTests.test_update_from_dictVs'��!�^�^�1�1�3�3�M�D�����t�f�A�.�/�/�"�� ��M�	�&�1�1�$�D�)�D���$�$�V�6�	0�����T�F�!�4�5�5�26�w�-�2E�2E�2G�H�2G�$�!�Q��X�2G�	�H��-�-�C��{�{�c�)� �'*�e�$�$�4�4�A�y�A�H�*�5�5�<@�O�DM�O�F��(�(��:�.�6�#�7�m�1�1�3�
���E�>�)-�);�);�H�);�A�C�x�a�a�);�F�H�F�"%�g�Y�F�!�C������a��w�b���t�C�7�!�&L�M�M�%*�L�	�#(�#8�#8�$�"�4��=�>�I�>�$��"/�!9�!9�<@�"O�DM�"O���,�,�V�>�N�M�"�4�'4�D�\�\�-�
.�
.������&�&�z�2�2�!�,�,�T��=�3�2�'�/�!�����!8�9�?�?�A�L�E���~���R���d�F�H�=���\�\�$7��w�a��y��"J�K�K��*�*�9�5�5�%�0�0�B�E�>�B�6�L�K�>�	B��A�s�D�&�(�3�E���� 6�u�i�q�A�B�B��&�&�y�1�1�!�,�,��7�2�C�B�4�"�E���� 7��y��B�C�C��&�&�z�2�2�!�,�,��7�3�D�C�"�k0�/�/��I�6�5�5��I�N�M�M��3�2�2��/�
.�
.��6�5�5��L�K�K��2�1�1��C�B�B��
3�2��D�C�C�s�7Q	�Q%	�8Q�#Q%	�0A
Q%	�5
Q9�Q9�AQ>�.R(�6R
�R(�S
�/R<�S
�S9	�/S%
�S9	�?T!	�T
�5T!	�Q
�Q
�Q%	�%Q6
�.Q6
�>R�R�R%�R%�
R(�(R9	�1R9	�<S
�S
�	S
�S"�S"�%S6�.S6�0	S9	�9T
�T
�T�T�T!	�!T3
�*T3
c�`�[P	P
Q5[QP
Q5[P	P	Q5[P
P	Q5[QP	Q5,o[P
P
Q5,o[%cUO[P
Q52Q	oU1Q
koRO2FD�oUOQ6XcJUVR2%c`ROQU029^tt^2RO
[O29^tt^2UU2PPP2PPP2J�UVQ2%c0ROQ
U029^tt^2UU2PPP2J�ROQU029^tt^2UU2PPP2J�	P!)%fhK�9h)%fhCJ9h)%fhCJ-9h)%fhCJB9h)T)r�r�r9)r7r�)r�r)rrr5)r�r�rc�^�[U2oSFDo[U1-U@U6XfJP	!	P
!r1)rJr})r��override_cases�nsrcs&&  r�match�6InterpreterConfigTests.test_interp_init.<locals>.match�s/���f��B�+�	���(�i�(�B�.��,�rc�^:�Qo[OV2oROU]2P!)�pass)r�r�r4)r�r�r�r$s&  �rrz�6InterpreterConfigTests.test_interp_init.<locals>.check�s(����F�"�?�?��O�B����R��#rr;z	invalid: zquestionable: zvalid: )	r}rr�r?r7r4r7rr�)r$�questionable�invalidrorzr�sf     r�test_interp_init�'InterpreterConfigTests.test_interp_init�s����
�� �
�
��"'�
�

��"�
�

�#�%)�
�
��"&�
�)
��4
�"'�.3�
�
���?��N�N�4�e�D�E�	�	$�
�+�+�-�F��z�z�Y�&���V�%�%��\�\�I�f�X�"6�7�7��*�*�=�+I�+I�J�J��f�
�K�8�7��v�,�,��\�\�N�6�(�";�<�<��&�M�=�<��\�\�G�F�8�"4�5�5��&�M�6�5�.�
K�J��8�7�7��=�<�<��6�5�5�sT�(F	�8	F
�F	�=	F+	�,	G	�F�F�F	�F(
�F(
�+F=
�4F=
�G
�	G
c
�\�[OQ2oUOQ29^tt^2[OQ2oQUm[%cP
Um[O2uq4[OU2oUOVR2PPP2UOQ29^tt^2[OQ2oUQ29^tt^2o[OU2oPPP2UOWU2PPP2UOQ29^tt^2[OQ2oUQ29^tt^2o[OU2oPPP2UOWU2PPP2UOQ29^tt^2[OQP	Q[[2Q5oUU29^tt^2o[OU2oPPP2UOWU2PPP2P!)%fhCK�9h)%fhCKD9h)%fhCK>9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhP!9h)	c3�  �[OUP
Q5oUw�[OU2P![OcP!h9h[OS2h[Ochh9h9h3h)F)�reqrefs)rr�rb�InterpreterNotFoundError)r�rds& r�
new_interp�:InterpreterConfigTests.test_get_config.<locals>.new_interp�sv���$�+�+�F�E�B�H�
����!�)�)�(�3��$�=�=������!�)�)�(�3��$�=�=����sf�B�A�;�B�A�A�B�A�B�B�A0�/B�0B�B�B�B�B�Br�r8r5r4�customr:r9)r�r7r�)�
contextlib�contextmanagerr4rrXr7rr��get_main�
get_configrS�bool)r$r|rrdrYr��origs&      r�test_get_config�&InterpreterConfigTests.test_get_config�s���	�	"�	"�	�
#�	��\�\�&�
!�
!�$�/�/��9�H� �H�L���9>��6�(�1�1�3�L�H�"�-�-�h�7�F�� � ��2�"��\�\�*�
%�
%�$�/�/�
�;�H��J�'�'�8�&�1�1�(�;��(�� � ���2�	&��\�\�(�
#�
#�$�/�/��9�H��H�%�%��&�1�1�(�;��&�� � ���2�	$��\�\�(�
#�
#� �+�+��"&��.2�?�.C�	�D��D�!�!�X�&�1�1�(�;��"�� � ���.�$�
#�+"�
!�
!��(�'�'��&�
%�
%��&�%��$�
#��"�!��$�
#�
#�s��)H%�AH%�'I
�'H9	�>I
�9'I4� I!	�7I4�28J�*J	�J�%H6	�.H6	�9I

�I

�	I
�
I	�I	�!I1
�*I1
�,I4�4J	�=J	�J
�J
�J�J+	�#J+	r")r;r9r5rN)r(r)r*r+r�r�r�rrWrar?rSr\rirvr�r.r]r^s@rr3r3�s�����	�E�)�)�#����!&�*.��
�	�%�'�'�"����!%�*.��*?��
�	��&�&�#����!&�*/��
�'�I�:1�M�&�$9�""�*:8�x:"�x*/�*/rr3c�`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sQs
QsQ
sQsQsQsQsQsQsUsP!)�InterpreterIDTestsi�c�8`�U1QkoUOU2P!)c�p:�[OR2P![OcP!h9hrN)rrbr{rcs�r�ensure_destroyed�?InterpreterIDTests.add_interp_cleanup.<locals>.ensure_destroyed�s.���
��%�%�h�/�� �9�9�
��
�s��5�5�5)rq)r$rdr�s&f r�add_interp_cleanup�%InterpreterIDTests.add_interp_cleanup�s���	�
	
���(�)rc�T�[O2oUOU2U!rN)rr�r�)r$r-s& r�new_interpreter�"InterpreterIDTests.new_interpreter	s#��
�
!�
!�
#������#��	rc�\�[OoU]
2oUOU]
2P!rr)r��normalize_interp_idr4)r$�convertrds&  r�test_conversion_int�&InterpreterIDTests.test_conversion_int	s&��#�7�7���2�;������2�&rc��[OoQQ[2oUU22oUOU]
2P!)c�(`�\sQsQsnQsQsUsP!)�9InterpreterIDTests.test_conversion_coerced.<locals>.MyInti	c��]
!rrr"r#s&rr��CInterpreterIDTests.test_conversion_coerced.<locals>.MyInt.__index__	���rr")r(r)r*r+r�r.r]r^s@r�MyIntr�	�����
�
rr�)r�r�r�r4)r$r�r�rds&   r�test_conversion_coerced�*InterpreterIDTests.test_conversion_coerced	s7��#�7�7��	�C�	��5�7�#������2�&rc�z�[OoUO2oUU2oUOV22P!rN)r�r�r�r4)r$r�rd�	converteds&   r� test_conversion_from_interpreter�3InterpreterIDTests.test_conversion_from_interpreter	s3��#�7�7���'�'�)���H�%�	�����-rc�>�[Oo[2QQQ1FDWoUOQU8029^tt^2UO	[
29^tt^2UU2PPP2PPP2JY	PoUOQU8029^tt^2UO	[29^tt^2UU2PPP2PPP2QoUOQU8029^tt^2UO	[29^tt^2UU2PPP2PPP2P!)%fhK�9h)%fhCJ.9h)%fhK�9h)%fhK�9h)%fhKh9h)%fhP!9h)g$@�10s10zbad: r�)r�r�ror4r7rqrO�
OverflowError)r$r��badids&  r�test_conversion_bad�&InterpreterIDTests.test_conversion_bad	s#��#�7�7��
�H����	
�E�����e�Y�/�0�0��&�&�y�1�1��E�N�2�1�0�

���
�\�\�E�%��+�
,�
,��"�"�:�.�.����/�-���
�\�\�E�%��+�
,�
,��"�"�=�1�1����2�-�
,�2�1��1�0�0��/�.��-�
,��2�1��-�
,�
,�s��D=	�	D*
�(D=	�E%�9	E	�E%�1F�	E8	�F�*D:�3D:�5D=	�=E
�E
�E"
�E"
�E%�%E5	�.E5	�8F
�F
�F�F	�F	c�r�UO2oUO[OU22P!rN)r�r5r��interpreter_exists�r$rds& r�test_lookup_exists�%InterpreterIDTests.test_lookup_exists5	s*���'�'�)������0�0��:�	<rc�|�[O2oUO[OU22P!rN)r��unused_interpreter_id�assertFalser�r�s& r�test_lookup_does_not_exist�-InterpreterIDTests.test_lookup_does_not_exist:	s,��$�:�:�<������0�0��:�	<rc��[O2o[OU2UO[O
U22P!rN)rr�rbr�r�r�r�s& r�test_lookup_destroyed�(InterpreterIDTests.test_lookup_destroyed?	s:�� �'�'�)�����h�'�����0�0��:�	<rc�H�[OQ[O1!)c�4�[OUP
Q5!)F)�implieslink)r�incref)r-s&rre�9InterpreterIDTests.get_refcount_helpers.<locals>.<lambda>H	s��
�,�,�R�U�Cr)r��get_interpreter_refcountr�decrefr#s&r�get_refcount_helpers�'InterpreterIDTests.get_refcount_helpersE	s!���6�6�
C�� � �
�	
rc	�	�[Oo[Oo[Oo[OoUO2vqVoUO
Q29^tt^2[O2oUOUU22UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2PPP2UO
Q29^tt^2[O2o[OU2UOUU22UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2UO[O29^tt^2UU2PPP2PPP2P!)%fhCK�9h)%fhCK�9h)%fhCK�9h)%fhCK{9h)%fhCKW9h)%fhCK39h)%fhCK?9h)%fhCK�9h)%fhCK�9h)%fhCKw9h)%fhCKS9h)%fhCK/9h)%fhCK9h)%fhP!9h)z
never existed�	destroyed)r�r��interpreter_refcount_linked�link_interpreter_refcount�unlink_interpreter_refcountr�r4r�r�r7rr{r�rb�	r$�exists�	is_linked�link�unlink�get_refcountr�r�rds	&        r�$test_linked_lifecycle_does_not_exist�7InterpreterIDTests.test_linked_lifecycle_does_not_existL	s��"�5�5��%�A�A�	� �:�:��"�>�>��'+�'@�'@�'B�$��f�
�\�\�/�
*�
*�(�>�>�@�H�����x� �
"��"�"�=�#I�#I�J�J��(�#�K��"�"�=�#I�#I�J�J��X��K��"�"�=�#I�#I�J�J��x� �K��"�"�=�#I�#I�J�J��X�&�K��"�"�=�#I�#I�J�J��x� �K��"�"�=�#I�#I�J�J��x� �K�+�"�\�\�+�
&�
&�$�+�+�-�H��!�!�(�+�����x� �
"��"�"�=�#I�#I�J�J��(�#�K��"�"�=�#I�#I�J�J��X��K��"�"�=�#I�#I�J�J��x� �K��"�"�=�#I�#I�J�J��X�&�K��"�"�=�#I�#I�J�J��x� �K��"�"�=�#I�#I�J�J��x� �K�'�
&�K�J�J��J�J�J��J�J�J��J�J�J��J�J�J��J�J�J��+�
*�
*��,K�J�J��J�J�J��J�J�J��J�J�J��J�J�J��J�J�J��'�
&�
&�s��.AP!�	N)	�/P!�:	N=	�/P!�2	O	�;/P!�*	O%	�3/P!�"	O9	�+/P!�	P
	�#P!�A*R-�6	P5	�?/R-�.	Q		�7/R-�&	Q	�//R-�	Q1	�'/R-�	R	�/R-�	R	�R-�)N:
�2N:
�4	P!�=O
�O
�	P!�O"
�O"
�	P!�%O6
�.O6
�0	P!�9P

�P

�	P!�
P
�P
�	P!�!P2	�*P2	�5Q
�>Q
�	R-�	Q
�Q
�	R-�Q.
�&Q.
�(	R-�1R
�:R
�<	R-�R
�R
�	R-�R*
�"R*
�$	R-�-R>	�6R>	c���[OoUO2vooUO2oUU2oUU2oUO	U2UOU]2P!�r)r�r�r�r�r�r4)r$r�r�rYrd�linked�refcounts&      r�test_linked_lifecycle_initial�0InterpreterIDTests.test_linked_lifecycle_initialv	sd��%�A�A�	�!�6�6�8���a���'�'�)���8�$����)������ �����1�%rc��[Oo[OoUO2vq4oUO	2oUU2UOUU22UO
]UU22UU2UOUU22UOUU22UO
]UU22P!rW)r�r�r�r�r�r�r4r5)r$r�r�r�r�r�rds&      r�"test_linked_lifecycle_never_linked�5InterpreterIDTests.test_linked_lifecycle_never_linked�	s���"�5�5��%�A�A�	�'+�'@�'@�'B�$��f��'�'�)��	�x������h��	!����
�|�H�%�	'�	�x������8��	�����h��	!����
�|�H�%�	'rc��[Oo[Oo[Oo[OoUO2oUU2UO
UU22UO
UU22UU2UO
UU22UOUU22P!rN)r�r�r�r�r�r�r5r�)r$r�r�r�r�rds&     r�!test_linked_lifecycle_link_unlink�4InterpreterIDTests.test_linked_lifecycle_link_unlink�	s���"�5�5��%�A�A�	� �:�:��"�>�>���'�'�)��	
�X������8��	�����h��	!�	�x������8��	�����h��	!rc��[Oo[Oo[OoUO	2vqEoUO2oUU2UO
UU22UO]UU22UU2UO]UU22UU2UOUU22P!r�)	r�r�r�r�r�r�r5r4r�)r$r�r�r�r�r�r�rds&       r�(test_linked_lifecycle_link_incref_decref�;InterpreterIDTests.test_linked_lifecycle_link_incref_decref�	s���"�5�5��%�A�A�	� �:�:��'+�'@�'@�'B�$��f��'�'�)��	
�X������h��	!����
�|�H�%�	'�	�x�����
�|�H�%�	'�	�x������8��	rc�<�[Oo[OoUO2vq4oUO	2oUU2UO]UU22UU2UO
UU22UO]UU22P!rW)r�r�r�r�r�r4r5)r$r�r�r�r�rYrds&      r�!test_linked_lifecycle_incref_link�4InterpreterIDTests.test_linked_lifecycle_incref_link�	s���%�A�A�	� �:�:��"&�";�";�"=���a��'�'�)���x�����
�|�H�%�	'�	
�X������h��	!����
�|�H�%�	'rc�(�[Oo[Oo[Oo[OoUO2vqVoUO
2oUU2UOUU22UU2UO]UU22UU2UOUU22UO]UU22UU2UOUU22UO]UU22P!rW)
r�r�r�r�r�r�r�r5r4r�r�s	&        r�/test_linked_lifecycle_link_incref_unlink_decref�BInterpreterIDTests.test_linked_lifecycle_link_incref_unlink_decref�	s���"�5�5��%�A�A�	� �:�:��"�>�>��'+�'@�'@�'B�$��f��'�'�)���X������h��	!�	�x�����
�|�H�%�	'�	�x������h��	!����
�|�H�%�	'�	�x������8��	����
�|�H�%�	'rr")r(r)r*r+r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r.r]r^s@rr�r��s`����*��
'�
'�.��.<�
<�
<�
�(!�T
&�'�.!�,�2'�$'�'rr�c�``�\sQsQsnP
s\Q2s\OQ2s	Qs
QsUsP!)�TestStaticTypesi�	c�f�UO%c[OQ2gP	UmP!)z%these tests do not support re-running)�_has_runr�SkipTestr.s&r�
setUpClass�TestStaticTypes.setUpClass�	s&���<�<�<��#�#�$K�L�L���rc'�D �[OUoUw�	P!3hrN)r�get_basic_static_type)r$r�r/s&* r�basic_static_type�!TestStaticTypes.basic_static_type
s����-�-�t�4���	�s� c��UO29^tt^2oUOUO[2UO	UO
[12UO[
U2[
[22PPP2UO[29^tt^2oUOUO[2UO	UO
[12UO[
U2[
[22PPP2P!)%fhK�9h)%fhP!9hrN)r�rirVror4rTr�rWs& r�%test_pytype_ready_always_sets_tp_type�5TestStaticTypes.test_pytype_ready_always_sets_tp_type
s����
#�
#�
%�
%���M�M�#�,�,��/����S�]�]�V�I�6��M�M�$�s�)�T�&�\�2�&��
#�
#�F�
+�
+�s��M�M�#�,�,��/����S�]�]�V�I�6��M�M�$�s�)�T�&�\�2�,�
+�
&�
%��,�
+�
+�s%�A*D�)A*D0�D-	�&D-	�0E	�9E	r")
r(r)r*r+r��classmethodr�rr�r�r�r.r]r^s@rr�r��	s@�����H�����������4�4rr�c�`�\sQsQsn\O
\O2Q22s\O
\O2Q22s\O
\O2Q22s	Qs
QsUsP!)�TestThreadStatei
c�`�U1QkoU2[OUQ5oUO2UO2P!)c��:`�,nU1Qko[OU2S9q[O]2RO	RO[O22]Q2P!)c�R:�RO[O22P!rN)r�r�r)�identss�rr��CTestThreadState.test_thread_state.<locals>.target.<locals>.callback&
s����
�
�i�1�1�3�4rz/Couldn't find main thread correctly in the list)r�_test_thread_stater�r�r4r�r�r)r�r=r�r�r$s   @�rr��1TestThreadState.test_thread_state.<locals>.target#
sX����F�
5�
�(�(��2���A��J�J�q�M����V�\�\�)�*=�*=�*?�@�!�N�
Prr+)r�r�r�r�)r$r�r�sf  r�test_thread_state�!TestThreadState.test_thread_state
s2���	P�	�����F�+��	���	�	���rc�``�QQ2n[O2nUU1Qko[OU2P!)c�(`�\sQsQsnQsQsUsP!)�8TestThreadState.test_thread_gilstate_in_clear.<locals>.Ci9
c�0�[O2P!rN)r�gilstate_ensure_releaser#s&rr��@TestThreadState.test_thread_gilstate_in_clear.<locals>.C.__del__:
s���1�1�3rr")r(r)r*r+r�r.r]r^s@rr�r�9
s����
4�
4rr�c�":�R2RmP!rN�r>)r��	local_vars��rr��?TestThreadState.test_thread_gilstate_in_clear.<locals>.callback@
s����#�I�Kr)r��localrr�)r$r�r�rs& @@r�test_thread_gilstate_in_clear�-TestThreadState.test_thread_gilstate_in_clear5
s0���	4�	4�
�O�O�%�	�	�	�$�$�X�.rc��[OQ2o[QQQU2oUOQUO2P!)z�
            import _testcapi

            def callback():
                print('callback called')

            _testcapi._test_thread_state(callback)
            z-X�tracemallocr?scallback called)r@rAr
r�rI)r$rEr�s&  r� test_gilstate_ensure_no_deadlock�0TestThreadState.test_gilstate_ensure_no_deadlockE
s<����� ����t�]�D�$�?���
�
�(�#�'�'�2rc�0�[O2P!rN)r�test_current_tstate_matchesr#s&r�test_gilstate_matches_current�-TestThreadState.test_gilstate_matches_currentT
s���-�-�/rr")
r(r)r*r+r�reap_threadsr�r�rrrr.r]r^s@rr�r�
s������"�"��0�0�2��3�#��(�"�"��0�0�2�/�3�#�/��"�"��0�0�2�3�3�#�3�0�0rr�c��-o[U2FDFoUOQ2%fJUdUOU2%cJ9[V2V#$JH	U!)�test_)�dir�
startswith�getattr)�mod�exclude_prefix�funcsr*s&&  r�get_test_funcsrX
sQ���E��C������w�'�'���%�$�/�/�.�*I�*I���c�(�����Lrc�`�\sQsQsn\2O\\22\O\
Q5Q2sQsQs
UsP!)�
Test_testcapiic
)�categoryc�2�[O2P!rN)r2�
test_widecharr#s&rr �Test_testcapi.test_widecharg
s���&�&�(rc�d�UO[O[O2P!rN)r4r�
Py_Versionre�
hexversionr#s&r�test_version_api_data�#Test_testcapi.test_version_api_datak
s������-�-�s�~�~�>rr")r(r)r*r+�locals�updaterrr�ignore_warnings�DeprecationWarningr r%r.r]r^s@rrrc
sC����
�H�O�O�N�9�-�.��$�$�.@�A�)�B�)�?�?rrc�P�\sQsQs\2O\\22QsP!)�Test_testlimitedcapiio
r")	r(r)r*r+r'r(rr2r.r"rrr,r,o
s��
�H�O�O�N�#3�4�5�5rr,c�T�\sQsQs\2O\\QQ52QsP!)�Test_testinternalcapiis
�
test_lock_)rr")	r(r)r*r+r'r(rr�r.r"rrr.r.s
s%��
�H�O�O�N�#4�2>�@�A�Arr.c�\�\sQsQs\2OQ\\222QsP!)�Test_PyLockix
c#��SF �D1oUOQ2%fJU[[U21w�	J3	P!3h)r/)rrr�)�.0r*s& r�	<genexpr>�Test_PyLock.<genexpr>z
s1�� 6��� 6�����|�4�=�T�7�#4�d�;�<� 6�s
�A�Ar")	r(r)r*r+r'r(rr�r.r"rrr1r1x
s(��
�H�O�O�6� #�$5� 6�6�6�6rr1rc�J`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sUsP!)
�Test_ModuleStateAccessi
z%Test access to module start (PEP 573)c��Qo[OOQ2Oo[O
%c![OOV2oL[OOV2o[OOV2o[OOU2oUOU2VPmP!)�!_testmultiphase_meth_state_accessr1)
�	importlib�util�	find_spec�originrr#�	machineryr!r"�spec_from_loader�module_from_spec�exec_module�module)r$�fullnamer=r$�specrBs&     r�setUp�Test_ModuleStateAccess.setUp�
s���6�����)�)�*;�<�C�C���"�"�"��(�(�=�=�h�O�F��(�(�<�<�X�N�F��~�~�.�.�x�@�����0�0��6�����6�"��rc��QQUOO2oU2oUOUO2UO2P!)z#PyType_GetModule for defining_classc��\sQsQsQsP!)�QTest_ModuleStateAccess.test_subclass_get_module.<locals>.StateAccessType_Subclassi�
r"rDr"rr�StateAccessType_SubclassrI�
rErrJ�rB�StateAccessTyperi�get_defining_module�r$rJrts&  r�test_subclass_get_module�/Test_ModuleStateAccess.test_subclass_get_module�
s=��	�t�{�{�'B�'B�	�,�-���
�
�h�2�2�4�d�k�k�Brc��QQUOO2oU2oUOUO2UO2P!)c�4``�\sQsQsnU1QksQsUsU9s!)�\Test_ModuleStateAccess.test_subclass_get_module_with_super.<locals>.StateAccessType_Subclassi�
c�":�[RU_2!rN)r�rMr�s&�rrM�pTest_ModuleStateAccess.test_subclass_get_module_with_super.<locals>.StateAccessType_Subclass.get_defining_module�
s����w�2�4�4rr")r(r)r*r+rMr.r]r�r�s@@rrJrS�
s����
5�
5rrJrKrNs&  r�#test_subclass_get_module_with_super�:Test_ModuleStateAccess.test_subclass_get_module_with_super�
s=��	5�t�{�{�'B�'B�	5�,�-���
�
�h�2�2�4�d�k�k�Brc��UOO2oUOO2oQUOQUO-oUO	2FCD�vqEUOU29^tt^2UO
UO2UO22UO
UO2]2U2UO
UO2UO22UO
UO2]2U]2UO
UO2UO22UO
UO2]2UQP	Q5UO
UO2UO22UO
UO2]2UO[29^tt^2U]Q5PPP2UO[29^tt^2U]]]2PPP2PPP2CJ�	P!)%fhKO9h)%fhK29h)%fhCJ9h)z�Checks methods defined with and without argument clinic

This tests a no-arg method (get_count) and a method with
both a positional and keyword argument.
�clinic�noclinic)�twice)�thricer�)
rBrL�increment_count_clinic�increment_count_noclinicr�r4r4�	get_countr7rq)r$r=r��methodsr*�increment_counts&     r�test_state_access�(Test_ModuleStateAccess.test_state_access�
s���
�K�K�'�'�)���K�K�'�'�)��
�a�.�.���2�2�
��
&-�]�]�_�_�!�D����d�#�#�� � ��������
�>�� � ������2��!�� � ��������
�>�� � ������2���"�� � ��������
�>�� � ������2���$�/�� � ��������
�>�� � ������2��&�&�y�1�1�#�1�-�2��&�&�y�1�1�#�A�q�!�,�2�'$�#�&5�"2�1��2�1��'$�#�#�sO�E/I&	�/
I
�9%I&	�I
�)I&	�I�	I�I&	�I#�I#�I&	�&I8
�/I8
c���UOO2oUO[29^tt^2UO	2PPP2P!)%fhP!9hrN)rBrLr7rq�getmodulebydef_bad_def)r$rts& r�test_get_module_bad_def�.Test_ModuleStateAccess.test_get_module_bad_def�
sB���;�;�.�.�0��
�
�
�y�
)�
)��+�+�-�*�
)�
)�
)�s�A�A%	�A%	c��QQ[UOO2oUOU2O	2UO2P!)c��\sQsQsQsP!)�FTest_ModuleStateAccess.test_get_module_static_in_mro.<locals>.Subclassi�
r"rDr"rr�Subclassrj�
rErrk)rTrBrLrirM)r$rks& r�test_get_module_static_in_mro�4Test_ModuleStateAccess.test_get_module_static_in_mro�
s7��	�}�d�k�k�&A�&A�	��
�
�h�j�4�4�6����Dr)rB)
r(r)r*r+r6rErOrVrbrfrlr.r]r^s@rr7r7
s0����/��C�C�$-�L.�E�Err7c�D`�\sQsQsn\Q2sQsQsQsQs	Us
P!)�TestInternalFrameApii�
c�.�[O2!rN)re�	_getframer"rr�func�TestInternalFrameApi.func�
s���}�}��rc��UO2o[OU2oUOV OO2P!rN)rrr��iframe_getcoderi�__code__)r$�framerEs&  r�	test_code�TestInternalFrameApi.test_code�
s3���	�	��� �/�/��6���
�
�d�I�I�.�.�/rc���UO2o[OU2oUOU]2UO	U[UOOO22P!r�)rrr��iframe_getlastir�ror�rv�co_code)r$rw�lastis&  r�
test_lasti�TestInternalFrameApi.test_lasti�
sP���	�	���!�1�1�%�8�����5�!�$�����s�4�9�9�#5�#5�#=�#=�>�?rc���UO2o[OU2oUOOOoUOV#]*2P!r�)rrr��iframe_getlinerv�co_firstlinenor4)r$rw�line�	firstlines&   r�	test_line�TestInternalFrameApi.test_line�
sD���	�	��� �/�/��6���I�I�&�&�5�5�	�����1�}�-rr")r(r)r*r+�staticmethodrrrxr~r�r.r]r^s@rroro�
s,��������0�
@�.�.rroc�L`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sUsP!)
�Test_Pep523APIi�
c��,o[oU[*o[U2FD&oVd6Xc[OU2U2J(	[O2U[*oUO[
U2[
U22[VsP	Q5FDvq�UOV�2J	P![O2h9h)T)�strict)�"SUFFICIENT_TO_DEOPT_AND_SPECIALIZEr�r��set_eval_frame_record�set_eval_frame_defaultr4r�r�)
r$rrr-�actual_callsr�r�ri�expected_callsrr�s
&&&       r�do_test�Test_Pep523API.do_test�
s�����2���:�:��	7��5�\���:�%�;�;�L�I���"�

�4�4�6��!C�C������^�,�c�,�.?�@� #�N�� N� N��H����X�.�!O��
�4�4�6�s�B>�!B>�>Cc�T`�QQ2nU1QkoQQ,oUOV2P!)c�(`�\sQsQsnQsQsUsP!)�4Test_Pep523API.test_inlined_binary_subscr.<locals>.Ci	c��P!rNr")r$�others&&rrj�@Test_Pep523API.test_inlined_binary_subscr.<locals>.C.__getitem__
rlrr")r(r)r*r+rjr.r]r^s@rr�r�	s����
�
rr�c�&:�R2]**P!�r;r")r�s�rrr�7Test_Pep523API.test_inlined_binary_subscr.<locals>.funcs���
�C��G�Grrrrj�r�)r$rrr-r�s&  @r�test_inlined_binary_subscr�)Test_Pep523API.test_inlined_binary_subscrs(���	�	�	���'�����T�!rc�J`�QQknU1Qko,QNoUOV2P!)r;c��P!rNr"rs&r�inner�/Test_Pep523API.test_inlined_call.<locals>.inner���rc�(:�R2R]*2P!r�r"�r�s�rrr�.Test_Pep523API.test_inlined_call.<locals>.funcs����G��"�Irr�)rrr�r�r��r$rrr-r�s&  @r�test_inlined_call� Test_Pep523API.test_inlined_calls ���	�	�+�����T�!rc�F`�QnU1QkoQQ,oUOV2P!)c��P!rNr"rs&rr��;Test_Pep523API.test_inlined_call_function_ex.<locals>.innerr�rc�:�R]*,P!r�r"r�s�rrr�:Test_Pep523API.test_inlined_call_function_ex.<locals>.funcs����B�4�Lrrrr�r�r�s&  @r�test_inlined_call_function_ex�,Test_Pep523API.test_inlined_call_function_exs#���	�	���!�����T�!rc�F`�QnU1Qko,QNoUOV2P!)c3� �]*w�	P!3hr�r"r"rrrO�1Test_Pep523API.test_inlined_for_iter.<locals>.gen#�
����H�rLc�(:�R2FDoJ	P!rNr")rYrOs �rrr�2Test_Pep523API.test_inlined_for_iter.<locals>.func%s����U���r)rrrOrOrOr�)r$rrr-rOs&  @r�test_inlined_for_iter�$Test_Pep523API.test_inlined_for_iter"s ���	�	�.�����T�!rc�l``�QQ2nQQ2nUU1Qko,QNoUOV2P!)c�2`�\sQsQsn\Q2sQsUsP!)�0Test_Pep523API.test_inlined_load_attr.<locals>.Ci,c��]*!r�r"r#s&rr=�2Test_Pep523API.test_inlined_load_attr.<locals>.C.a-s��rr")r(r)r*r+�propertyr=r.r]r^s@rr�r�,s����
�
��
rr�c�(`�\sQsQsnQsQsUsP!)�0Test_Pep523API.test_inlined_load_attr.<locals>.Di0c��]*!r�r")r$r*s&&r�__getattribute__�ATest_Pep523API.test_inlined_load_attr.<locals>.D.__getattribute__1r�rr")r(r)r*r+r�r.r]r^s@r�Dr�0r�rr�c�N:�R2OR2OP!rNr5)r�r�s��rrr�3Test_Pep523API.test_inlined_load_attr.<locals>.func3s���
�C�E�E�
�C�E�Er)rrr=r�r�)r$rrr-r�r�s&  @@r�test_inlined_load_attr�%Test_Pep523API.test_inlined_load_attr+s/���	�	�	�	�	�2�����T�!rc�T``�QnU1QknU1Qko,QNoUOV2P!)c3� �]*w�	P!3hr�r"r"rrr��/Test_Pep523API.test_inlined_send.<locals>.inner:r�rLc3�8: �R2FPiw�K
P!K3hrNr"r�s�r�outer�/Test_Pep523API.test_inlined_send.<locals>.outer<s�����w���s�
��c�*:�[R22P!rN)r�)r�s�rrr�.Test_Pep523API.test_inlined_send.<locals>.func>s������Mr)rrr�r�r�r�r�r�r�)r$rrr-r�r�s&  @@r�test_inlined_send� Test_Pep523API.test_inlined_send9s#���	�	�	�N�����T�!rr")
r(r)r*r+r�r�r�r�r�r�r�r.r]r^s@rr�r��
s-����/� "�"�"�"�"�"�"rr�c�J`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sUsP!)
�Test_Pep523AllowSpecializationiDzKTests for _PyInterpreterState_SetEvalFrameFunc with
allow_specialization=1.c�P�UO[O22P!rN)r5r��is_specialization_enabledr#s&r�&test_is_specialization_enabled_default�ETest_Pep523AllowSpecialization.test_is_specialization_enabled_defaultHs�����)�C�C�E�Frc���[O,2UO[O22[O2P![O2h9hrN)r�r�r�r�r�r#s&r�.test_is_specialization_enabled_with_eval_frame�MTest_Pep523AllowSpecialization.test_is_specialization_enabled_with_eval_frameLsG��	7��3�3�B�7����.�H�H�J�K��4�4�6���4�4�6���:A�A+c�$�[O,2UO[O22[O2UO[O22P![O2h9hrN)r�r�r�r�r�r5r#s&r�,test_is_specialization_enabled_after_restore�KTest_Pep523AllowSpecialization.test_is_specialization_enabled_after_restoreTs_��	7��3�3�B�7����.�H�H�J�K��4�4�6����)�C�C�E�F��
�4�4�6�s�:A8�8Bc���[O,2UO[O22[O2P![O2h9hrN)r��set_eval_frame_interpr5r�r�r#s&r�)test_is_specialization_enabled_with_allow�HTest_Pep523AllowSpecialization.test_is_specialization_enabled_with_allow]sE��	7��3�3�B�7��O�O�-�G�G�I�J��4�4�6���4�4�6�r�c�z`�QnU1Qko,o[OU2[[]*2FD
oU2J	[O2UOUO
Q2]2UOUO
Q2]2P![O2h9h)c��P!rNr"r"rrrr�KTest_Pep523AllowSpecialization.test_allow_specialization_call.<locals>.funcfr�rc�:�R2P!rNr")rrs�r�
func_outer�QTest_Pep523AllowSpecialization.test_allow_specialization_call.<locals>.func_outeris����Frrrr�)r�r�r�r�r�r4r�rV)r$r�r�rirrs&   @r�test_allow_specialization_call�=Test_Pep523AllowSpecialization.test_allow_specialization_calles����	�	���	7��3�3��
��=��A�B����C�
�4�4�6�	
����+�+�F�3�Q�7�	
���L�.�.�|�<�a�@��
�4�4�6�s�;B#�#B:c�h`�QQknU1Qko[[2FD
oU2J	,o[OU2[[2FD
oU2J	[O2QQ,[*oUOV42P![O2h9h)r;c��P!rNr"rs&rr��ITest_Pep523AllowSpecialization.test_no_specialization_call.<locals>.innerr�rc�:�R2P!rNr"r�s�rrr�HTest_Pep523AllowSpecialization.test_no_specialization_call.<locals>.func�s����Grrrr�r�)r�r�r�r�r�r4)r$rrrYr�rr�s&    @r�test_no_specialization_call�:Test_Pep523AllowSpecialization.test_no_specialization_call|s����	�	��9�:�A��F�;���	7��3�3�L�A��=�>����?�
�4�4�6��G�$�'I�I������0��
�4�4�6�s�4B�B1r")
r(r)r*r+r6r�r�r�r�r�r�r.r]r^s@rr�r�Ds0�����G�7�G�7�A�.1�1rr�zneed Py_GIL_DISABLEDc�(`�\sQsQsnQsQsUsP!)�TestPyThreadIdi�c�``	�[OnQn	UU	1QkQ[O2o]o[	U2Tt,tFD	p12MJ	ooSFDoUO2J	SFDoUOO2J	R2,oSFDoUOO2J	SFDToUO2UOUO2UOUOUO2JV	SFD+oUOU[ 2UO#U]2J-	UO[%['U22[%U2U2P!ttoh)r!c�D:``�\sQsQsnU1QksUU1QksQsUsU9s!)�5TestPyThreadId.test_py_thread_id.<locals>.GetThreadIdi�c��:�[RU_2[O2UmUOO2[O2UmPUmP!rN)	r�r�r�r��get_lockrHr��started_lock�py_tidr�s&�rr��>TestPyThreadId.test_py_thread_id.<locals>.GetThreadId.__init__�sB����� �"� )��� 0��
��
�
�%�%�'�$-�O�O�$5��!�"��rc��:�UOO2UOO2R2Um[
OR2R2UmP!rN)r�r�r�rHr�r�r��py_tid2)r$�py_thread_id�short_sleeps&��rr�9TestPyThreadId.test_py_thread_id.<locals>.GetThreadId.run�sC����!�!�%�%�'��
�
�%�%�'�*�n����
�
�;�'�+�~��r)r�r�r�r�)	r(r)r*r+r�rr.r]r�)r�r_r�rs@@��r�GetThreadIdr��s����
#�
.�
.rr)r�r�r�r�r�r�r�r�r�r?r�r�r�r4r�r�rUr�r�r�)
r$r�nthreadrYr�r^�
py_thread_idsr'r�rs
&       @@r�test_py_thread_id� TestPyThreadId.test_py_thread_id�s>���)�5�5����
	.�
	.�)�*�*�
	.���*/��.�9�.�Q�;�=�.��9��F��L�L�N���F����$�$�&��&��(�
��F��O�O�#�#�%���F��K�K�M�� � ����/�
���V�^�^�V�]�]�;��!�C��!�!�#�s�+����s�A�&�!�	
����S��/�0�#�m�2D�&�	(��7:s�E;r")r(r)r*r+rr.r]r^s@rr�r��s����2(�2(rr�c�B`�\sQsQsnQsQsQsQsQsQs	Qs
UsP!)	�TestVersionsi�c	��UOFDWCuqUO[U2Q59^tt^2[OUoUOV22PPP2JY	P!)%fhJn9h��r$)�
full_casesr4�hexr2�pack_full_versionr4�r$r�rrs&   r�test_pack_full_version�#TestVersions.test_pack_full_version�sW��#���O�T�����X���7�7�)�;�;�T�B��� � ��2�8�7� /�7�7�7���'A,	�,A=
�5A=
c	��UOFDWCuqUO[U2Q59^tt^2[OUoUOV22PPP2JY	P!)%fhJn9hr
)�xy_casesr4r
r2�pack_versionr4rs&   r�test_pack_version�TestVersions.test_pack_version�sW��#�}�}�O�T�����X���7�7�)�6�6��=��� � ��2�8�7� -�7�7�7�rc	��[OQ2oUOOoUOUmUO,]*UmUOFDICuq4UO[U2Q59^tt^2UUoUOVT2PPP2JK	P!)%fhJ`9h�r!r)rr&r,�Py_PACK_FULL_VERSION�c_uint32�restype�c_int�argtypesrr4r
r4�r$r!�ctypes_funcr�rrs&     r�test_pack_full_version_ctypes�*TestVersions.test_pack_full_version_ctypes�s����,�,�X�6���&�&�;�;��$�o�o��� &���~��1���#���O�T�����X���7�7�$�d�+��� � ��2�8�7� /�7�7�7���
B4	�4C
�=C
c	��[OQ2oUOOoUOUmUO,]*UmUOFDICuq4UO[U2Q59^tt^2UUoUOVT2PPP2JK	P!)%fhJ`9hr)rr&r,�Py_PACK_VERSIONrrrrrr4r
r4rs&     r�test_pack_version_ctypes�%TestVersions.test_pack_version_ctypes�s����,�,�X�6���&�&�6�6��$�o�o��� &���~��1���#�}�}�O�T�����X���7�7�$�d�+��� � ��2�8�7� -�7�7�7�r#r"))r��rXrsrni�)r�rsr�ri�
)��i������i�))r�r(i)r�rsi
)r*r+i)r(r)r*r+rrrrr!r&r.r]r^s@rrr�s,�����J�
�H�3�3�3�3�3rrc�(`�\sQsQsnQsQsUsP!)�	TestCEvali�c��[OQ2o[QU2vq#oUOQ2O	2oUOUO
Q2]2UOUO
Q2]2P!)z�
            import _testcapi
            _testcapi.toggle_reftrace_printer(True)
            l1 = []
            l2 = []
            del l1
            del l2
            _testcapi.toggle_reftrace_printer(False)
        r?rzCREATE listzDESTROY list)r@rAr
rrKr4r�)r$rErYrI�liness&    r�test_ceval_decref�TestCEval.test_ceval_decref�sp����� �
��%�T�4�0�	����
�
�7�#�.�.�0��������]�3�Q�7�������^�4�a�8rr")r(r)r*r+r2r.r]r^s@rr/r/�s����
9�
9rr/�__main__rN)Qr(�collectionsrr�importlib.machineryr:�importlib.utilr�r)r�r9r�rer@r�r�r�rrPrmr2r�test.supportrrrrrr	r
r�test.support.script_helperrr
rrr�ImportErrorr1r0r�ModuleNotFoundErrorr&rrrr2r�r�rr r%r'r��force_not_colorized_test_class�TestCaser0rdr�r�r3r�r�r�rrr,r.r�r1rr7ror�r�r�r_r�rr/r(r�r"rr�<module>r>sl��������	�
��
�
���������-�&�&�)�(�-�9�(�d�d���������

�'�'��4�	�G�����<�=��
:�:�
6=�5L�5L�5L�-�R`��	�'�'�M

�x� � �M

�(�M

�`�Q.�8�,�,�Q.��Q.�hg&�x�(�(�g&�TV��*�*�V�r
�{/�X�.�.�{/��{/�|�{'��*�*�{'��{'�| 4�h�'�'� 4�F80�h�'�'�80�v�	?�H�%�%�	?�6�8�,�,�6�A�H�-�-�A�
�,�,�.�6�(�#�#�6�/�6�
����D�(�*P�Q�YE�X�.�.�YE�R�YE�x.�8�,�,�.�0&)�"�K"�X�&�&�K"�\O1�X�%6�%6�O1�d
���W�,�,�.D�E�3(�X�&�&�3(�F�3(�j*3�8�$�$�*3�Z9��!�!�9�"�z���M�M�O���Q_���������O������������M��s`�
L	�L�L)�L9�	L�L�L�L&�L&�%L&�)L6�/L6�5L6�9M�?M�M

Youez - 2016 - github.com/yon3zu
LinuXploit