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:/Python313/Lib/test/support/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/support/__pycache__/__init__.cpython-313.opt-1.pyc
�

��iRz���Sr\S:wa\"S5eSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSK
r
SSKrSSKrSSKrSSKr/SQrSrSrSrS	r\R.R1\R.R3\55r\R.R1\5r\R.R1\5r\R.R1\5r"S
S\5r "SS
\ 5r!"SS\!5r""SS\ 5r#"SS\RH5r%Sr&Sr'Sr(Sr)Sr*Sq+Sq,Sr-Sr.Sq/Sr0Sr1Sr2Sr3Sr4Sr5S�Sjr6S�S jr7S!r8S"r9S#r:S$r;S�S%jr<SSSSS&.S'jr=S�SSSSS&.S(jjr>\="S)S*9r?S+r@S,rAS-rBS.rC\R�"\ER�S/5R�S05S15rHS�S2jrIS�S3jrJS�S4jrKS�S5jrLS6rMS�S7jrNS�S8jrO\R�S�S9j5rQS:rR\R�S;:HrT\R�R�S<5rU\R�S=:HrV\R�S>;a\V(aS?OS@rWOSrW\R�SA:HrX\R�SB:HrY\R�SC;rZ\Z=(d \R�SD:Hr[\\"\SE5=(a" \X=(d \Y=(d \Z=(d \V(+r]SFr^\X=(d \Y=(d \Z=(d \V(+r_SGr`\X=(d \Y(+raSSH.SIjrbSrc\R�S;:wa\R�"SJ5SJ:grcSKrfSrgSrh\R.R�\SL5rjSMrkS�SNjrlSOrmSP\nSQ\o\n\p44SRjrqS�SSSS.STjjrrSUrs\R�SV5rtSWruSXrvSYrwSZrx\R�S[5ry\R�S\5rzS]r{S^r|S_r}\~"\R�"S`55r�S�Sajr�Sbr�\�(aScr�OSdr�Ser�\�Sf-r�Sgr�Shr�Sir�Sjr�Skr�SSl.Smjr�\R�Sn5r�Sor�Spr�Sqr�Sr\�-r�Ss\�-r�St\�-r�\GR&r�Su\nSQ\�4Svjr�Su\nSQS4Swjr�"SxSy5r�S�Szjr�S{r�S|r�S}r�S~r�S�Sjr�S�r�S�r�S�r�S�r�S�r�\R�"S�5=(d S�S�:Hr�S�r�S�r�\�"5=(a- \R�S;:g=(a \R�"S�5(+r�\�RSLr�\�=(a \�(+r�\R�"\�S�5r�S�r�S�r�\GRZ\�l�Sq�S�r�\R�S�5r�\R�S�5r�S�r�S�r�"S�S�\p5r�Sq�S�r�"S�S�5r�S�r�S�S�.S�jr�S�S�jr�S�S�jr�"S�S�5r�S�r�\R�S�5r�S�r�SS�.S�jr�S�r�S�S�jr�/4S�jr�Sq�S�r�S�r�\R�S�5r�"S�S�5r�S�r�S�r�"S�S�5r�\�"5r�"S�S�5r�\�"5r�\GR�"S�S�55r�\�"5r�\GR�"S�S�55r�\�"5r�S�r�\GR�GR�r�S�r�"S�S�5r�SS�.S�jr�S�r�S�r�S�r�S�r�\R�S�5r�S�S�jr�S�\nS�\nSQ\p4S�jr�S�\pSQS4S�jr�S�r�\GR�S�5r�\R�S�5r�\\"\S�5r�S�r�S�S)S�.S�jjr�S�S�S�S)S�.S�jjr�"S�S�5r�\R�S�5r�S�r�S�r�\\"\S�5=(a  \GR�"5GR�S�:Hr�\GR�"\�S�5r�\\"\S�5r�S�r�\�"S�S�15r�S�r�S�r�S�r�\R�S�5r�S�r�S�r�SQ\o\n\n44S�jr�S�Gr"S�S�5GrS�GrSQG\\n4S�jGrg!\ea GN�f=f)�z7Supporting definitions for the Python regression tests.ztest.supportz.support must be imported from the test package�N)Z�
PIPE_MAX_SIZE�verbose�
max_memuse�
use_resources�failfast�Error�
TestFailed�
TestDidNotRun�ResourceDenied�record_original_stdout�get_original_stdout�captured_stdout�captured_stdin�captured_stderr�captured_output�is_resource_enabled�get_resource_value�requires�requires_resource�requires_freebsd_version�requires_gil_enabled�requires_linux_version�requires_mac_ver�check_syntax_error�
requires_gzip�requires_bz2�
requires_lzma�
bigmemtest�bigaddrspacetest�cpython_only�
get_attribute�requires_IEEE_754�
requires_zlib�has_fork_support�
requires_fork�has_subprocess_support�requires_subprocess�has_socket_support�requires_working_socket�anticipate_failure�load_package_tests�detect_api_mismatch�check__all__�skip_if_buggy_ucrt_strfptime�check_disallow_instantiation�check_sanitizer�skip_if_sanitizer�requires_limited_api�requires_specialization�
MS_WINDOWS�	is_jython�
is_android�
is_emscripten�is_wasi�is_apple_mobile�check_impl_detail�
unix_shell�setswitchinterval�get_pagesize�open_urlresource�
reap_children�run_with_locale�	swap_item�findfile�infinite_recursion�	swap_attr�Matcher�set_memlimit�SuppressCrashReport�sortdict�run_with_tz�PGO�missing_compiler_executable�	ALWAYS_EQ�NEVER_EQ�LARGEST�SMALLEST�LOOPBACK_TIMEOUT�INTERNET_TIMEOUT�
SHORT_TIMEOUT�LONG_TIMEOUT�Py_DEBUG�exceeds_recursion_limit�get_c_recursion_limit�
skip_on_s390x�without_optimizer�force_not_colorized�force_not_colorized_test_class�make_clean_env�
BrokenIterg$@gN@g>@g�r@c��\rSrSrSrSrg)r�rz*Base class for regression test exceptions.�N��__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r_��*C:\Python313\\Lib\test\support\__init__.pyrrrs��4rgrc�:^�\rSrSrSrSS.U4SjjrSrSrU=r$)r	�u�Test failed.N��statsc�@>�XlX l[TU]"U/UQ76 g�N)�msgrm�super�__init__)�selfrprm�args�	__class__s    �rhrr�TestFailed.__init__ws������
�
����$�t�$rgc��UR$ro�rp�rss rh�__str__�TestFailed.__str__|s���x�x�rg)rprm)	rarbrcrdrerrrzrf�
__classcell__�rus@rhr	r	us����)-�%�%�
�rgr	c�,^�\rSrSrSrU4SjrSrU=r$)�TestFailedWithDetails�rkc�:>�X lX0l[TU]
XX4S9 g)Nrl)�errors�failuresrqrr)rsrpr�r�rmrus     �rhrr�TestFailedWithDetails.__init__�s����� �
�
����h��<rg)r�r�)rarbrcrdrerrrfr|r}s@rhrrs����=�=rgrc��\rSrSrSrSrg)r
�zTest did not run any subtests.r_Nr`r_rgrhr
r
�s��(rgr
c��\rSrSrSrSrg)r�z�Test skipped because it requested a disallowed resource.

This is raised when a test calls requires() for a resource that
has not be enabled.  It is used to distinguish between expected
and unexpected skips.
r_Nr`r_rgrhrr�s��rgrc�6�U(a[R$S$)z�Decorator to mark a test that is known to be broken in some cases

Any use of this decorator should have a comment identifying the
associated tracker issue.
c��U$ror_)�fs rh�<lambda>�$anticipate_failure.<locals>.<lambda>�s��Qrg)�unittest�expectedFailure)�	conditions rhr*r*�s����'�'�'��rgc�`�UcSn[nURUUUS9nURU5 U$)z�Generic load_tests implementation for simple test packages.

Most packages can implement load_tests using this function as follows:

   def load_tests(*args):
       return load_package_tests(os.path.dirname(__file__), *args)
ztest*)�	start_dir�
top_level_dir�pattern)�
STDLIB_DIR�discover�addTests)�pkg_dir�loader�standard_testsr��top_dir�
package_testss      rhr+r+�sD�������G��O�O�g�29�,3�$�5�M����M�*��rgc�v�[X5nU$![a [R"SU<SU<35ef=f)z?Get an attribute, raising SkipTest if AttributeError is raised.zobject z has no attribute )�getattr�AttributeErrorr��SkipTest)�obj�name�	attributes   rhr!r!�sB����C�&�	�����O����3�� M�N�N�O�s��)8�Fc��Uqgro)�_original_stdout)�stdouts rhrr�s���rgc�<�[=(d [R$ro)r��sysr�r_rgrhr
r
�s���)�s�z�z�)rgc��U"U6$![a6n[S:�a&[URR<SU<35 eSnAf[
a�n[S:�aB[URR<SU<35 [SUR<U<35 [R"U[R5 U"U6sSnA$SnAff=f)N��: zre-run )
�FileNotFoundErrorr�printrura�OSError�os�chmod�stat�S_IRWXU)�path�funcrt�errs    rh�
_force_runr��s�����T�{������a�<��c�m�m�4�4�c�:�;�
�����a�<��c�m�m�4�4�c�:�;��4�=�=�$�7�8�
����t�|�|�$��T�{����s'��
C�1A�
C�A5C
�C�
Cc	�^�[[S5(a[R$SSKnSn[RRS5(aUR
5(aSnGO�[RRS5(a�SSKmSSKmSnSn"U4SjSTR5nTRRnUR5nU(dTR5eU"5nTRR5nUR!UUTR#U5TR%U5TR#U55n	U	(dTR5e['UR(U-5(dSnOb[RS	:XaNSSKn
U
R-S
S/SSS
9nUR.R1S5R35nUS:waSU<S3nU(d>SSKJn
 U
"5nUR;5 UR=5 UR?5 U[l&U(+[l[R$!U
R4a SnN�f=f![@aQn[CU5n[EU5S:�aUSSS-nSRG[IU5RJU5nSnAN�SnAff=f)N�resultr�winz(gui is not available on Windows IoT Corer�c�>�\rSrSrSYRR
4SYRR
4SYRR4/rSrg)�*_is_gui_available.<locals>.USEROBJECTFLAGS���fInherit�	fReserved�dwFlagsr_N)	rarbrcrd�wintypes�BOOL�DWORD�_fields_rf)�ctypess�rh�USEROBJECTFLAGSr��s@���#�V�_�_�%9�%9�:�$�f�o�o�&:�&:�;�"�F�O�O�$9�$9�:�<�Hrgr�z,gui not available (WSF_VISIBLE flag not set)�darwin�	launchctl�managernameT)�capture_output�checkzutf-8�Aquazmanagername=z' -- can only run in a macOS GUI sessionz*unable to detect macOS launchd job manager)�Tk�2z [...]zTk unavailable due to {}: {})'�hasattr�_is_gui_availabler��platformr��
startswith�win32_is_iotr��ctypes.wintypes�	Structure�windll�user32�GetProcessWindowStation�WinErrorr�r��GetUserObjectInformationW�byref�sizeof�boolr��
subprocess�runr��decode�strip�CalledProcessError�tkinterr��withdraw�update�destroy�	Exception�str�len�format�typera�reason)r�r��	UOI_FLAGS�WSF_VISIBLEr��dll�h�uof�needed�resr��rcr�r��root�e�
err_stringr�s                 @rhr�r��si���� �(�+�+� �'�'�'��
�F�
�|�|���u�%�%�(�*?�*?�*A�*A�;��	���	 �	 ��	'�	'�	���	���	<�f�.�.�	<��m�m�"�"���'�'�)����/�/�#�#�������&�&�(���+�+�A���L�L����M�M�#���L�L�� �	"��
��/�/�#�#��C�K�K�+�-�.�.�C�F��	����	!�	�	R�����m� <�/3�4� �A�B��)�)�*�*�7�3�9�9�;�K��f�$�(�K�>�)P�Q���	G�"��4�D��M�M�O��K�K�M��L�L�N� &���#)�z����#�#�#��1�,�,�	B�A�F�	B���	G��Q��J��:���#�'���_�x�7�
�3�:�:�4��7�;K�;K�;E�G�F��		G�s+�"<I�3=I3�I0�/I0�3
K�=AK	�	Kc�2�[SL=(d	 U[;$�z�Test whether a resource is enabled.

Known resources are set by regrtest.py.  If not running under regrtest.py,
all resources are assumed enabled unless use_resources has been set.
N)r��resources rhrr"s���D� �=�H�
�$=�=rgc�<�[cg[RU5$r�)r�getr�s rhrr*s��������X�&�&rgc���[U5(dUcSU-n[U5eUS;a[(d[S5eUS:Xa)[5(d[[R5egg)z@Raise ResourceDenied if the specified resource is not available.Nz"Use of the %r resource not enabled>�network�urlfetchzNo socket support�gui)rrr(r�r�)r�rps  rhrr4sm���x�(�(��;�6��A�C��S�!�!��*�*�3E�3E��0�1�1��5��!2�!4�!4��.�5�5�6�6�"5�rgc���SSKnUR5U:wagUR5RSS5Sn[	[[URS555$![a gf=f)Nr�-r��.)r��system�release�split�tuple�map�int�
ValueError)�sysnamer��version_txts   rh�_get_kernel_versionr?sk�������G�#���"�"�$�*�*�3��2�1�5�K���S��k�/�/��4�5�6�6������s�'A&�&
A3�2A3c�x�SSKnSR[[U55nUR	5RSS5SnUR
5U:Xa.[[[URS555nXQ:nOSn[R"UUSUSU35$![a SnN-f=f)	z�Decorator raising SkipTest if the OS is `sysname` and the version is less
than `min_version`.

For example, @_requires_unix_version('FreeBSD', (7, 2)) raises SkipTest if
the FreeBSD version is less than 7.2.
rNrrr�Fz	 version � or higher required, not )r��joinr	r�rrrrr
rr��skipIf)r�min_versionr��min_version_txtr
�version�skips       rh�_requires_unix_versionrIs�����h�h�s�3��4�5�O��"�"�$�*�*�3��2�1�5�K�����G�#�	)��C��[�%6�%6�s�%;�<�=�G��(�D����?�?���)�9�_�-�-F��-�	�����	��D�	�s�(B*�*B9�8B9c��[SU5$)z�Decorator raising SkipTest if the OS is FreeBSD and the FreeBSD version is
less than `min_version`.

For example, @requires_freebsd_version(7, 2) raises SkipTest if the FreeBSD
version is less than 7.2.
�FreeBSD�r�rs rhrrds��"�)�[�9�9rgc��[SU5$)z�Decorator raising SkipTest if the OS is Linux and the Linux version is
less than `min_version`.

For example, @requires_linux_version(2, 6, 32) raises SkipTest if the Linux
version is less than 2.6.32.
�Linuxrrs rhrrms��"�'�;�7�7rgc�^�U4SjnU$)z�Decorator raising SkipTest if the OS is Mac OS X and the OS X
version if less than min_version.

For example, @requires_mac_ver(10, 5) raises SkipTest if the OS X version
is lesser than 10.5.
c�X>^�[R"T5UU4Sj5nTUlU$)Nc�d>�[RS:Xa�SSKnUR5Sn[[	[
UR
S555nUT:a=SR[	[T55n[R"SU<SU<35eT"U0UD6$![a Nf=f)Nr�rrz	Mac OS X r)r�r��mac_verrr	r
rrr�r�r�r)rt�kwr�r
rrr�rs      ��rh�wrapper�4requires_mac_ver.<locals>.decorator.<locals>.wrapper~s�����|�|�x�'��&�.�.�0��3��	>�#�C��[�->�->�s�-C�$D�E�G���,�*-�(�(�3�s�K�3H�*I��&�/�/�.��=�>�>�-�
��$��$�$��"����s�(B"�"
B/�.B/)�	functools�wrapsr)r�r#rs` �rh�	decorator�#requires_mac_ver.<locals>.decorator}s-���	����	�	%�
�	%�*����rgr_)rr's` rhrrvs����&�rgc��SSKnU(dSnUR5R5S:Hn[R"X 5$![[4a4n[
R"[5RSX3S9 SnSnANUSnAff=f)z4Decorator raising SkipTest if running on a buildbot.rNznot suitable for buildbots�buildbotzgetpass.getuser() failed %s.��exc_infoF)�getpass�getuser�lower�KeyErrorr��logging�	getLoggerra�warningr�r)r�r-�
isbuildbotr�s    rh�skip_if_buildbotr5�sx����-����_�_�&�,�,�.�*�<�
��?�?�:�.�.��
�g������(�#�+�+�,J�C�+�^��
���s�!A�B
�*B�B
��address�memory�ub�threadc���U(d U(dU(dU(d[S5e[R"S5=(d Sn[R"S5=(d SnSU;=(d SU;nSU;=(d SU;nS	U;=(d S
U;nSU;=(d SU;n	U=(a U=(d/ U=(a U=(d U=(a U=(d U=(a U	$)
z9Returns True if Python is compiled with sanitizer supportz:At least one of address, memory, ub or thread must be True�CFLAGS��CONFIG_ARGSz-fsanitize=memoryz--with-memory-sanitizerz-fsanitize=addressz--with-address-sanitizerz-fsanitize=undefinedz#--with-undefined-behavior-sanitizerz-fsanitize=threadz--with-thread-sanitizer)r�	sysconfig�get_config_var)
r7r8r9r:�cflags�config_args�memory_sanitizer�address_sanitizer�ub_sanitizer�thread_sanitizers
          rhr0r0�s����v��v��U�V�V��
%�
%�h�
/�
5�2�F��*�*�=�9�?�R�K��v�%�	1�!�[�0��
	��&�	2�"�k�1��
	�&�(�	=�-��<��
	�v�%�	1�!�[�0��

�	$�$�	&�	�	&�&�	&�	�	��	&�
�	$�$�	rgc�T�U(dSn[XX4S9n[R"XP5$)z>Decorator raising SkipTest if running with a sanitizer active.z"not working with sanitizers activer6)r0r�r)r�r7r8r9r:rs      rhr1r1�s%���5���7�b�P�D��?�?�4�(�(rgT)r7c�J�SHnX ;aX==SU3-
ss'MXU'M g)N)�ASAN_OPTIONS�MSAN_OPTIONS�
UBSAN_OPTIONS�TSAN_OPTIONS�:r_)�env�optionr�s   rh�set_sanitizer_env_varrP�s+��Q���;��I�1�V�H��%�I���I�	Rrgc�F^�[R"T5U4Sj5nU$)z5Skip the test on TLS certificate validation failures.c�>�T"U0UD6 g![a+nS[U5;a[R"S5eeSnAff=f)N�CERTIFICATE_VERIFY_FAILEDz.system does not contain necessary certificates)r�r�r�r�)rt�kwargsr�r�s   �rh�dec�&system_must_validate_cert.<locals>.dec�sO���	�
�t��v����	�*�c�!�f�4��'�'�)A�B�B���		�s��
A�&<�A�r%r&)r�rUs` rh�system_must_validate_certrX�s%����_�_�Q������Jrgi@i�double�IEEEztest requires IEEE 754 doublesc�\�SSKn[R"X5$![a SnN$f=f�Nr)�zlib�ImportErrorr��
skipUnless)r�r]s  rhr#r#��3�������t�,�,����������+�+c�\�SSKn[R"X5$![a SnN$f=fr\)�gzipr^r�r_)r�rcs  rhrr�r`rac�\�SSKn[R"X5$![a SnN$f=fr\)�bz2r^r�r_)r�res  rhrrs3�������s�+�+�������rac�\�SSKn[R"X5$![a SnN$f=fr\)�lzmar^r�r_)r�rgs  rhrrr`rac��SSKnUR	5n[US5(+$![a [R"S5ef=f)Nr�_testinternalcapi required�code_debug_ranges)�_testinternalcapir^r�r��
get_configr�)rk�configs  rh�has_no_debug_rangesrnsQ��>� ��
)�
)�
+�F��F�.�/�0�0�0���>���� <�=�=�>�s	�)�!A
c���[5n[R"X5$![Ra.nSnUR(aURSOUnSnANSSnAff=f)NTr)rnr�r�rtr)r�rr�s   rh�requires_debug_rangesrpsR��1�"�$���?�?�4�(�(�����1����f�f������&���1�s�
"�A$�$A�A$c�>�U(dgSSKng![a gf=f)zzCheck if suppress_immortalization(suppress) can be used.

Use this helper in code where SkipTest must be eagerly handled.
TrNF)rkr^)�suppressrks  rh� can_use_suppress_immortalizationrs s+��
��� �������s��
�c#�# �U(dSv� gSSKJn U"S5nURS5 Sv� URS5 g!URS5 f=f7f)z�Suppress immortalization of deferred objects.

If _testinternalcapi is not available, the decorated test or class
is skipped. Use can_use_suppress_immortalization() outside test cases
to check if this decorator can be used.
Nr���
import_modulerkTF)�
import_helperrv�suppress_immortalization)rrrvrks   rhrxrx.sR����
��,�%�&9�:���.�.�t�4�:�
��2�2�5�9���2�2�5�9�s�,A�A�A�A�Ac�v�SSKn[R"UR	5S5$![a gf=f)Nrz,requires immortalization of deferred objects)rkr^r�r_�get_immortalize_deferred)rks rh� skip_if_suppress_immortalizationr{DsD��� ����0�I�I�K� N�P�P������s�+�
8�8�win32�java�android>�ios�tvosr|�vxworks�watchosz/system/bin/shz/bin/sh�
emscripten�wasi>rr�r�r��forkc�8�[R"[S5$)Nzrequires working os.fork())r�r_r$r_rgrhr%r%ls�����/�1M�N�Nrgc�8�[R"[S5$)z3Used for subprocess, os.spawn calls, fd inheritancezrequires subprocess support)r�r_r&r_rgrhr'r'{s�����5�7T�U�Urg)�modulec��SnU(a"[(d[R"U5eg[R"[U5$)z{Skip tests or modules that require working sockets

Can be used as a function/class decorator or to skip an entire module.
zrequires socket supportN)r(r�r�r_)r�rps  rhr)r)�s>��
$�C�
�!�!��#�#�C�(�(�"��"�"�#5�s�;�;rgz%4Yzhttp://www.pythontest.net�datac���[RS:wagSSKnSnUS3nUR5upE[	URUS55 [	U5 [	SU-5 g)zKAssure user that loud errors generated by macOS libc's malloc are
expected.r�Nrz NOTICE z� may generate "malloc can't allocate region"
warnings on macOS systems. This behavior is known. Do not
report a bug unless tests are also failing.
See https://github.com/python/cpython/issues/85100r)r�r��shutil�get_terminal_sizer��center)�	test_namer�rp�detail�padding�_s      rh�darwin_malloc_err_warningr��sf���|�|�x����
�C���C�C�F�
�)�)�+�J�G�	�#�*�*�W�c�
"�#�	�&�M�	�#��-�rgc�f�[RRU5(aU$Ub[RRX5n[/[
R-nUHJn[RRX05n[RR
U5(dMHUs $ U$)aGTry to find a file on sys.path or in the test directory.  If it is not
found the argument passed to the function is returned (this does not
necessarily signal failure; could still be the legitimate path).

Setting *subdir* indicates a relative path to use to find the file
rather than looking directly in the path directories.
)r�r��isabsr�
TEST_HOME_DIRr��exists)�filename�subdirr��dn�fns     rhrBrB�s~��
�w�w�}�}�X�����
���7�7�<�<��1���?�S�X�X�%�D���
�W�W�\�\�"�
'��
�7�7�>�>�"���b�y���Orgc��[UR55nUVs/sHnSU-PM
 nnSRU5nSU-$s snf)z%Like repr(dict), but in sorted order.z%r: %rz, z{%s})�sorted�itemsr)�dictr��pair�	reprpairs�
withcommass     rhrHrH�sH���4�:�:�<� �E�-2�3�U�T��D��U�I�3����9�%�J��J����4s�A�code�returnc�J�0n[[R"U5U5 U$)zHRun a piece of code after dedenting it, and return its global namespace.)�exec�textwrap�dedent)r��nss  rh�run_coder��s��	�B������	��#�
�Irg)�lineno�offsetc��UR[U5n[USS5 SSS5 WRnUR	UR
5 UbUR
UR
U5 UR	UR5 UbUR
URU5 gg!,(df   N�=f)Nz
<test string>r�)�assertRaisesRegex�SyntaxError�compile�	exception�assertIsNotNoner��assertEqualr�)�testcase�	statement�errtextr�r��cmr�s       rhrr�s���	�	#�	#�K��	9�R��	�?�F�3�
:�
�,�,�C����S�Z�Z�(�
�����S�Z�Z��0����S�Z�Z�(�
�����S�Z�Z��0��
:�	9�s�B/�/
B=c�R^^^
�SSKnSSKnSSKJn SSKnTR
SS5m
URRU5SRS5Sn[RR[U5nUU
U4Sjn[RRU5(aU"U5n	U	bU	$U"U5 [S	5 [ (a[#S
U-[%5S9 UR&R)5n
U(aU
R*R-S5 U
R/U[0S
9n	U(a.U	R2R5S5S:XaUR7U	S9n	[/US5nU	R95nU(a*UR;U5 U	R95nU(aM*SSS5 U	R=5 U"U5n	U	bU	$[?SU-5e![
a SnGN�f=f!,(df   NL=f!U	R=5 f=f)Nrr�)�unlinkr�r��/���c�>�[U/TQ70TD6nTcU$T"U5(aURS5 U$UR5 gr\)�open�seek�close)r�r�rtr�r"s  ���rh�check_valid_file�*open_urlresource.<locals>.check_valid_file�sC�����!�d�!�b�!���=��H�
�1�X�X�
�F�F�1�I��H�	���	rgrz	fetching %s ...��file)zAccept-Encodingrc��timeoutzContent-Encodingrc)�fileobj�wbzinvalid resource %r) �urllib.request�urllib.parse�	os_helperr�rcr^�pop�parse�urlparserr�r�r�
TEST_DATA_DIRr�rrr�r
�request�build_opener�
addheaders�appendr�rQ�headersr��GzipFile�read�writer�r	)�urlrtr"�urllibr�rcr�r�r�r��opener�out�sr�s ``          @rhr>r>�s����'�!���
�F�F�7�D�!�E��|�|�$�$�S�)�!�,�2�2�3�7��;�H�	�����m�X�	.�B��
�w�w�~�~�b����R� ���=��H��r�
�
�Z���w�
�!�C�'�.A�.C�D�
�^�^�
(�
(�
*�F����� � �!<�=����C�!1��2�A���	�	�
�
�0�1�V�;��M�M�!�M�$���
�"�d�^�s�����A���	�	�!���F�F�H���!��	
���	����A��}���
�*�R�/�
0�0��_������H�^��	
���	�s6�G0�/H�;AH�=H�0H�?H�
H�
H�H&c#��# �SSKn[[U5n[[XR	55 [[U5v� [[X5 g![[X5 f=f7f)z�Return a context manager used by captured_stdout/stdin/stderr
that temporarily replaces the sys stream *stream_name* with a StringIO.rN)�ior�r��setattr�StringIO)�stream_namer��orig_stdouts   rhrr"sL�����#�{�+�K��C��k�k�m�,�/��c�;�'�'���[�.����[�.�s�3A.�A�A.�A+�+A.c��[S5$)z�Capture the output of sys.stdout:

with captured_stdout() as stdout:
    print("hello")
self.assertEqual(stdout.getvalue(), "hello\n")
r��rr_rgrhrr.����8�$�$rgc��[S5$)z�Capture the output of sys.stderr:

with captured_stderr() as stderr:
    print("hello", file=sys.stderr)
self.assertEqual(stderr.getvalue(), "hello\n")
�stderrr�r_rgrhrr7r�rgc��[S5$)z�Capture the input to sys.stdin:

with captured_stdin() as stdin:
    stdin.write('hello\n')
    stdin.seek(0)
    # call test code that consumes from sys.stdin
    captured = input()
self.assertEqual(captured, "hello")
�stdinr�r_rgrhrr@s���7�#�#rgc�l�SSKnUR5 UR5 UR5 g)a�Force as many objects as possible to be collected.

In non-CPython implementations of Python, this is needed because timely
deallocation is not guaranteed by the garbage collector.  (Even in CPython
this can be the case in case of reference cycles.)  This means that __del__
methods may be called later than expected and weakrefs may remain alive for
longer than expected.  This function tries its best to force all garbage
objects to disappear.
rN)�gc�collect)r�s rh�
gc_collectr�Ms"����J�J�L��J�J�L��J�J�Lrgc#��# �SSKnUR5nUR5 Sv� U(aUR5 gg!U(aUR5 ff=f7fr\)r��	isenabled�disable�enable)r��have_gcs  rh�
disable_gcr�\sF���
��l�l�n�G��J�J�L��
���I�I�K���7��I�I�K��s�%A"�A�A"�A�A"c'�# �SSKnUR5nUR"U6 Sv� UR"U6 g!UR"U6 f=f7fr\)r��
get_threshold�
set_threshold)rtr��
old_thresholds   rh�gc_thresholdr�gsH���
��$�$�&�M����d��)�
�
���-�(�����-�(�s�$A�;�A�A�Ac���[R"S5=(d SnSnUR5HnURS5(dMUnM [R"S5S:XaSnX;$SnX;$)z,Find if Python was built with optimizations.�	PY_CFLAGSr=z-O�CC�gcc)r=�-O0z-Og)r=r�)r?r@rr�)rA�	final_opt�opt�non_optss    rh�python_is_optimizedrqsu��
�
%�
%�k�
2�
8�b�F��I��|�|�~���>�>�$����I������%��.�%���$�$����$�$rgc��^�[R"S5=(d Sm/SQn[R"S5nU(aURU5 [U4SjU55$)N�PY_CFLAGS_NODISTr=)z
-fprofile-usez-fprofile-instr-usez	-prof-use�PGO_PROF_USE_FLAGc3�,># �UH	oT;v� M g7fror_)�.0rO�
cflags_nodists  �rh�	<genexpr>�#check_cflags_pgo.<locals>.<genexpr>�s����A�[�6��&�[�s�)r?r@r��any)�pgo_optionsrrs  @rh�check_cflags_pgorsY����,�,�-?�@�F�B�M��K�"�0�0�1D�E������,�-��A�[�A�A�Argc�b�[(ag[R"S5=(d SnSU;$)NFr>r=z
--enable-bolt)r8r?r@)rBs rh�check_bolt_optimizedr
�s,���w���*�*�=�9�?�R�K��k�)�)rg�Py_GIL_DISABLEDc�8�[R"[U5$)z8Decorator for skipping tests on the free-threaded build.)r�rrrxs rhrr�s���?�?�?�C�0�0rgc�>�[(a[R$S$)z+Expect test failure if the GIL is disabled.c��U$ror_)�	test_cases rhr��2expected_failure_if_gil_disabled.<locals>.<lambda>�s��Yrg)rr�r�r_rgrh� expected_failure_if_gil_disabledr�s�����'�'�'�&�&rg�PHBBInP�nP�0n�nc�H�SSKnUR[U-[-5$r\)�struct�calcsize�_header�_align��fmtrs  rh�calcobjsizer �s����?�?�7�S�=�6�1�2�2rgc�H�SSKnUR[U-[-5$r\)rr�_vheaderrrs  rh�calcvobjsizer#�s����?�?�8�c�>�F�2�3�3rgi@ic��SSKn[R
"U5n[
U5[:XaUR[-(d4[
U5[:wa/[
U5R[-(aX#R-
nS[
U5XB4-nURXBU5 g![a [R"S5ef=f)Nrriz&wrong size for %s: got %d, expected %d)rkr^r�r�r��	getsizeofr��	__flags__�_TPFLAGS_HEAPTYPE�_TPFLAGS_HAVE_GC�SIZEOF_PYGC_HEADr�)�test�o�sizerkr�rps      rh�check_sizeofr-�s���>� ��]�]�1�
�F�	
�a��D��q�{�{�->�>�
�q�'�T�/��Q�� 1� 1�4D� D��2�2�2��
2��A�w��%�&�C����V�3�'���>���� <�=�=�>�s�B,�,!C
)�_do_cleanupsc��^^^^�Sm[T[5(a1TRSS5R5m[	T5S:XaSm[T5mUUUU4SjnU$)z5Run multiple subtests with different parameters.
    F�,� r�Tc�>^�[T[5(a[S5e[R"T5UUUUU4Sj5nU$)Nz1subTests() can only decorate methods, not classesc�>�THdnT	(aU4n[[TU55nUR"S0UD6 T"U/UQ70UDUD6 SSS5 T(dMTUR5 Mf g!,(df   N,=f)Nr_)r��zip�subTest�
doCleanups)
rsrtrT�values�subtest_kwargsr.�	arg_names�
arg_valuesr��single_params
     �����rhr#�,subTests.<locals>.decorator.<locals>.wrapper�sk���$���$�Y�F�!%�c�)�V�&<�!=���\�\�3�N�3���A��A��A�.�A�4��<��O�O�%�%�4�3�s�A-�-
A;	)�
isinstancer��	TypeErrorr%r&)r�r#r.r9r:r;s` ����rhr'�subTests.<locals>.decorator�sC����d�D�!�!��O�P�P�	����	�	&�	&�
�	&��rg)r=r��replacerr�r)r9r:r.r'r;s``` @rh�subTestsrA�s_����L��)�S�!�!��%�%�c�#�.�4�4�6�	��y�>�Q���L��z�"�J�
�
��rgc'�# �SSKn[X 5nURU5nUHnURX55  O" SU;a[R
"SU35eSv� U(aU(aURWU5 ggg!URa Mtf=f![a e[a" S=p$SU;a[R
"S5eNtf=f!U(aU(aURWU5 fff=f7f)Nrr=zno locales z
no locales)�localer��	setlocalerr�r�r�r�)�catstr�localesrC�category�orig_locale�locs      rhr@r@�s���A���6�*���&�&�x�0���C�
�� � ��/����� ��'�'�+�g�Y�(?�@�@�!�4�
��k����X�{�3�"�6���<�<�
��
����
��2�#�#��
�W���#�#�L�1�1��2��&�k����X�{�3�"�6�sa�C>� B�C>�B�$C>� C�$#C>�B�C>�B�C>�3C�C>�C�C>�$C;�;C>c�^^�UU4SjnU$)Nc�L>^�[R"T5UUU4Sj5nU$)Nc�N>�ST
;nSSKn[UT5nURU5nT
H;nURUS9 URXW5 SnT	"U/UQ70UD6 SSS5 M= URXV5 U(a%URSS9 T	"U/UQ70UD6 SSS5 gg!URa URSU<35 Nqf=f!,(df   M�=f!URXV5 f=f![a e[a N�f=f!,(df   g=f)Nr=r)rCFz
no locale )rCr�rDr5r�skipTestr�r�)rsrtrT�dry_runrCrGrHrIrEr�rFs        ���rhr#�/run_with_locales.<locals>.deco.<locals>.wrapper	s.����G�m�G�
<��"�6�6�2��$�.�.�x�8��<�&��!�\�\��\�5�<� &� 0� 0�� ?�+0�� $�T� ;�D� ;�F� ;�6�5� '��$�$�X�;���\�\��\�.���/��/��/�/�.���$*�<�<�D� $�
�
�
�3�'�.B� C�D��6�5���$�$�X�;��%"�
���
��
��&/�.�sc�!C<�C&�C�B)�C�C&�
D�)%C�C�C�C�
C#	�C&�&C9�<D�D�
D$rW)r�r#rErFs` ��rh�deco�run_with_locales.<locals>.decos%���	����	�	0�
�	0�<�rgr_)rErFrPs`` rh�run_with_localesrRs��� �B�Krgc�^�U4SjnU$)Nc�\>^�UU4SjnTRUlTRUlU$)Nc�>�[RnS[
R;a[
RSnOSnT[
RS'U"5 T"U0UD6Uc[
RS	OU[
RS'[R"5 $![a [R"S5ef=f!Uc[
RS	OU[
RS'[R"5 f=f)Nztzset required�TZ)�time�tzsetr�r�r�r��environ)rt�kwdsrX�orig_tzr��tzs    ��rh�inner�-run_with_tz.<locals>.decorator.<locals>.inner1s����
:��
�
���r�z�z�!��*�*�T�*����!�B�J�J�t���G�
��T�*�T�*��?��
�
�4�(�'.�B�J�J�t�$��
�
���#"�
:��'�'�(8�9�9�
:���?��
�
�4�(�'.�B�J�J�t�$��
�
��s�B�C�!B>�?D)rare)r�r]r\s` �rhr'�run_with_tz.<locals>.decorator0s%���	�,���������
��rgr_)r\r's` rhrIrI/s����4�rgi�r���limitc�J�S[[S[-S.n[R"SU[R[R
-5nUc[
SU<35e[[URS55XRS5R5-5$)Nr`)�k�m�g�tz(\d+(?:\.\d+)?) (K|M|G|T)b?$zInvalid memory limit: r�r�)�_1M�_1G�re�match�
IGNORECASE�VERBOSErr
�float�groupr/)rb�sizesres   rh�_parse_memlimitrqYs���
�
�
�
�#�X�	
�E�	���0�%�������+�	-�A��y��1�%��;�<�<��u�Q�W�W�Q�Z� �5�����)9�)9�);�#<�<�=�=rgc�|�[U5nU[S-
:a[SU<S35eUq[	U[
5nUqg)Nr�z
Memory limit z too low to be useful)rq�_2Gr�real_max_memuse�min�MAX_Py_ssize_tr)rb�memlimits  rhrFrFfsE���u�%�H��#��'���=��	�1F�G�H�H��O��8�^�,�H��Jrgc�*�\rSrSrSrSrSrSrSrg)�_MemoryWatchdogirzXAn object which periodically watches the process' memory consumption
and prints it out.
c�`�SR[R"5S9UlSUlg)Nz/proc/{pid}/statm)�pidF)r�r��getpid�procfile�startedrys rhrr�_MemoryWatchdog.__init__ws$��+�2�2�r�y�y�{�2�C��
���rgc��SSKn[URS5nSSKnU [S5nUR[RU/UURS9UlSSS5 SUlg![aPn[R
"[5RSX3S9 [RR5 SnAgSnAff=f!,(df   Ns=f)Nr�rz!/proc not available for stats: %sr+zmemory_watchdog.py)r�r�T)�warningsr�r}r�r1r2rar3r�r��flushr�rB�Popen�
executable�DEVNULL�mem_watchdogr~)rsr�r�r�r��watchdog_scripts      rh�start�_MemoryWatchdog.start{s����	��T�]�]�C�(�A�	�
�&�';�<�O� *� 0� 0�#�.�.�/�1R�78�8B�8J�8J�!1�!L�D���
�����	����h�'�/�/�0S�UV�/�c��J�J������	���Q�s#�A.�<C�.
C�8AC�C�
Cc��UR(a5URR5 URR5 ggro)r~r��	terminate�waitrys rh�stop�_MemoryWatchdog.stop�s2���<�<����'�'�)����"�"�$�rg)r�r}r~N)	rarbrcrdrerrr�r�rfr_rgrhryryrs�����"%rgryc�^^^�UUU4SjnU$)aPDecorator for bigmem tests.

'size' is a requested size for the test (in arbitrary, test-interpreted
units.) 'memuse' is the number of bytes per unit for the test, or a good
estimate of it. For example, a test that needs two byte buffers, of 4 GiB
each, could be decorated with @bigmemtest(size=_4G, memuse=2).

The 'size' argument is normally passed to the decorated test method as an
extra argument. If 'dry_run' is true, the value passed to the test method
may be less than the requested value. If 'dry_run' is false, it means the
test doesn't support dummy runs when -M is not specified.
c�8>^^�UUU4SjmTTlTTlT$)Nc�>�TRnTRn[(dSnOUn[(dT(d*[X2-:a[R"SX-S--5e[(aM[
(aB[
5 [
SRX-S-S95 [5nUR5 OSnT"X5U(aUR5 $$!U(aUR5 ff=f)Ni�'not enough memory: %.1fG minimum needed�@z* ... expected peak memory use: {peak:.1f}G)�peak)r,�memusertr�r�rr�r�ryr�r�)rsr,r��maxsize�watchdogrNr�r#s     ���rhr#�.bigmemtest.<locals>.decorator.<locals>.wrapper�s�����<�<�D��^�^�F�"�?����� ���#�g�&6�6��'�'�=��}�	�2�4�5�5���7�7����B��v�4�=�I�#>�v�?�A�*�,����� ���
$���'���M�M�O���8��M�M�O��s�C!�!C;)r,r�)r�r#rNr�r,s`@���rhr'�bigmemtest.<locals>.decorator�s���	$�:�������rgr_)r,r�rNr's``` rhrr�s��� �B�rgc�^�U4SjnU$)z0Decorator for tests that fill the address space.c��>�[[:aJ[S:�a [S:�a[R"S5e[R"S[S--5eT"U5$)Nl����lz-not enough memory: try a 32-bit build insteadr�r�)rrvr�r�)rsr�s �rhr#�!bigaddrspacetest.<locals>.wrapper�sb�����&���*�z�U�/B��'�'�C�E�E��'�'�=�%��3�5�6�6��T�7�Nrgr_)r�r#s` rhrr�s���
��Nrgc��U$ror_)r�s rh�_idr��s���Jrgc���US:Xa3[5(d$[R"[R5$[	U5(a[
$[R"SR
U55$)Nrzresource {0!r} is not enabled)r�r�rr�rr�r�r�s rhrr�sT���5��!2�!4�!4��}�}�.�5�5�6�6��8�$�$��
��}�}�<�C�C�H�M�N�Nrgc� �[SS9"U5$)z1
Decorator for tests only applicable on CPython.
T)�cpython)�impl_detail�r*s rhr r �s���t�$�T�*�*rgc��[S0UD6(a[$UcR[U5up#U(aSnOSn[UR	55nURSR
U55n[R"U5$)Nz*implementation detail not available on {0}z%implementation detail specific to {0}z or r_)	r:r��
_parse_guardsr��keysr�rr�r)rp�guards�
guardnames�defaults    rhr�r��sh���"�6�"��
�
�{�+�F�3��
��>�C�9�C��J�O�O�-�.�
��j�j����Z�0�1���=�=���rgc�d�U(dSS0S4$[UR55SnX(+4$)Nr�TFr)�listr7)r��is_trues  rhr�r��s5����D�!�5�)�)��6�=�=�?�#�A�&�G��K� � rgc�p�[U5upUR[RRU5$)aThis function returns True or False depending on the host platform.
Examples:
   if check_impl_detail():               # only on CPython (default)
   if check_impl_detail(jython=True):    # only on Jython
   if check_impl_detail(cpython=False):  # everywhere except on CPython
)r�r�r��implementationr�)r�r�s  rhr:r:�s-��$�F�+�O�F��:�:�c�(�(�-�-�w�7�7rgc�^^^�Tm[[S5(a[R"T5U4Sj5mTnS[R;a:[R
Rm[R"T5UU4Sj5nU$)zEDecorator to temporarily turn off tracing for the duration of a test.�gettracec��>�[R"5n[R"S5 T"U0UD6[R"U5 $![R"U5 f=fro)r�r��settrace)rtrT�original_tracer�s   �rh�
trace_wrapper�!no_tracing.<locals>.trace_wrappersE��� �\�\�^�N�
-����T�"��T�,�V�,����^�,�����^�,�s�A�A$ztest.covc�>�[RRT5n[RRTS5 T"U0UD6[RRTU5 $![RRTU5 f=fr\)r��
monitoring�
get_events�
set_events)rtrT�original_events�covr�s   ��rh�coverage_wrapper�$no_tracing.<locals>.coverage_wrappersg���!�n�n�7�7��<�O�
@����)�)�#�q�1�$�d�5�f�5����)�)�#��?�����)�)�#��?�s�'A*�*"B)r�r�r%r&�modulesr��COVERAGE_ID)r�r�r�r�s` @@rh�
no_tracingr�sx����M��s�J���	����	�	-�
�	-�%���S�[�[� ��n�n�(�(��	����	�	@�
�	@��rgc�*�[[U55$)z�Decorator for tests which involve reference counting.

To start, the decorator does not run the test if is not run by CPython.
After that, any trace function is unset during the test to prevent
unexpected refcounts caused by the trace function.

)r�r r�s rh�
refcount_testr�#s���l�4�(�)�)rgc�p�SSKnSSKnU$![a [R"S5"U5s$f=f)Nrz,needs _testcapi and _testlimitedcapi modules)�	_testcapi�_testlimitedcapir^r�r)r*r�r�s   rhr2r2.s=��S����K���S��}�}�K�L�T�R�R�S�s��&5�5�TEST_MODULES�yesc�X�[R"[RS5"U5$)Nzrequires specialization)r�r_�_opcode�ENABLE_SPECIALIZATIONr�s rhr3r3;s,������%�%�'@�B�BF�H�Hrgc��g)z,Just used to check if docstrings are enabledNr_r_rgrh�_check_docstringsr�Fs�rg�WITH_DOC_STRINGSztest requires docstringsc���[Rb[RR5 [Rb[RR5 ggro)r�r�r�r�r_rgrh�flush_std_streamsr�Ws;��
�z�z���
�
����
�z�z���
�
����rgc��[5 [RnUR5Hn[	SU3US9 M UR5 g)NzWarning -- r�)r��
print_warning�orig_stderr�
splitlinesr�r�)rp�stream�lines   rhr�r�^s>����
�
&�
&�F���� ��
��D�6�"��0�!�
�L�L�Nrgc��[[S5(a[[S5(dg[(dg[R"S[R5upUS:Xag[
SU35 SqMA![
a gf=f)z�Use this function at the end of test_main() whenever sub-processes
are started.  This will help ensure that no extra children (zombies)
stick around to hog resources and create problems when looking
for refleaks.
�waitpid�WNOHANGNTr�rz%reap_children() reaped child process )r�r�r&r�r�r�r��environment_altered)r{�statuss  rhr?r?ss���
�B�	�"�"�w�r�9�'=�'=��
#�
#���	��*�*�R����4�K�C��!�8���=�c�U�C�D�"�����	��	�s�'A:�:
B�Bc#�<# �[X5(a)[X5n[XU5 Uv� [XU5 g[XU5 Sv� [X5(a[X5 gg![XU5 f=f![X5(a[X5 ff=f7f)a�Temporary swap out an attribute with a new object.

Usage:
    with swap_attr(obj, "attr", 5):
        ...

    This will set obj.attr to 5 for the duration of the with: block,
    restoring the old value at the end of the block. If `attr` doesn't
    exist on `obj`, it will be created and then deleted at the end of the
    block.

    The old value (or None if it doesn't exist) will be assigned to the
    target of the "as" clause, if there is one.
N)r�r�r��delattr)r��attr�new_val�real_vals    rhrDrD�s���� �s����3�%����7�#�	)��N��C�x�(���7�#�	#���s�!�!���"�"��

�C�x�(���s�!�!���"�"�s3�(B�A*�B�	A;�
B�*A8�8B�;B�Bc#�# �X;aXnX U'Uv� X0U'gX U'Sv� X;aX	gg!X0U'f=f!X;aX	ff=f7f)a�Temporary swap out an item with a new object.

Usage:
    with swap_item(obj, "item", 5):
        ...

    This will set obj["item"] to 5 for the duration of the with: block,
    restoring the old value at the end of the block. If `item` doesn't
    exist on `obj`, it will be created and then deleted at the end of the
    block.

    The old value (or None if it doesn't exist) will be assigned to the
    target of the "as" clause, if there is one.
Nr_)r��itemr�r�s    rhrArA�se��� �{��9���D�	�	!��N� ��I��D�	�	���{��I���
!��I���{��I��s)�A�,�	A�5�	A�2�A�
?�Ac�*�SSKnUR5$)zjReturn a list of command-line arguments reproducing the current
settings in sys.flags and sys.warnoptions.rN)r��_args_from_interpreter_flags�r�s rh�args_from_interpreter_flagsr��s����2�2�4�4rgc�*�SSKnUR5$)zcReturn a list of command-line arguments reproducing the current
optimization settings in sys.flags.rN)r��"_optim_args_from_interpreter_flagsr�s rh�!optim_args_from_interpreter_flagsr��s����8�8�:�:rgc�$�\rSrSrSrSrSrSrg)rEi�)rp�messagec�~�SnUH4nX$nURU5nURXFU5(aM1Sn U$ U$)a
Try to match a single dict with the supplied arguments.

Keys whose values are strings and which are in self._partial_matches
will be checked for partial (i.e. substring) matches. You can extend
this scheme to (for example) do regular expression matching, etc.
TF)r��match_value)rs�drTr�rd�v�dvs       rh�matches�Matcher.matches�sN�����A��	�A����q��B��#�#�A�1�-�-�����
�
��
rgc��[U5[U5:waSnU$[U5[LdXR;aX2:HnU$URU5S:�nU$)zD
Try to match a single stored value (dv) with a supplied value (v).
Fr)r�r��_partial_matches�find)rsrdr�r�r�s     rhr��Matcher.match_value�s_����7�d�2�h���F�
�
�	�"�X�S�
 �A�-B�-B�$B��g�F��
��W�W�Q�Z�1�_�F��
rgr_N)rarbrcrdr�r�r�rfr_rgrhrErE�s��)���"
rgrEc�
�SSKn[cP[RS:Xa:UR	5S:Xa&[
R"5RS:XaSqOSq[(a[R"S5"U5$U$)	a
Skip decorator for tests that use buggy strptime/strftime

If the UCRT bugs are present time.localtime().tm_zone will be
an empty string, otherwise we assume the UCRT bugs are fixed

See bpo-37552 [Windows] strptime/strftime return invalid
results with UCRT version 17763.615
rNr|�cp65001r=TFz!buggy MSVC UCRT strptime/strftime)
rC�_buggy_ucrtr�r��getencodingrW�	localtime�tm_zoner�r)r*rCs  rhr.r.�sh������<�<�7�"��"�"�$�	�1���� �(�(�B�.��K��K�GR�{�8�=�=�<�=�d�C�\�X\�\rgc�~�\rSrSrSrSSjr\RS:XaSrOSrSr	S	r
S
rSS.S
jrSS.Sjr
Srg)�
PythonSymlinkiz3Creates a symlink for the current Python executableNc��SSKJn U=(d [RR	U5Ul/Ul[RR[R5Ul
/UlSUlUR5 g)Nr�)�TESTFN)r�rr�r��abspath�link�_linked�realpathr�r��real�
_also_link�_env�_platform_specific)rsrrs   rhrr�PythonSymlink.__init__sY��%��3�B�G�G�O�O�F�3��	�����G�G�$�$�S�^�^�4��	������	����!rgr|c
��SSKnSSKn[RR	UR
5(aD[RR
UR
5(dURS5UlUR[R5n[RRU5n[RRUR5nURRU[RRU[RRU5545 UR[RRUR!U5S55H[nURRU[RRU[RRU5545 M] [R"Vs0sH'owR%5[R&"U5_M) snUl[RRUR
5UR(S'[*R,"5(a[.UR(S'ggs snf)Nrzvcruntime*.dll�
PYTHONHOME�
PYTHONPATH)�glob�_winapir�r��lexistsrr��GetModuleFileNamer��	dllhandle�dirnamerrr�r�basename�escaperY�upper�getenvrr?�is_python_buildr�)rsr
rr��src_dir�dest_dir�runtimerds        rhr� PythonSymlink._platform_specific#s������w�w���t�y�y�)�)�"�'�'�.�.����2K�2K�$�5�5�a�8��	��+�+�C�M�M�:�C��g�g�o�o�c�*�G��w�w���t�y�y�1�H��O�O�"�"�������X�r�w�w�'7�'7��'<�=�$�
� �9�9�R�W�W�\�\�$�+�+�g�2F�HX�%Y�Z�����&�&���G�G�L�L��2�7�7�+;�+;�G�+D�E�(��[�;=�*�*�E�*�Q����B�I�I�a�L�0�*�E�D�I�&(�g�g�o�o�d�i�i�&@�D�I�I�l�#��(�(�*�*�*4��	�	�,�'�+��Fs�).Jc��gror_rys rhrr>���rgc�2�[R"URUR5 URRUR5 URH6up[R"X5 URRU5 M8 U$ro)r��symlinkrrrr�r)rsrrs   rh�	__enter__�PythonSymlink.__enter__Asc��
�
�
�4�9�9�d�i�i�(������D�I�I�&��/�/�J�D��J�J�t�"��L�L����%�*��rgc���URHn[R"U5 M g![a6n[(a [SR
XE55 SnAMTSnAMZSnAff=f)Nzfailed to clean up {}: {})rr��remove�IOErrorrr�r�)rs�exc_type�	exc_value�exc_tbr�exs      rh�__exit__�PythonSymlink.__exit__IsV���L�L�D�
H��	�	�$��!���
H��7��5�<�<�T�F�G�G���
H�s�,�
A,�%A'�'A,c�v�SSKnU/UQnURXeRURUS9nUR5nURU:waj[
(a;[
[US55 [
[US5[RS9 [SRUR55eU$)Nr)r�r�rNr�r�z'unexpected return code: {0} (0x{0:08X}))r�r��PIPE�communicate�
returncoderr��reprr�r��RuntimeErrorr�)	rs�pythonrtrNr.r��cmd�pr�s	         rh�_call�PythonSymlink._callQs�����o��o�����S���$.�O�O��
�
>��
�M�M�O���<�<�:�%��w��d�1�Q�4�j�!��d�1�Q�4�j�s�z�z�2��9�@�@����N�P�
P��rgr)r.c�>�URURUSU5$ro)r4r�rsr.rts   rh�	call_real�PythonSymlink.call_real_s���z�z�$�)�)�T�4��<�<rgc�P�URURX RU5$ro)r4rrr7s   rh�	call_link�PythonSymlink.call_linkbs���z�z�$�)�)�T�9�9�j�A�Arg)rrrrrro)rarbrcrdrerrr�r�rr r)r4r8r;rfr_rgrhr�r�sM��=�
"��|�|�w��	5�6	��H��+,�=�+,�B�Brgr�c��[(+=(d [nSnU(aU$[R"U5"U5$)z;Skip decorator for tests not run in (non-extended) PGO taskz#Not run for (non-extended) PGO task)rJ�PGO_EXTENDEDr�r)r*�okrps   rh�skip_if_pgo_taskr@fs.��
��	 �L�B�
/�C��4�3�8�=�=��-�d�3�3rgr_)�ignorec��[[U55[[U55-
nU(aU[U5-n[SU55nU$)z�Returns the set of items in ref_api not in other_api, except for a
defined list of items to be ignored in this check.

By default this skips private attributes beginning with '_' but
includes all magic methods, i.e. those starting and ending in '__'.
c3�# �UH5nURS5(aURS5(dM1Uv� M7 g7f)r��__N)r��endswith)rres  rhr�&detect_api_mismatch.<locals>.<genexpr>ws2���F�=�a� �|�|�C�0�0�A�J�J�t�4D���=�s�0?�	?)�set�dir)�ref_api�	other_apirA�
missing_itemss    rhr,r,msP����G��%��C�	�N�(;�;�M�
���V��$�
��F�=�F�F�M��rgc���UcUR4nO[U[5(aU4n[U5n[	U5H�nURS5(dXd;aM [
X5n[
USS5U;d4[US5(aMO[U[R5(aMpURU5 M� URURU5 g)a�Assert that the __all__ variable of 'module' contains all public names.

The module's public names (its API) are detected automatically based on
whether they match the public name convention and were defined in
'module'.

The 'name_of_module' argument can specify (as a string or tuple thereof)
what module(s) an API could be defined in order to be detected as a
public API. One case for this is when 'module' imports part of its public
API from other modules, possibly a C backend (like 'csv' and its '_csv').

The 'extra' argument can be a set of names that wouldn't otherwise be
automatically detected as "public", like objects without a proper
'__module__' attribute. If provided, it will be added to the
automatically detected ones.

The 'not_exported' argument can be a set of names that must not be treated
as part of the public API even though their names indicate otherwise.

Usage:
    import bar
    import foo
    import unittest
    from test import support

    class MiscTestCase(unittest.TestCase):
        def test__all__(self):
            support.check__all__(self, foo)

    class OtherTestCase(unittest.TestCase):
        def test__all__(self):
            extra = {'BAR_CONST', 'FOO_CONST'}
            not_exported = {'baz'}  # Undocumented name.
            # bar imports part of its API from _bar.
            support.check__all__(self, bar, ('bar', '_bar'),
                                 extra=extra, not_exported=not_exported)

Nr�rb)
rar=r�rGrHr�r�r��types�
ModuleType�add�assertCountEqual�__all__)rr��name_of_module�extra�not_exported�expectedr�r�s        rhr-r-|s���R�� �/�/�,��	�N�C�	(�	(�(�+���5�z�H��F����?�?�3���4�#7���f�#���C��t�,��>��S�,�/�/���U�%5�%5�6�6��L�L�������v�~�~�x�8rgc���SSKnURURUR-UR
-UR-5 [US5(a|URURUR4HTnU(a8URX!R5 URX!R5 MBURUS5 MV gg![a gf=f)Nr�CrtSetReportMode)�msvcrtr^�SetErrorMode�SEM_FAILCRITICALERRORS�SEM_NOALIGNMENTFAULTEXCEPT�SEM_NOGPFAULTERRORBOX�SEM_NOOPENFILEERRORBOXr��CRT_WARN�	CRT_ERROR�
CRT_ASSERTrW�CRTDBG_MODE_FILE�CrtSetReportFile�CRTDBG_FILE_STDERR)rrXres   rh�suppress_msvcrt_assertsrd�s���������5�5� �;�;�<� �6�6�7�!�7�7�8�9��v�)�*�*��/�/�6�#3�#3�V�5F�5F�G�A���'�'��+B�+B�C��'�'��+D�+D�E��'�'��1�-�H�+������s�C�
C#�"C#c�,�\rSrSrSrSrSrSrSrSr	g)rGi�z�Try to prevent a crash report from popping up.

On Windows, don't display the Windows Error Reporting dialog.  On UNIX,
disable the creation of coredump file.
Nc��[RRS5(a�SSKnUR5UlURURUR-5 [US5(ay0Ul
URURUR4HKnURUUR5nUR!UUR"5nX44URU'MM U$SSKnXPlUR$btUR$R'UR$R(5UlUR$R+UR$R(SURS45 [RS:XajSSKn/SQnUR3UUR4UR4S9nU UR75Sn	SSS5 W	R95S	:Xa[;S
SSS
9 U$![a gf=f![a SUlGN%f=f![,[.4a N�f=f!,(df   Nm=f)z�On Windows, disable Windows Error Reporting dialogs using
SetErrorMode() and CrtSetReportMode().

On UNIX, try to save the previous core file size limit, then set
soft limit to 0.
r�rNrWr�r�)z/usr/bin/defaultsr�zcom.apple.CrashReporter�
DialogType)r�r�s	developerz:this test triggers the Crash Reporter, that is intentionalr=T)�endr�)r�r�r�rXr^�GetErrorMode�	old_valuerYr\r��	old_modesr^r_r`rWrarbrcr��	getrlimit�RLIMIT_CORE�	setrlimitrr�r�r�r,r-r�r�)
rsrX�report_type�old_mode�old_filer�r�r2�procr�s
          rhr �SuppressCrashReport.__enter__�s���<�<�"�"�5�)�)�
��$�0�0�2�D�N��������1M�1M� M�N��v�1�2�2�!#���$*�O�O�$*�$4�$4�$*�$5�$5�$7�K� &�6�6�{�"�3�3� 5�H�%�6�6�{�"�5�5� 7�H�2:�2D�D�N�N�;�/�$7�T��A
%�� (�
��}�}�(��%)�]�]�%<�%<�T�]�]�=V�=V�%W�D�N��M�M�+�+�D�M�M�,E�,E�-.����q�0A�,B�D�
�|�|�x�'�!�@��!�'�'��/9���/9���(�@���!�-�-�/��2�F���<�<�>�\�1��0�57�t�E����k�
��
��0�
%� $��
�
%��#�G�,����� �T�sB�G?�4
H�A3H'�H=�?
H�H�H$�#H$�'H:�9H:�=
Ic��URcg[RRS5(azSSKnURUR5 UR(aIURR5H*unupEURX45 URX55 M, ggURb<URRURRUR5 gg![[4a gf=f)zARestore Windows ErrorMode or core file behavior to initial value.Nr�r)rjr�r�r�rXrYrkr�rWrbr�rnrmrr�)rs�
ignore_excrXrorprqs      rhr)�SuppressCrashReport.__exit__s����>�>�!���<�<�"�"�5�)�)��������/��~�~�9=���9M�9M�9O�5�K�!5�(��+�+�K�B��+�+�K�B�:P��
�}�}�(���M�M�+�+�D�M�M�,E�,E�t�~�~�V�)��#�G�,����s�;:C7�7D
�	D
)rkrjr�)
rarbrcrdrerjrkr r)rfr_rgrhrGrG�s���
�I��I�@�DrgrGc��^^^^�[TT5 SmTRTmSmUUUU4SjnUR	U5 [TTU5 g![[4a [TTS5mNGf=f)z�Override 'object_to_patch'.'attr_name' with 'new_value'.

Also, add a cleanup procedure to 'test_instance' to restore
'object_to_patch' value for 'attr_name'.
The 'attr_name' should be a valid attribute for 'object_to_patch'.

FTNc�H>�T(a[TTT5 g[TT5 gro)r�r�)�
attr_is_local�	attr_name�object_to_patchrjs����rh�cleanup�patch.<locals>.cleanupBs�����O�Y�	�:��O�Y�/rg)r��__dict__r�r0�
addCleanupr�)�
test_instancer{rz�	new_valuer|ryrjs ``  @@rh�patchr�,s~����O�Y�'��M��#�,�,�Y�7�	��
�0�0����W�%��O�Y�	�2��
�H�%�>��O�Y��=�	�>�s�A
�
A-�,A-c#�<# �USSnSv� XSS&g!WUSS&f=f7f)z-Like unittest.mock.patch.dict, but for lists.Nr_)�orig�saveds  rh�
patch_listr�Ns&�����Q���
��Q���%��Q��s��	���c��[5 SSKnURU5$![a [R"S5ef=f)�]
Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc
module is enabled.
rN�requires _testcapi)�_check_tracemallocr�r^r�r��run_in_subinterp)r�r�s  rhr�r�XsH��
��6���%�%�d�+�+���6���� 4�5�5�6�s	�!�!A)�own_gilc�l�[5 SSKnUbU(aSOSUS'OIUSnUS:XaSUS'O8US:XaSUS'O,US	:XaSUS'O [U[5(d[U5e[R"S
0UD6nURX5$![a [R"S5ef=f)r�rNzrequires _testinternalcapi�own�shared�gilr�r�r�r_)r�rkr^r�r�r=r��NotImplementedErrorrM�SimpleNamespace�run_in_subinterp_with_config)r�r�rmrkr�s     rhr�r�es���
��>� ���!(��h��u�
��U�m���!�8�%�F�5�M�
�A�X�$�F�5�M�
�A�X�!�F�5�M��C��%�%�%�c�*�*�
�
"�
"�
,�V�
,�F��9�9�$�G�G��!�>���� <�=�=�>�s�B�!B3c��SSKnUR5(a[R"S5eg![a gf=f)NrzUrun_in_subinterp() cannot be used if tracemalloc module is tracing memory allocations)�tracemalloc�
is_tracingr�r�r^)r�s rhr�r��sL��;���!�!�#�#��#�#�%:�;�
;�$���
��
�s�2�
?�?c�j^^^^^�SmUUUUU4SjnU"5 [5 TRT5 g)NFc�r>^�"UU4SjST5nT"U"T65mTR[[T5 g)Nc�$>�\rSrSrUU4SjrSrg)�6check_free_after_iterating.<locals>.wrapper.<locals>.Ai�c�B>�Sm[T5 g![a gf=f�NT)�next�
StopIteration)rs�done�its ��rh�__del__�>check_free_after_iterating.<locals>.wrapper.<locals>.A.__del__�s&��������H��$����s��
�r_N)rarbrcrdr�rf)r�r�s��rh�Ar��s
���
�
rgr�)�assertRaisesr�r�)r�r�rt�clsr��iterr*s @�����rhr#�+check_free_after_iterating.<locals>.wrapper�s5���	�	��	��!�T�(�^�����-��r�2rg)r��
assertTrue)r*r�r�rtr#r�s```` @rh�check_free_after_iteratingr��s*����D�3�3��I��L��O�O�D�rgc��SSKJnJn SSKJn SSKnUR
5nUR"U5 URS:XaUR5 URHInU(aX`;aM[XV5nU(aO	U(dM-URUS5bMDUSs $ g!URa gf=f)a(Check if the compiler components used to build the interpreter exist.

Check for the existence of the compiler executables whose names are listed
in 'cmd_names' or all the compiler executables when 'cmd_names' is empty
and return the first missing executable or None when none is found
missing.

r)�	ccompilerr?)r�N�msvc)�setuptools._distutilsr�r?�
setuptoolsr�r��new_compiler�customize_compiler�
compiler_type�
initialize�
PlatformError�executablesr��which)�	cmd_namesr�r?r�r��compilerr�r2s        rhrKrK�s���;�!���%�%�'�H�
� � ��*�����'�	����!��$�$����.���h�%������<�<��A���'��q�6�M�%���#�#�	��	�s�B0�0C�Cc���Sn[(aOX:aJ[c6SSKnUR5nUR=(a UR
S:q[(aUn[R"U5$)Ng-C��6?r�)r6�_old_android_emulatorr��android_ver�is_emulator�	api_levelr�r<)�interval�minimum_intervalr��avs    rhr<r<�s_�����z�h�1� �(���%�%�'�B�$&�N�N�$H�r�|�|�b�7H�!� � �'�H�� � ��*�*rgc���[R"S5nU$![[4a5 [R"S5nU$![[4a SnU$f=ff=f)zGet size of a page in bytes.�SC_PAGESIZE�SC_PAGE_SIZEi)r��sysconfrr�)�	page_sizes rhr=r=�so����J�J�}�-�	����
��'��	��
�
�>�2�I�����N�+�	��I���	���s&��A�A�A�A�A�Ac#�# �SSKn[RR5nUR	5nUR5 Sv� U(aUR
USS9 gg!U(aUR
USS9 ff=f7f)NrT)r��all_threads)�faulthandlerr��
__stderr__�fileno�
is_enabledr�r�)r��fdr�s   rh�disable_faulthandlerr��st����


���	�	�	 �B��(�(�*�J�;�����
�����R�T��:���:����R�T��:��s�3B�A#�
B�#A=�=Bc�*�\rSrSrSrSrSrSrSrg)�SaveSignalsi�z�
Save and restore signal handlers.

This class is only able to save/restore signal handlers registered
by the Python signal module: see bpo-13285 for "external" signal
handlers.
c���SSKnXlUR5UlSH*n[X5nURRU5 M, 0Ulg![a MCf=f)Nr)�SIGKILL�SIGSTOP)�signal�
valid_signals�signalsr�r�r#�handlers)rsr��signame�signums    rhrr�SaveSignals.__init__�sd������+�+�-���-�G�
� ��1��
�L�L����'�.���
��"�
��
�s�A�
A&�%A&c��URH1nURRU5nUcM#X RU'M3 gro)r�r��	getsignalr��rsr��handlers   rh�save�SaveSignals.save
s:���l�l�F��k�k�+�+�F�3�G����$+�M�M�&�!�#rgc��URR5H upURRX5 M" gro)r�r�r�r�s   rh�restore�SaveSignals.restores-��#�}�}�2�2�4�O�F��K�K���v�/� 5rg)r�r�r�N)	rarbrcrdrerrr�r�rfr_rgrhr�r��s����
,�0rgr�c��SSKnUR=(a [
(+$![a [R"S5ef=f�Nrr�)r�r^r�r��
WITH_PYMALLOCr�r�s rh�
with_pymallocr�sC��6���"�"�:�?�':�:���6���� 4�5�5�6�s	�$�!Ac�l�SSKnUR$![a [R"S5ef=fr�)r�r^r�r��
WITH_MIMALLOCr�s rh�
with_mimallocr�#s;��6���"�"�"���6���� 4�5�5�6�s��!3c�$�\rSrSrSrSrSrSrg)�
_ALWAYS_EQi+z#
Object that is equal to anything.
c��gr�r_�rs�others  rh�__eq__�_ALWAYS_EQ.__eq__/���rgc��g�NFr_r�s  rh�__ne__�_ALWAYS_EQ.__ne__1���rgr_N)rarbrcrdrer�r�rfr_rgrhr�r�+s����rgr�c�*�\rSrSrSrSrSrSrSrg)�	_NEVER_EQi6z'
Object that is not equal to anything.
c��gr�r_r�s  rhr��_NEVER_EQ.__eq__:r�rgc��gr�r_r�s  rhr��_NEVER_EQ.__ne__<r�rgc��g)Nr�r_rys rh�__hash__�_NEVER_EQ.__hash__>s��rgr_N)	rarbrcrdrer�r�r�rfr_rgrhr�r�6s�����rgr�c�$�\rSrSrSrSrSrSrg)�_LARGESTiCz7
Object that is greater than anything (except itself).
c�"�[U[5$ro)r=rr�s  rhr��_LARGEST.__eq__Hs���%��*�*rgc��gr�r_r�s  rh�__lt__�_LARGEST.__lt__Jr�rgr_N)rarbrcrdrer�rrfr_rgrhrrCs���+�rgrc�$�\rSrSrSrSrSrSrg)�	_SMALLESTiOz4
Object that is less than anything (except itself).
c�"�[U[5$ro)r=r	r�s  rhr��_SMALLEST.__eq__Ts���%��+�+rgc��gr�r_r�s  rh�__gt__�_SMALLEST.__gt__Vr�rgr_N)rarbrcrdrer�r
rfr_rgrhr	r	Os���,�rgr	c�6�SSKnURR$)zDReturn the global event loop policy if one is set, else return None.rN)�asyncio.events�events�_event_loop_policy)�asyncios rh�maybe_get_event_loop_policyr[s����>�>�,�,�,rgc�|�Xp2SSKnUR5nUR5S-n[US5UlURU5nUS-
U-U-nX(-n	X)-
n
X:-
nXwS-
-US-
U-U--U	SU	-
--n[
U5[
UR554sSSS5 $!,(df   g=f)Nrr��r�)�decimal�localcontext�
bit_length�max�prec�Decimalrn�sqrt)
�nbins�nballsrrdr�ctx�bitsr��p1empty�	meanempty�occupied�
collisions�vars
             rh�collision_statsr'hs����q�$�	�	�	�	�3��|�|�~��!���t�R�=���
�_�_�Q�
����F�b�=�Q�&���K�	��=���\�
��Q�$�i�"�Q�$���Q��&��a�)�m�)D�D���Z� �%����
�"3�3�
 �	�	�s�BB-�-
B;c�0�\rSrSrSrSrSrSrSrSr	g)	�catch_unraisable_exceptioni�a�
Context manager catching unraisable exception using sys.unraisablehook.

Storing the exception value (cm.unraisable.exc_value) creates a reference
cycle. The reference cycle is broken explicitly when the context manager
exits.

Storing the object (cm.unraisable.object) can resurrect it if it is set to
an object which is being finalized. Exiting the context manager clears the
stored object.

Usage:

    with support.catch_unraisable_exception() as cm:
        # code creating an "unraisable exception"
        ...

        # check the unraisable exception: use cm.unraisable
        ...

    # cm.unraisable attribute no longer exists at this point
    # (to break a reference cycle)
c� �SUlSUlgro)�
unraisable�	_old_hookrys rhrr�#catch_unraisable_exception.__init__�s�������rgc��Xlgro)r+)rsr+s  rh�_hook� catch_unraisable_exception._hook�s	��%�rgc�Z�[RUlUR[lU$ro)r��unraisablehookr,r/rys rhr �$catch_unraisable_exception.__enter__�s ���+�+���!�Z�Z����rgc�2�UR[lU?gro)r,r�r2r+)rsr,s  rhr)�#catch_unraisable_exception.__exit__�s��!�^�^����Org)r,r+N)
rarbrcrdrerrr/r r)rfr_rgrhr)r)�s���0�%�
�
rgr)r�c	��[RS:wa�SSKnUc[n[R
"5n[
USS9H2n[R"U[R5upgUS:wdM2 O~ [R"XR5 [R"US5 [R
"5U-
n[SUSUSS	35e[R"US5upg[R"U5n	X�:wa[SUS
U	SUS35eX`:wa[S
USU35eg![a N�f=f)al
Wait until process pid completes and check that the process exit code is
exitcode.

Raise an AssertionError if the process exit code is not equal to exitcode.

If the process runs longer than timeout seconds (LONG_TIMEOUT by default),
kill the process (if signal.SIGKILL is available) and raise an
AssertionError. The timeout feature is not available on Windows.
�ntrNF��errorzprocess z is still running after �.1fz secondsz exited with code z, but exit code z is expectedzpid z != pid )r�r�r�rSrW�	monotonic�sleeping_retryr�r��killr�r��AssertionError�waitstatus_to_exitcode)
r{�exitcoder�r��
start_timer��pid2r��dt�	exitcode2s
          rh�wait_processrE�sF��
�w�w�$����?�"�G��^�^�%�
���u�5�A��:�:�c�2�:�:�6�L�D��q�y��6�
�����^�^�,��
�
�3��"�
���!�J�.�B� �8�C�5�1*�*,�S���";�<�
<��z�z�#�q�)����)�)�&�1�I����x��u�,>�y�k�J.�.6�Z�|�E�F�	F��{��t�D�6��#��7�8�8���#�
��
�s�87D:�:
E�Ec���SSKJn U"S5 U"S5n[RS:XaUR	SS9 gg![
an[R"SU<35eSnAff=f)	z�
Skip tests if the multiprocessing.synchronize module is missing, if there
is no available semaphore implementation, or if creating a lock raises an
OSError (on Linux only).
r�ru�_multiprocessingzmultiprocessing.synchronize�linuxN)r z broken multiprocessing SemLock: )rwrvr�r��Lockr�r�r�)rv�synchronize�excs   rh�*skip_if_broken_multiprocessing_synchronizerL�sv��-��$�%� � =�>�K�
�|�|�w��	P�
�����&����	P��#�#�&F�s�g�$N�O�O��	P�s�=�
A&�A!�!A&c��URnURnUS:waUSU3nOUnS[R"U5S3nUR"[
Xq/UQ70UD6 UR"[
XqRU/UQ70UD6 g)z�
Check that given type cannot be instantiated using *args and **kwds.

See bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag.
�builtinsrzcannot create 'z' instancesN)rbrarjrr�r>�__new__)r��tprtrZ�modr��qualnamerps        rhr/r/�s���
�-�-�C�
�;�;�D�
�j���U�!�D�6�?���V���B�I�I�h�/�0��
<�C����y�#�A�D�A�D�A����y�#�z�z�2�M��M��Mrgc��SSKnUR5n[US-
S5$![[4aDnSn[R
"5nUbUS-
nURnUbMSnSnANW!Snf=fSnAff=f)znGet the recursion depth of the caller function.

In the __main__ module, at the module level, it should be 1.
rNr�)rk�get_recursion_depthr^�RecursionErrorr��	_getframe�f_backr)rk�depthrK�frames    rhrTrT	s���

� �!�5�5�7���u�q�y�!����
��(�
�	��E��M�M�O�E��#���
�������#�
�E��D�E��
�s&�%�A9�.A-�&A4�-A1�1A4�4A9c�H�[R"5n[5nX-
$)z�Get the number of available frames before RecursionError.

It depends on the current recursion depth of the caller function and
sys.getrecursionlimit().
)r��getrecursionlimitrT)rbrXs  rh�get_recursion_availabler\%	s"��
�!�!�#�E��!�E��=�rgc#��# �[R"5n[R"U5 Sv� [R"U5 g![R"U5 f=f7f)z'Temporarily change the recursion limit.N)r�r[�setrecursionlimit)rb�original_limits  rh�set_recursion_limitr`/	sG����*�*�,�N�.����e�$�
����n�-�����n�-���A%�A
�A%�
A"�"A%c��UcSnOUS:a[SU35e[5n[US-
S5nX-n[U5$)Ni N�z"max_depth must be at least 3, got r�)rrTrr`)�	max_depthrXrbs   rhrCrC9	sT�����	�	�Q���=�i�[�I�J�J��!�E����	�1��E���E��u�%�%rgr��likec
�p�[5n[R"S[UUS[	U5S3-S9 U$)NrA�
(?#support�))rGr�r�)�objectr��filterwarnings�DeprecationWarning�id)r�re�tokens   rh�ignore_deprecations_fromrnF	s<���H�E�����#���*�R��Y�K�q�1�1�	��Lrg�tokensc���U(d[S5e/n[SU55n[RHyup4pVnUS:XaXU[LaO[U[R5(a
URnOU=(d SnURU5(aMeURX4XVU45 M{ [RU:wa)U[RSS&[R"5 gg)Nz<Provide token or tokens returned by ignore_deprecations_fromc3�@# �UHnS[U5S3v� M g7f)rgrhN)rl)rrms  rhr�-clear_ignored_deprecations.<locals>.<genexpr>U	s���D�V�E�
�2�e�9�+�Q�/�V�s�rAr=)rrr��filtersrkr=rj�Patternr�rEr��_filters_mutated)	ro�new_filtersrE�actionr�rGr�r�rps	         rh�clear_ignored_deprecationsrxP	s�����W�X�X��K��D�V�D�D�H�5=�5E�5E�1���6��X��(�.@�"@��'�2�:�:�.�.��o�o���m����|�|�H�%�%�����F�X�v�F�G�6F����;�&�)�������!�!�#�'rgc��SSKnSSKn[R
"US5$![a [R"SS5s$f=f![a SnNLf=f)NrTzvenv: ensurepip requires zlibzvenv: pip requires ctypes)r]r^r�rr�r_)r]r�s  rh�requires_venv_with_piprze	sc��F�������v�'B�C�C���F����t�%D�E�E�F�������s �"�A	�!A�A�	A�Ac��[R"S5=(d$ [RR	[
S5n[R"U5n[USS9nUHWnURS5(dMUS-nURU5(dM8[RR	X5s $ [SUSU35e)	z�Try to find a wheel with the package specified as pkgname.

If set, the wheels are searched for in WHEEL_PKG_DIR (see ensurepip).
Otherwise, they are searched for in the test directory.
�
WHEEL_PKG_DIR�	wheeldataT)�reversez.whlrz
No wheel for z
 found in )r?r@r�r�rr��listdirr�rEr�r�)�pkgname�	wheel_dir�	filenamesr��prefixs     rh�
_findwheelr�u	s����(�(��9��R�W�W�\�\��{�>�I��
�
�9�%�I��y�$�/�I���� � ��(�(���3������v�&�&��7�7�<�<�	�4�4�
��m�G�9�J�y�k�J�
K�Krgc
#�.^# �SSKmSSKJn U4SjnU"5n[RSSSSU/nU"U5 [
RRX05n[
RR[R5n[RS	:Xa"[
RRUS
U5nO![
RRUSU5nUSSSSS
[S54nU"U5 Uv� SSS5 g!,(df   g=f7f)Nrr�)�temp_cwdc	�>�[(aNSSKn[5 [SSR[	UR
U555 TR
USS9 gTR
UTRTRSS9 g)NrzRun:r1T)r�)r�r�r�)	r�shlexr�rr	�quoter�r,�STDOUT)r2r�r�s  �rh�run_command�3setup_venv_with_pip_setuptools.<locals>.run_command�	sd����7���G��&�#�(�(�3�u�{�{�C�#8�9�:��N�N�3�d�N�+��N�N�3�",�/�/�",�"3�"3�!%�
�
'rgz-X�devz-m�venvr|�Scripts�bin�pip�installr�)r�r�r�r�r�r�r�rrr�r�)	�venv_dirr�r��temp_dirr2r��
python_exer1r�s	        @rh�setup_venv_with_pip_setuptoolsr��	s������#�
'�
��x��~�~�t�U�D�&�(�C���C���w�w�|�|�H�/���W�W�%�%�c�n�n�5�
��<�<�7�"��W�W�\�\�$�	�:�>�F��W�W�\�\�$��z�:�F��t�U��U�I��,�'���	�C����)
���s�D�C D�;	D�
D�D�gettotalrefcountc���U/nURU5 SSKnSnXlURU5 [	[
S5(aSnXl[
R"US9 gg)aR
Keep a Python alive as long as possible.

Create a reference cycle and store the cycle in an object deleted late in
Python finalization. Try to keep the object alive until the very last
garbage collection.

The function keeps a strong reference by design. It should be called in a
subprocess to not mark a test as "leaking a reference".
rNc��gror_)�encodings rh�search_func�"late_deletion.<locals>.search_func�	r�rg�register_at_forkc��gror_r_rgrh�atfork_func�"late_deletion.<locals>.atfork_func�	rrg)�before)r��codecs�	reference�registerr�r�r�)r��	ref_cycler�r�r�s     rh�
late_deletionr��	sa��&��I�
���Y����%��
�O�O�K� ��r�%�&�&�	� )��
���;�/�'rgr8c#� # �US::a[S5e[R"5nX0-nSv� [R"5U:�aOM U(a8[R"5U-
nSUSS3nU(aUSU3n[U5eg7f)a�
Run the loop body until "break" stops the loop.

After *timeout* seconds, raise an AssertionError if *error* is true,
or just stop if *error is false.

Example:

    for _ in support.busy_retry(support.SHORT_TIMEOUT):
        if check():
            break

Example of error=False usage:

    for _ in support.busy_retry(support.SHORT_TIMEOUT, error=False):
        if check():
            break
    else:
        raise RuntimeError('my custom error')

rz!timeout must be greater than zeroNz	timeout (r:z	 seconds)r�)rrWr;r>)r��err_msgr9rA�deadlinerCrps       rh�
busy_retryr��	s����,�!�|��<�=�=����!�J��#�H�
�
��>�>��x�'��	�
�
�^�^�
�
�
*���"�S���+����E��G�9�%�C��S�!�!�
�s�BBg{�G�z�?g�?)�
init_delay�	max_delayr9c#�# �Un[XUS9H,nSv� [R"U5 [US-U5nM. g7f)a�
Wait strategy that applies exponential backoff.

Run the loop body until "break" stops the loop. Sleep at each loop
iteration, but not at the first iteration. The sleep delay is doubled at
each iteration (up to *max_delay* seconds).

See busy_retry() documentation for the parameters usage.

Example raising an exception after SHORT_TIMEOUT seconds:

    for _ in support.sleeping_retry(support.SHORT_TIMEOUT):
        if check():
            break

Example of error=False usage:

    for _ in support.sleeping_retry(support.SHORT_TIMEOUT, error=False):
        if check():
            break
    else:
        raise RuntimeError('my custom error')
r8Nr�)r�rW�sleepru)r�r�r�r�r9�delayr�s       rhr<r<	
s<���4
�E�
���
6��
��
�
�5���E�A�I�y�)��	7�s�>Ac�$�\rSrSrSrSrSrSrg)�CPUStopwatchi+
a�Context manager to roughly time a CPU-bound operation.

Disables GC. Uses CPU time if it can (i.e. excludes sleeps & time of
other processes).

N.B.:
- This *includes* time spent in other threads.
- Some systems only have a coarse resolution; check
  stopwatch.clock_info.rseolution if.

Usage:

with ProcessStopwatch() as stopwatch:
    ...
elapsed = stopwatch.seconds
resolution = stopwatch.clock_info.resolution
c�6�[Rn[R"S5nU"5S::a&[Rn[R"S5n[	5UlUR
R
5 XlX lU"5Ul	U$)N�process_timerr;)
rWr��get_clock_infor;r��contextr �get_time�
clock_inforA)rsr�r�s   rhr �CPUStopwatch.__enter__=
sp���$�$���(�(��8�
��:��?��~�~�H��,�,�[�9�J�!�|�������� � �
�$��"�*����rgc��UR5nURR"U6nX R-
UlU$!URR"U6nf=fro)r�r�r)rA�seconds)rsrK�end_timer�s    rhr)�CPUStopwatch.__exit__J
sQ��	1��}�}��H��\�\�*�*�C�0�F��/�/�1����
���\�\�*�*�C�0�F�s�A�A)r�r�r�r�rAN)rarbrcrdrer r)rfr_rgrhr�r�+
s���"�rgr�c#��# �[R"5n[R"U5 Sv� [R"U5 g![R"U5 f=f7f)z>Temporarily change the integer string conversion length limit.N)r��get_int_max_str_digits�set_int_max_str_digits)�
max_digits�currents  rh�adjust_int_max_str_digitsr�S
sG����(�(�*�G�,��"�"�:�.�
��"�"�7�+���"�"�7�+�rac�l�SSKnUR$![a [R"S5ef=fr�)r��Py_C_RECURSION_LIMITr^r�r�r�s rhrVrV^
s7��6���-�-�-���6���� 4�5�5�6�s��!3c��[5S-$)z<For recursion tests, easily exceeds default recursion limit.rc)rVr_rgrhrUrUf
s�� �"�Q�&�&rg�uname�s390xzskipped on s390x�
getobjectsc�^^^�SSKJmJm [R
"T5UUU4Sj5nU$![a Ts$f=f)Nr)�
get_optimizer�
set_optimizerc�^>�T"5nT"S5 T"U0UD6T"U5 $!T"U5 f=fror_)rtrT�save_optr�r�r�s   ���rhr#�"without_optimizer.<locals>.wrapperw
s5��� �?��	$��$����(��(��(�#��M�(�#�s�"�
,)rkr�r�r^r%r&)r�r#r�r�s` @@rhrXrXr
sE����B��_�_�T��$��$��N�������s�0�?�?z.git�__pycache__c��[n[RRU5S:Xa	USS1-nU$SU;aUS1-nU$)N�Doc�buildr��Modules)� _BASE_COPY_SRC_DIR_IGNORED_NAMESr�r�r)r��names�ignoreds   rh�copy_python_src_ignorer��
s]��.�G�	�w�w������&����	
�	
���N�
�e�	���
�	
���Nrgc#�# �[R5H2n[U[5(dMUnURS:waM.Uv� M4 g7f)NrN)�__builtins__r7r=r�rb)r�r�s  rh�iter_builtin_typesr��
sA����"�"�$���#�t�$�$�����>�>�Z�'���	�
%�s�AAc#�^# �U4Sjn[T5n[U5n[T5H{nXB;aURU5 [	TU5nURS5(aURS5(dU"XE5(d	XB;aMfMhXB;aUS4v� MuUS4v� M} UHnX$nU"TXE5(dMUS4v� M g![
a* XB;a!U"XBU5(aUR
U5 M�f=f7f)Nc�F>�[U[R5(dgg)NFT)r=rM�WrapperDescriptorType)r��valuer�s  �rh�is_slot_wrapper�+iter_slot_wrappers.<locals>.is_slot_wrapper�
s����%��!<�!<�=�=��rgrDTF)	�varsrGrHr#r�r�rOr�rE)r�r�r��unusedr�r�s`     rh�iter_slot_wrappersr��
s������
�c��B�
��W�F��C����:��M�M�$��	��C��&�E����t�$�$�D�M�M�$�,?�,?��t�+�+��z��z��D�j� ��E�k�!�/�2������3��,�,���*����'�	��z�o�d�t�H�=�=��
�
�4� ��	�s1�AD�C�A.D�D�0D�>D�D�Dc#�# �SSKnSSKJn [USSS.Sj5 U"5nUR	SSS	5 URSS
5 Sv� SSS5 SSS5 g!,(df   N=f!,(df   g=f7f)Nrr�)�EnvironmentVarGuard�can_colorizer�c��gr�r_r�s rhr��no_color.<locals>.<lambda>�
s��%rg�FORCE_COLOR�NO_COLOR�
PYTHON_COLORS�1)�	_colorizer�r�rD�unsetrG)r�r�rNs   rh�no_colorr��
sc����.�	�)�^�D�-G�H�����	�	�-��_�=����
�C� �
�		�	I�H����	I�H�s3�B�A3�*A"�A3�	B�"
A0	�,A3�3
B�=Bc�F^�[R"T5U4Sj5nU$)z'Force the terminal not to be colorized.c�^>�[5 T"U0UD6sSSS5 $!,(df   g=fro)r�)rtrTr�s  �rhr#�$force_not_colorized.<locals>.wrapper�
s���
�Z���(��(��Z�Z�s��
,rW)r�r#s` rhrYrY�
s%����_�_�T��)��)��Nrgc�^�URm[[R"UR5U4Sj55nXlU$)zAForce the terminal not to be colorized for the entire test class.c�F>�UR[55 T"5 gro)�enterClassContextr�)r��original_setUpClasss �rh�new_setUpClass�6force_not_colorized_test_class.<locals>.new_setUpClass�
s���	���h�j�)��rg)�
setUpClass�classmethodr%r&)r�r�r�s  @rhrZrZ�
s@����.�.����_�_�S�^�^�$��%���$�N��Jrgc�
�[RR5nUR5H,nURS5(dMUR	U5 M. UR	SS5 UR	SS5 U$)N�PYTHONr�r�)r�rY�copyr�r�)�	clean_envrds  rhr[r[�
sb���
�
���!�I�
�^�^�
���<�<��!�!��M�M�!����M�M�-��&�
�M�M�*�d�#��rgc�<�[[RSS5$)z<Detect whether PyREPL was used during Python initialization.�__main__�__file__)r�r�r�r_rgrh�initialized_with_pyreplrs���3�;�;�z�*�J�7�7rgc�*�\rSrSrSSjrSrSrSrg)r\i	c�4�U(aSS- X lX0lg�Nr�r)�next_raises�iter_raises)rs�init_raisesrrs    rhrr�BrokenIter.__init__
s���
�a�C�&��&�rgc�2�UR(aSS- ggr)rrys rh�__next__�BrokenIter.__next__s�����
�a�C�rgc�2�UR(aSS- U$r)rrys rh�__iter__�BrokenIter.__iter__s�����
�a�C��rg)rrN)FFF)rarbrcrdrrrrrfr_rgrhr\r\	s��'��rgr\c���[RS:wagSSKn[[S[R5nSU/nURUSURS9nS	U;$![UR4a gf=f)
z@
Test if the Python executable is linked to the musl C library.
rHFrN�_base_executable�lddT)�textr��musl)	r�r�r�r�r��check_outputr�r�r�)r��exer2r�s    rh�linked_to_muslrs����|�|�w����
�#�)�3�>�>�
:�C��#�,�C���(�(��.2�0:�0A�0A�)�C��

�f����
�Z�2�2�3����s�A�A7�6A7c�`�[SS5Vs/sHn[U5PM snS/-$s snf)zyReturns a list of C0 control characters as strings.
C0 control characters defined as the byte range 0x00-0x1F, and 0x7F.
r� �)�range�chr)�cs rh�control_characters_c0r-s0��"�$��-�.�-�q�C��F�-�.�&��9�9��.s�+ro)r)z
requires zlib)z
requires gzip)zrequires bz2)z
requires lzma)z$requires co_positions / debug_ranges)T)r=)zneeds the GIL enabled)Nr_r_)F)r_(rerar^�
contextlib�dataclassesr%r1r�r�rjr�r�r?r�rWrMr�r�rQrPrQrRrSr�rrr�TEST_SUPPORT_DIRr�r��	REPO_ROOTr�rr	rr
r�rr*r+r!rrrrt�junit_xml_listrr�rr
r�r�rrrrrrrrr5r0r1�HAVE_ASAN_FORK_BUGrPrXr�
SOCK_MAX_SIZEr_rn�
__getformat__r�r"r#rrrrnrprs�contextmanagerrxr{r�r4r5r6r;r7r8r9�is_appler�r$r%r&r'r(r)�has_strftime_extensions�strftimer�
TEST_HTTP_URLrJr>rr�r�rBrHr�r�rir�rr>rrrrr�r�r�rrr
r�r@rrrrrr"r r#r(r'r-rAr@rRrIrhrirs�_4Gr�rvr
rqrFryrrr�rr r�r�r:r�r�r2�TEST_MODULES_ENABLEDr3r��MISSING_C_DOCSTRINGS�HAVE_PY_DOCSTRINGS�HAVE_DOCSTRINGS�requires_docstringsr�r�r�r�r�r?rDrAr�r�rEr�r.r�r@r,r-rdrGr�r�r�r�r�r�rKr�r<r=r�r�r�r�r�rLr�rM�total_orderingrrNr	rOr�	hash_info�width�	NHASHBITSr'r)rErLr/rTr\r`rCrnrxrz�cacher�r�rTr�r�r<r�r�rVrUr��machine�is_s390xrrW�
Py_TRACE_REFSrX�	frozensetr�r�r�r�r�rYrZr[rr\rr�rr_rgrh�<module>r;s�	��=��~��
�F�
G�G������	�	��
�������-��r�����
����7�7�?�?�2�7�7�?�?�8�#<�=������� 0�1�
�
�W�W�_�_�]�
+�
��G�G�O�O�J�'�	�5�I�5����=�J�=�)�E�)��X�&�&����$����
�
�
�������
���*�
�"E$�N>�'�	7���6:�8��:
/� %�U�u�U��@)�e�E�e�TY�)�%�T�2����$$�
�%�
��'�'�	����!�,�,�V�4�$�&��-�-�,�-�1�)�����:��:�*P��l�l�g�%�
�
�L�L�#�#�F�+�	�
�\�\�Y�
&�
��<�<�E�E�%/�!�Y�J��J�����,�
�

�,�,�&�
 ���,�,�"<�<���6�c�l�l�h�6���2�v�&�	��������	,��O�
�������
��V������
',�
<� ���<�<�7��
�"&�-�-��"6�%�"?��,�
����������]�F�3�
��&�&��3��4��V��,��	1�$�t�	1�41�n���	/��	/�%�%�
$�
����������)��)�%�B�$*��y�/�/�0A�B�C��1�'���G��G�	
���S�=��3�4�
����(�8=��:���4��4�D"�P�F��
�S�j���#�g���#�g������>�3�>�3�>�	��	��	�%�%�@.�`
�$�O�+��!�8��8*��"�0�0��@�I�E�e�S��H�7�*�+�I�����/�I�%�4�4�5G�H�H��'�.�.�d�:��%�B�.B�*B���)�)�/�*D�F���� �J�J�
����#�<���#��#�<������<5�;��f��D��]�*OB�OB�d4�79��@B� �89�v.�*]�]�@3�D������
,�37�H�6;��,+-��D��+�	����;��;�"$0�$0�N;�#���
�L�	�	�	��;��
��������*��
��������;��-�
�M�M���	�4�D)�)�X,0�-9�^P�2N� �.����.��.�&��S��3��6��$��$�4�$�*
D� ���L��L�.���$��$�R�3�*�+��"0�J'"�$�'"�T*�#(�C�t�*�D%�%�P���,��,�6�'��2�w��A�B�H�H�J�$6�$6�'�$A������*<�=�
���\�*�
�
� $-�
��	.�$� ��&�*�Z���
��
�����S�#�X���8���"�&:�t�C�y�:��mD�
��
�s�^;�;_�_

Youez - 2016 - github.com/yon3zu
LinuXploit