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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python315/Lib/test/test_import/__pycache__/__init__.cpython-315.pyc
R
>lqj�%c���]PHs]PHs]PHs]PHs]PHs]QHGs]QH G	s	G
s
GsGsG
s
]PH8s]PH<s]PH@s]PHDs]PHHs]PHLs]PHPs]PHTs]PHXs]PH\s]PH`s]PHds]PHhs]PHls]PHps]QHpGs]PHxs]QH|G s ]QH|G!s!G"s"G#s#G$s$G%s%G&s&G's'G(s(G)s)G*s*G+s+G,s,G-s-G.s.G/s/]QH�G1s1G2s2G3s3G4s4G5s5G6s6G7s7G8s8]QH�G:s:G;s;G<s<G=s=]QH|G>s>]Q	H|G?s?]Q
CHGAsAGBsB]QHhGCsC]PCHsD]PCHsF]PCHsG]PCH"sI]PCH.sK\O�\O�9%f\O�O�PIQ2sPQ
sQQP
-QksRQP
-QksSQP	-QksTQP
-QksUQsVQP	-QksWQsX\DdQ\D-QksYQsZQs[QQ\O�2s]\.QQ\O�22s_\PQQ \O�22s`Q!Q"\O�2saQ#Q$\O�2sbQ%Q&\O�2scQ'Q(\O�2sdQ)Q*\O�2seQ+Q,\O�2sf\$Q-Q.\O�22sg\$Q/Q0\O�22shQ1Q2\O�2siQ3Q4\O�2sjQ5Q6\O�2skQ7Q8\]2sl\ZQ9Q:\O�22sm\O�\FPIQ;2Q<Q=\O�22sn\$Q>Q?\O�22so\pQ@6Xc\O�2P!P!\EcPsDCK_h9h\EcPsFCKih9h\Jc	PsGPsICKph9h\EcPsKCKzh9h)A�)�_get_sourcefile)�AppleFrameworkLoader�BuiltinImporter�ExtensionFileLoader�FrozenImporter�SourceFileLoader)�mock)�	os_helper)�
STDLIB_DIR�	swap_attr�	swap_item�cpython_only�is_apple_mobile�
is_emscripten�	is_wasm32�run_in_subinterp�run_in_subinterp_with_config�
Py_TRACE_REFS�requires_gil_enabled�Py_GIL_DISABLED�no_rerun�force_not_colorized_test_class�catch_unraisable_exception)�forget�make_legacy_pyc�unlink�unload�ready_to_import�
DirsOnSysPath�CleanImport�
import_module)�TESTFN�rmtree�
temp_umask�TESTFN_UNENCODABLE)�
script_helper)�threading_helper)�uncache�temporary_pycache_prefix)�
ModuleTypez*test meaningful only when writing bytecodec
���[U[2%c[U2o[Q[Q[
Q[Q[Q-oSo[U[2%fPU2gV4*oUOOo[U[2%f[U2oV5*oVT6wc<QUQUO0oU%c[OU2g[U2gU!)�built-in�	extensionzframework extension�frozenzpure Pythonzexpected module to be z, got )�
isinstance�str�
__import__rrrrr�type�__spec__�loader�unittest�SkipTest�	Exception)�moduler3�skip�MODULE_KINDS�expected�actual�errs&&&    �.C:\Python315\\Lib\test\test_import\__init__.py�_require_loaderr>Ts����&�#����F�#��	���[��3����-��L��H��h��%�%�/�x�/�%��%�H�
�_�_�
#�
#�F��f�d�#�#��f���
�
!�F�
��&�x�j��v���6G�H����#�#�C�(�(���n���M�r8c��[U[U2oUOOQ6XfPUO2gP!)r+)r>rr2�origin�r7r8s&$r=�require_builtinrCps1��
�V�_�d�
;�F��?�?�!�!�Z�/�@����@�/r?c�h�[%c[U[U2P![U[U2P!�N)rr>rrrBs&$r=�require_extensionrFts#������ 4�d�;��� 3�T�:r?c��[U[U2oUOOQ6XfPUO2gP!)r-)r>rr2rArBs&$r=�require_frozenrH|s1��
�V�^�T�
:�F��?�?�!�!�X�-�>�v���>�-r?c�*�[U[U2P!rE)r>rrBs&$r=�require_pure_pythonrJ�s���F�,�d�3r?c�H�[%c[V2![V2!rE)rrr)�modname�filenames&&r=�create_extension_loaderrN�s����#�G�6�6�"�7�5�5r?�put_in_sys_modulesc���[V2o[OOV2o[OO	U2oUOU2U%cU[OU$U!rE)rN�	importlib�util�spec_from_loader�module_from_spec�exec_module�sys�modules)rLrMrOr3�specr7s&&$   r=�import_extension_from_filerY�sX��
$�W�
7�F��>�>�*�*�7�;�D�
�^�^�
,�
,�T�
2�F�
���v���%����G���Mr?c��UQ*UQ*UQ*UQ*1FDo[U2J	[Q2P!)�.py�.pyc�.pywz	$py.class�__pycache__)rr")�name�fs& r=�remove_filesra�s>���U�l��V�m��V�m��[� �"��	�q�	�	"�
�=�r?�_origc���[OOQP2UO2UOO
o[OQU2]PH"oP!)�_testsinglephase)	rVrW�pop�_clear_globalsr2rA�_testinternalcapi�clear_extensionrd)rbrArds$  r=�restore__testsinglephaseri�sF��	�����*�D�1�
�������&�&���)�)�*<�f�E�r?c��[U[2%fU1Qko[U2oQo[U2U2o[O
[PIQ2U2!)zADecorator to skip if single-phase init modules are not supported.c�H�UU2[2![2h9hrE)ri)�self�_meths&&r=�meth�'requires_singlephase_init.<locals>.meth�s��
+��T�{�(�*��(�*�s��!zggh-117694: free-threaded build does not currently support single-phase init modules in sub-interpreters�%test requires _testsinglephase module)r.r1r
rr4�skipIfrd)rn�msgs& r=�requires_singlephase_initrs�s^���d�D�!�!�!�	+�
���D�
s�C���$�T�*�D��?�?�+�t�3�B�D�DH�J�Jr?c�J�[O[PIQ2U2!)z>Decorator to skip a test if subinterpreters are not supported.zsubinterpreters required)r4rq�
_interpreters)rns&r=�requires_subinterpretersrv�s%���?�?�=�D�0�5�7�7;�=�=r?c	�`�\sQs]�snQs\QO
22s\Q2s	\
OQ2s\
OQ2O2s\
OQ2O2s\
OQ2O2s\QPQ	P
Q
PQP
-Qk2s\Q
2s\QQP-Qkk2s\Q2sQsUsP!)�ModuleSnapshotaA representation of a module for testing.

Fields:

* id - the module's object ID
* module - the actual module or an adequate substitute
   * __file__
   * __spec__
      * name
      * origin
* ns - a copy (dict) of the module's __dict__ (or None)
* ns_id - the object ID of the module's __dict__
* cached - the sys.modules[mod.__spec__.name] entry (or None)
* cached_id - the object ID of the sys.modules entry (or None)

In cases where the value is not available (e.g. due to serialization),
the value will be None.
z#id module ns ns_id cached cached_idc
��UOOo[OO	U2oU[U2U[OQ-UO@[UO2U[U2Q5!))�idr7�ns�ns_id�cached�	cached_id�)	r2r_rVrW�getrz�types�SimpleNamespace�__dict__)�cls�modr_r}s&&  r=�from_module�ModuleSnapshot.from_module�se���|�|� � ��������&����#�w���$�$�4�s�|�|�4��S�\�\�"����j�

�	
r?z�
        {imports}

        name = {name!r}

        {prescript}

        mod = {name}

        {body}

        {postscript}
        z
        import sys
        a�
        # Capture the snapshot data.
        cached = sys.modules.get(name)
        snapshot = dict(
            id=id(mod),
            module=dict(
                __file__=mod.__file__,
                __spec__=dict(
                    name=mod.__spec__.name,
                    origin=mod.__spec__.origin,
                ),
            ),
            ns=None,
            ns_id=id(mod.__dict__),
            cached=None,
            cached_id=id(cached) if cached else None,
        )
        zL
        # Clean up the module.
        sys.modules.pop(name, None)
        �	prescript�import_first�
postscript�postcleanupc�(�UP	IcUOoLe[U[2%cN[OU2O2oUO[O*U*oLPoU%c%[OU2O2LPoU%c%[OU2O2LPoU%c1U%c'U[O]**U*oLSoU%c!U[OQU02*
oUOOUOO2UUO2UOO2UQ5!)Tzq

                # Now import the module.
                assert name not in sys.modules
                import )�importsr_r��bodyr�)�CLEANUP_SCRIPTr.r/�textwrap�dedent�strip�os�linesep�SCRIPT�format�IMPORTS�SCRIPT_BODY)r�r_r�r�r�r�s&&$$$$r=�build_script�ModuleSnapshot.build_scripts(���$���,�,�K�
��S�
)�
)�"�/�/�+�6�<�<�>�K��,�,�r�z�z�9�K�G�K��K�:C�H�O�O�I�.�4�4�6��	�<F�X�_�_�Z�0�6�6�8�B�
���'�"�*�*�q�.�8�;�F�
�(�
������.��v�	*!�"�
"�I��z�z� � ��K�K�%�%�'���o�o�'����&�&�(�!�!�
�	
r?c���[OU2oUQ*o[OQ-UQ*@UQ$[OQ-U@UQ$UQ-U@!)r7r2r)�json�loadsr�r�)r��text�rawr�s&&  r=�parse�ModuleSnapshot.parse-sW���j�j�����(�m���/�/�B�#�j�/�B��J���-�-�4��4��H�
��z�S�z�r?�pipec�J�UdUOVV42![O2oUOVV42UvqV[OU2[OU2!SvqV[OS2[OS2h9hrE)�_from_subinterpr�r��close)r�r_�interpidr��script_kwds�r�ws&&&$,  r=�from_subinterp�ModuleSnapshot.from_subinterp5sy�����&�&�t�t�I�I��w�w�y��	��&�&�t�t�I��D�A��H�H�Q�K��H�H�Q�K���D�A��H�H�Q�K��H�H�Q�K�s�A0�02B"c��UvqV[OQUQ02oUOQ2oU%c-[OU2O2oVx*
oUO	2UQ$UO
U1-U@o	Ue"[
U	2o
U
]6wc[U
Q02gL[OV)2[OUQ2oUOUO22!)zq
            # Send the result over the pipe.
            import json
            import os
            os.write(z., json.dumps(snapshot).encode())

            r�z != 0��)r�r�r��lstripr�r�r�AssertionErrorru�
run_stringr��readr��decode)r�r_r�r��
script_kwargsr�r�r��_postscript�script�retr�s&&&&&       r=r��ModuleSnapshot._from_subinterpAs�������_�_�*��S�
�	&��
�$�'�'��5���"�/�/�+�6�=�=�?�K��%�J�&0�&6�&6�&8�
�l�#��!�!�$�8�-�8����"�6�*�C��a�x�$��u�E�]�3�3��
�$�$�X�6��w�w�q�$����y�y�����'�'r?rrE)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�tuple�split�_fields�classmethodr�r�r�r�r�r�r�r�r�r�r�r��__static_attributes__�__classdictcell__��
__classdict__s@r=rxrx�s$�����$�9�?�?�A�B�G��

��

��_�_��
�F��o�o��
�
�U�W���/�/�#�
�"�U�W�#�$�_�_�&�
��U�W��
�#
�#�#
�"'�#
�!%�#
�"'�	#
��#
�J�����	��	��	��(��(r?rxc�`�\sQsQsnQsQsQsQsQsQs	Qs
\Q	2sQ
s
QsQsQ
sQsQsQ6QksQsQsQsQs\Q2sQsQs\Q2sQs\Q2sQsQs Qs!\Q2s"\#OH2Q2s%\&ON\(ORQ 6HQ!2Q"2s*Q#s+Q$s,Q%s-Q&s.Q's/Q(s0Q)s1Q*s2\&Of\(ORQ 6HQ+2\&Of\(ORQ,6HQ-2\&Of\(OROiQ.2Q/2Q0222s5Q1s6Q2s7Q3s8Q4s9Q5s:Us;P!)7�ImportTests�ac�P�[[2[O2P!rE)rar!rQ�invalidate_caches�rls&r=�setUp�ImportTests.setUpds���V���#�#�%r?c�&�[[2P!rE)rr!r�s&r=�tearDown�ImportTests.tearDownhs	���v�r?c��UO[29^tt^2]PH
oPPP2P!)%fhP!9h�r)�assertRaises�ModuleNotFoundError�(something_that_should_not_exist_anywhere�rlr�s& r=�&test_import_raises_ModuleNotFoundError�2ImportTests.test_import_raises_ModuleNotFoundErrorks&��
�
�
�2�
3�
3�;�4�
3�
3�
3���.�?	�?	c��[[O2oUO[29^tt^2[Q2PPP2UO
[[O2U2P!)%fhK;9h)zzipimportjunk)�setrVrWr�r�r0�assertEqual)rl�befores& r=�8test_import_null_byte_in_name_raises_ModuleNotFoundError�DImportTests.test_import_null_byte_in_name_raises_ModuleNotFoundErrorosV���S�[�[�!��
�
�
�2�
3�
3��*�+�4�	
����S�[�[�)�6�2�4�
3�s�A7�7B	�B	c��UO[29^tt^2]QH
GoPPP2P!)%fhP!9h)r)�blah)r�r�r�r�)rlr�s& r=�:test_from_import_missing_module_raises_ModuleNotFoundError�FImportTests.test_from_import_missing_module_raises_ModuleNotFoundErrorxs&��
�
�
�2�
3�
3�E�4�
3�
3�
3���0�A	�A	c��UO[29^tt^2]QH
GoPPP2P!)%fhP!9h)r)r�)r��ImportErrorrQr�r�s& r=�0test_from_import_missing_attr_raises_ImportError�<ImportTests.test_from_import_missing_attr_raises_ImportError|s%��
�
�
�{�
+�
+�J�,�
+�
+�
+�r�c	���[Q29^tt^2]PHoUO[29^tt^2o]QHGoPPP2PPP2UOWOOQ2UOUOOWO2UO[UO2Q2P!)%fhK�9h)%fhK�9h)r���i_dont_existz7cannot import name 'i_dont_exist' from 'os' \(.*os.py\))rr�r�r�r�r��	exceptionr_�path�__file__�assertRegexr/)rlr��cmr�s&   r=�/test_from_import_missing_attr_has_name_and_path�;ImportTests.test_from_import_missing_attr_has_name_and_path�s���
��
�
���"�"�;�/�/�2�+�0��	
������*�*�D�1�������*�*�B�K�K�8�����R�\�\�*�,f�g�	0�/���
�s-�"C�C	�C�C
�C
�C�C.	�'C.	c��[Q2oUO[29^tt^2o]QHGoPPP2UOWOOQ2[UQ2%cbUOUOOUOO2UO[UO2Q2P!UO[UO2Q2P!)%fhK�9h)�	_testcapir�r�zFcannot import name 'i_dont_exist' from '_testcapi' \(.*(\.(so|pyd))?\)zEcannot import name 'i_dont_exist' from '_testcapi' (unknown location))r r�r�r�r�r�r�r_�hasattrr�r2rAr�r/)rlr�r�r�s&   r=�2test_from_import_missing_attr_has_name_and_so_path�>ImportTests.test_from_import_missing_attr_has_name_and_so_path�s���!�+�.�	�
�
�
�{�
+�
+�r�.�,�������*�*�K�8��9�j�)�)�

���R�\�\�.�.�	�0B�0B�0I�0I�J�����B�L�L�!�Y�
�

����B�L�L�!�W�
�,�
+�s�C9�9D		�D		c��UO[29^tt^2o]QH
GoPPP2UO	WO
OQ2UOUO
O2P!)%fhK]9h)rr��_warning)	r�r�r�r�r�r�r_�assertIsNoner��rlr�r�s&  r=�&test_from_import_missing_attr_has_name�2ImportTests.test_from_import_missing_attr_has_name�sZ��
�
�
�{�
+�
+�r�-�,�	
������*�*�J�7����"�,�,�+�+�,�	,�
+�s�A;�;B	�B	c��UO[29^tt^2o]QH
GoPPP2UO	WO
OQQ.2UOUO
2P!)%fhKU9h)rr��	posixpath�ntpath)r�r��os.pathr��assertInr�r_�assertIsNotNoner�s&  r=�/test_from_import_missing_attr_path_is_canonical�;ImportTests.test_from_import_missing_attr_path_is_canonical�sU��
�
�
�{�
+�
+�r�,�,��
�
�b�l�l�'�'�+�x�)@�A����R�\�\�*�,�
+�s�A3�3B	�<B	c	��[29^tt^2vq[UQQQ59^tt^2oUOQ2PPP2-oUO[[
OU2Q029^tt^2[QUQ0U2PPP2UOQU2PPP2[29^tt^2vq[UQQQ59^tt^2oUOQ2PPP2-oUO[[
OU2Q	029^tt^2[QUQ0U2PPP2UOQU2PPP2P!)%fhCK,9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhKy9h)%fhP!9h)
r��utf-8��encodingz__all__ = [b'invalid_type']z\.__all__ must be strzfrom z	 import *sinvalid_typez%globals()[b'invalid_type'] = object()z\.__dict__ must be str)	r�open�write�assertRaisesRegex�	TypeError�re�escape�exec�assertNotIn)rlr_r�r`�globalss&    r=�"test_from_import_star_invalid_type�.ImportTests.test_from_import_star_invalid_type�se��
�
�
�,�4��d�C�'�2�2�a����5�6�3��G��'�'��b�i�i��o�.�.D�E����u�T�F�)�,�g�6��
���_�g�6���
�
�,�4��d�C�'�2�2�a����?�@�3��G��'�'��b�i�i��o�.�.E�F����u�T�F�)�,�g�6��
���_�g�6��
�3�2�2�����	�
��3�2�����	�
�
�s��F	�E"	�?F	�>E6	�F	�G�F	�.?G�-F/	�>G�"E3
�+E3
�-	F	�6F
�?F
�F	�	F	�F	�F,
�%F,
�'G�/F?
�8F?
�:G�G	�G	c��UO[29^tt^2]PH
oPPP2P!)%fhP!9hr�)r�r��RAnDoM)rlrs& r=�test_case_sensitivity�!ImportTests.test_case_sensitivity�s'���
�
�{�
+�
+��,�
+�
+�
+�r�c�6�]QHGo[Q2]QHGoP!)r)�double_constz"test.test_import.data.double_const)�test.test_import.datarr)rlrs& r=�test_double_const�ImportTests.test_double_const�s��	7��3�4�6r?c�@`�U1Qko[OO][O2UQ2[O
O
Q2%cQFDoUU2J
	[O]P![O]h9h)c	�:�[U*o[Q*o[UQQQ59^tt^2o[QUQUQ5[OQ2o[OQ2o[QVCQ5[Q	VSQ5PPP2[[
O7c[
O[[O2[[2oROWOWQU*2ROUOWQU*2[[2[!U2[!U2P!)%fhK�9h[c$oROQ
S8QS802Po=K�Po=hh9h[[2[!S2[!S2h9h)
r\r�rrz)# This tests Python's ability to import azfile.��filer�za =zb =zimport from z	 failed: z'module loaded (%s) but contents invalid)r!r	�print�random�	randrangerVrWrQr�r0r��failr��a�brr)	�ext�source�pycr`r%r&r�r<rls	&       �r=�test_with_extension�4ImportTests.test_import.<locals>.test_with_extension�sK����c�\�F��6�/�C��f�c�G�4�4���A��7��,��$�$�T�*���$�$�T�*���e�Q�'��e�Q�'�
5�����$��K�K��'��'�'�)�

�H�$�V�,�C�� � �����=��C�E�� � �����=��C�E��v���v���s��15�4��#�H��I�I�S�#�F�G�G��H���v���v���s��sI�AE�E'�%AF�E$	�E$	�'	F�1F�2F�F�F�F�'F?r[�win)z.PYz.Pyz.pYr]z.PYWz.pYw)rVr��insertr��curdir�platform�
startswith)rlr*r'sf  r=�test_import�ImportTests.test_import�sn���	�>	������2�9�9�%�	���&��|�|�&�&�u�-�-�H�C�'��,�I������������s�,B
�%B
�
Bc��UQ*o[UQQQ59^tt^2oUOQ2[Q2FDoUOQ2J	UOQ2PPP2[UP	Q5[	U2[
OOP2[O2-o[Q	U*PU2[
OP[	UQ
*2[	UQ*2UO2[
OUP!)%fhK�9h[	S2h9h[cP!h9h[
OP[	SQ
*2[	SQ*2SO2[
OSh[chh9h9h)r[r�rrzd = [
i�z"",
�])�
allow_compilezimport �c�o)r	r
�rangerrrVr��appendrQr�r�clearrW�KeyError)rlr7rMr`�i�	namespaces&&    r=�test_module_with_large_stack�(ImportTests.test_module_with_large_stack�sc���E�>���(�C�'�
2�
2�a�
�G�G�I���5�\������ �"�
�G�G�C�L�	3�	�
�H�D�9��8��	��������#�#�%��	�	���V�#�T�9�5�������8�c�>�"��8�c�>�"�
�O�O��
��K�K��'�=3�
2��
�8���(�
��
��������8�c�>�"��8�c�>�"�
�O�O��
��K�K��'���
��
�sm�AD-�1
E�E"�E�-D=	�6D=	�
E
�	E�E�E�"AG�)F;�:G�;	G	�G	�G�G	�	Gc��[Q*o[UQQQ59^tt^2o[QUQ5PPP2[OO][O2[O2[[O7c[O[QFDNoUO[[[2UO[[OQU*2JP	[O][[2P!)%fhK�9h[O][[2h9h)r[r�rrza = 1/0rz'damaged module in sys.modules on %i try)���)r!r	r!rVr�r-r�r.rQr�rWr��ZeroDivisionErrorr0rra)rlr(r`r<s&   r=�test_failing_import_sticks�&ImportTests.test_failing_import_stickss����%���
�&�#��
0�
0�A��)�!�$�1�
	������2�9�9�%��#�#�%��S�[�[� ����F�#�	!����!�!�"3�Z��H�� � �����!J�Q�!N�P��
������� �!1�
0��������� �s�D$�-AD7�$D4	�-D4	�7"Ec���]PHo]PHoUOVUO2UO	UO
Q2]PHGoUOV2O
UO2P!)rr�)�test�test.support�assertIsr��
assertHasAttr�support)rl�xrH�ys&   r=�test_import_name_binding�$ImportTests.test_import_name_binding2sI�����
�
�a�q�z�z�*����4�<�<��4�	!��
�
�a���q�z�z�2r?c��Qo]PHGtGo]oU]
6c]PHGtGoU]*
oJ[]2FDo]PHGtGoJ	P!]PHGtGoh9h).)�test.support.script_helperrLr%r8)rlrMr<s&  r=�test_issue31286�ImportTests.test_issue31286=sO��	3��A�2�2�
���"�f�2�2�
��F�A��q��A�2�2���
3�2�s�A	�	Ac��[[O*Q*o[UQQQ59^tt^2oUO	Q2PPP2[
OO][O2[[2oUO[[
O2UOUO]Q2UOUO]Q2[[2[UQQQ59^tt^2oUO	Q2PPP2UO!["[$O&U2[
OO)[2oUO+UQ2UOUO]
Q2UOUO]Q2[
O][[2[-[2P!)%fhCK�9h)%fhK�9h[
O][[2[-[2h9h)�pyr�rrz
a = 1
b=2
z!module has wrong attribute valuesza = 10
b=20//0
z$expected module to be in sys.modules)r!r��extsepr	r
rVr�r-r.r0rrWr�r%r&rar�rDrQ�reloadr�rr)rlr(r`r�s&   r=�test_failing_reload�ImportTests.test_failing_reloadNs����"�)�)�#�d�*��
�&�#��
0�
0�A�
�G�G�N�#�1�	������2�9�9�%�	��V�$�C��M�M�&�#�+�+�.����S�U�U�A�'J�K����S�U�U�A�'J�K�
�� ��f�c�G�4�4�����+�,�5�
���/��1A�1A�3�G��+�+�/�/�&�)�C�� � ��&L�M�
���S�U�U�B�(K�L����S�U�U�A�'J�K�������� ��6�N�C1�
0�
0��"5�4��������� ��6�N�s=�G4�BH�H�'BH�4H	�=H	�H	�H	�H�1Ic���[Q*o[UQQQ59^tt^2oUOQ2PPP2[OO][O2[[2oUOUOQ2[OU2[O[[U2[O2[[2o[OO!UO2vqEUO#UQ2[O][%[2[[O7c[O[P!P!)%fhCKT9h[O][%[2[[O7c[O[hh9h)r[r�rrztest = None
r\)r!r	r
rVr�r-r�r.r0�assertEndsWithr��removerWrrQr��splitextr�ra)rlr(r`r��baser's&     r=�test_file_to_source�ImportTests.test_file_to_sourcets9���%���
�&�#��
0�
0�A�
�G�G�O�$�1�	������2�9�9�%�	(��V�$�C�������e�4��I�I�f�����F�#��F�#��'�'�)��V�$�C����(�(����6�I�D����S�&�)�������� �����$��K�K��'�%�#1�
0�
0��������� �����$��K�K��'�%�s$�F�.CF�F	�F	�9G'�G'c��[OO[2o[O
2oUO
U2UO[29^tt^2o[U2PPP2P![c$SOQOS22K`h9h)%fhP!9h)zpath is not encodable to {})
r�r��abspathr!rV�getfilesystemencoding�encode�UnicodeEncodeError�skipTestr�r�r�r0)rlr�rr6s&   r=�test_import_by_filename�#ImportTests.test_import_by_filename�s����w�w���v�&���,�,�.��	J��K�K��!��
�
�{�
+�
+�q��t��,�
+��"�	J��M�M�7�>�>�x�H�I�	J��
+�
+�
+�s)�A?�)B0�?	B-�	!B-�,B-�0C	�9C	c��[OP[[OQ22o[O
U2P!)�z�            import sys
            class C:
               def __del__(self):
                  import importlib
            sys.argv.insert(0, C())
            )r%�make_scriptr!r�r��assert_python_ok)rl�testfns& r=�!test_import_in_del_does_not_crash�-ImportTests.test_import_in_del_does_not_crash�s7���*�*�2�v�x���H�8���	�&�&�v�.r?c�6�[OO][O2[
Q*o[OOU2o[UQQQ59^tt^2oPPP2[OUQ	2[#[
2[O$U2[O]['[
2P!)%fhKo9h[cSOQ2Kx[c]oSO[[QP2[[QP217cgSOQO!S22Po=K�Po=hh9h[O]['[
2h9h)
rr[r�rrz-cannot set modification time to large integer�	EOVERFLOW�EINVALz2cannot set modification time to large integer ({}))���rt)rVr�r-r�r.r!rQrR�cache_from_sourcer	�utime�
OverflowErrorrg�OSError�errno�getattrr�r0�statra)rlr(�compiledr`�es&    r=�test_timestamp_overflow�#ImportTests.test_timestamp_overflow�s$��	������2�9�9�%�	!��e�^�F� �~�~�7�7��?�H��f�c�G�4�4���5�
^�����!;�<�
�v���G�G�H��������� �!5�4��!�
O��
�
�M�N��
^��7�7�7�5�+�t�#D�#*�5�(�D�#A�#C�C���
�
�R�Y�Y�Z[�\�]�]��	
^��������� �sr�AE6�3C�5E6�>C/�%E6�C,	�%C,	�'E6�/	E3�9E3�E6�
E3�E3�0E.�!E.�)E6�.E3�3E6�6"Fc�l�[QQ,Q5P![cSOQ2P!h9h)�httpr�)�fromlistzfromlist must allow bogus names)r0r�r$r�s&r=�test_bogus_fromlist�ImportTests.test_bogus_fromlist�s/��	9��v���1���	9��I�I�7�8�	9�s��	3�3�3c��QQ,o[OUoUO2vq4UOQU2P!)�-cz&del __builtins__.__import__; import ossImportError)r%�spawn_python�communicater)rl�args�popen�stdout�stderrs&    r=�test_delete_builtins_import�'ImportTests.test_delete_builtins_import�s;���>�?���*�*�D�1���*�*�,����
�
�n�f�-r?c��UO[Q29^tt^2]QH
GoPPP2P!)%fhP!9h)z^No module named 'bogus')�foo)rr��bogusr�)rlr�s& r=�/test_from_import_message_for_nonexistent_module�;ImportTests.test_from_import_message_for_nonexistent_module�s)��
�
#�
#�K�1K�
L�
L�!�M�
L�
L�
L���1�A	�A	c��UO[Q29^tt^2]QH
GoPPP2P!)%fhP!9h)z^cannot import name 'bogus')r�)rr�r
r�)rlr�s& r=�,test_from_import_message_for_existing_module�8ImportTests.test_from_import_message_for_existing_module�s)��
�
#�
#�K�1N�
O�
O� �P�
O�
O�
O�r�c�D�QQ2oQoUO[U2U2[OU$UO	[
29^tt^2o]QHGoPPP2UO[WO2Q2P!)%fhK79h)c�(`�\sQsQsnQsQsUsP!)�IImportTests.test_from_import_AttributeError.<locals>.AlwaysAttributeError��c��[grE)�AttributeError)rl�_s&&r=�__getattr__�UImportTests.test_from_import_AttributeError.<locals>.AlwaysAttributeError.__getattr__�s��$�$r?r)r�r�r�r�r�r�r�r�s@r=�AlwaysAttributeErrorr��s����
%�
%r?r��test_from_import_AttributeError��does_not_existzScannot import name 'does_not_exist' from '<unknown module name>' (unknown location))�
addCleanuprrVrWr�r�r�r�r�r/r�)rlr��module_namer�r�s&    r=r��+ImportTests.test_from_import_AttributeError�su��	%�	%�8�������,�#7�#9����K� �
�
�
�{�
+�
+�r�F�,�	
����R�\�\�*�a�	c�,�
+�s�B�B	�B	c	��[[QP29^tt^2UO[29^tt^2]QHGoPPP2UO[
29^tt^2[OPPP2PPP2P!)%fhKP9h)%fhK-9h)%fhP!9h)r�r�)rr�r�r�r�r�)rlr�s& r=�test_issue31492�ImportTests.test_issue31492�sq��
�r�:�t�
,�
,��"�"�;�/�/�-�0��"�"�>�2�2��!�!�3�	-�
,�/�/��3�2��	-�
,�
,�sL�B.�B	�%B.�%B	�6B.�B
�B
�B.�B+
�$B+
�&B.�.B?	�7B?	c
�```�Qn[OO][OO	[OO[2Q22PnUUU1Qko[]
2FD�o[O2n[]2Tt,tFDo[OUQ5MJ	oo[OURO29^tt^2[O]2PPP2[O O#QP2[O O#QP2ReJ�Rg	[O]P!ttoh)%fhKr9h[O O#QP2[O O#QP2h9h[O]h9h)c��UQ6Xc6UOOQ6Xc[OQ2P!P!P!)�call�has_deadlockg�������?)�f_code�co_name�time�sleep)�frame�event�args&&&r=�delay_has_deadlock�8ImportTests.test_concurrency.<locals>.delay_has_deadlock�s-�����5�<�<�#7�#7�>�#I��
�
�3��$J�r?�datac�:�[OR2RO2]PHo[OP2P![c
oSnPo=K*Po=hh9hr�)rV�settrace�wait�package�
BaseException)r�r}r�r��excs  ���r=�run�)ImportTests.test_concurrency.<locals>.run�sF������/�0��
�
���"����T�"��%���C���s�A�	A�A�A�A)�targetr�zpackage.submodule)rVr�r-r��join�dirnamer�r8�	threading�Event�Threadr&�
start_threadsr�r�r�rWre)rlr�r<rM�threadsr�r�r�s&    @@@r=�test_concurrency�ImportTests.test_concurrency�s4���	 �	������2�7�7�<�<�������(A�6�J�K�	��C�
#��2�Y��!���)��AF�q��J��A�9�+�+�3�7���J�?�)�7�7�����K�K��
�
�1�
�L��K�K�O�O�I�t�4��K�K�O�O�$7��>��?��I��������K�K�K���K�K�O�O�I�t�4��K�K�O�O�$7��>�������s\�(:G	�""E,�G	�)F�0E1	�F�AG	�G	�,G	�1F
�:F
�<F�AG�G	�	G�win32�Windows-specificc���]QHGoU[O2o[O
O
Q2Oo[OO[OOU2QOQU7cQLP22o[O29^tt^2o[OOUQ2o[OU2[OOU[OO![O"22o[$O&[O"U2[$O&V%2[(O([OO[(O*[O,2Q22FDo[$O&V�2J	[$O&V62Po	[O.T
t-tFD(p�O12[O.U
*aJ*	o	o
UQ*[2*U	Q$[4O6UQ	QOQ
QO[OOU22QQ
,2,[4O8U	[OOU2Q5[$O&VF2[4O6UQ	Q,[4O8U	[OOU2Q5PPP2P!tto
h)%fhP!9h)r)�GetModuleFileName�_sqlite3z
sqlite3{}.dll�_d�DLLszvcruntime*.dll�;�
PYTHONPATHz-Scz	import oszp = os.add_dll_directory({!r})zimport _sqlite3zp.close)r��env�cwd)�_winapir�rV�	dllhandlerQrR�	find_specrAr�r�r�r�r�r	�temp_dir�mkdir�basename�
executable�shutil�copy�globr�prefix�environ�upperr
�
subprocess�
check_call�STDOUT)rlr��dllname�pydname�depname�tmp�tmp2�pyexer`r��ks&          r=�test_dll_dependency_import�&ImportTests.test_dll_dependency_imports5��-�#�C�M�M�2���.�.�*�*�:�6�=�=���'�'�,�,��G�G�O�O�G�$��"�"�4�7�?�4��C�E���
�
�
!�
!�S��7�7�<�<��V�,�D��H�H�T�N��G�G�L�L��b�g�g�&6�&6�s�~�~�&F�G�E��K�K�����.��K�K��%��Y�Y�r�w�w�|�|�D�K�K��
�
�,C�EU�V�W�����A�#�X�
�K�K��&��C�57�Z�Z�@�Z��7�7�9�b�j�j��m�+�Z�C�@� $�s�
�Z� 7�C���
�!�!��u�c�h�h��4�;�;�������0�2�%��(��#�"�(�(���G�G�O�O�E�*�

,�
�K�K��&��!�!�5�%�1B�"C�+5�+<�+<�(+�(*������(>�
@�?"�
!��A�"�
!�
!�s&�9EM�0M�C>M�M�M!	�M!	c���UO[29^tt^2o[OQQ2PPP2UO	Q[WO22P!)%fhK79h)rMs6'�Cuz"Frozen object named 'x' is invalid)r�r��_imp�get_frozen_objectrr/r�)rlr�s& r=�test_issue105979�ImportTests.test_issue105979<sO��
�
�
�{�
+�
+�r��"�"�3�(8�9�,��
�
�:��"�,�,�'�	)�,�
+�s�A&�&A6	�/A6	c	��UO[29^tt^2o]QH
GoPPP2UO	Q[O
Q0[
WO22UO[29^tt^2o]QH"GoPPP2UO	Q[
UO22,QNoSFDboUOUQ59^tt^2Qo[OQU2oUO2vqxUO	VW2PPP2Jd	P!)%fhCK9h)%fhK�9h)%fhJ�9h)	r)�this_will_never_existz6cannot import name 'this_will_never_exist' from 'os' (�)zHcannot import name 'this_will_never_exist' from 'sys' (unknown location)�r�sGcannot import name 'this_will_never_exist' from 'os' (unknown location)r�)zb
import os
os.__spec__.has_location = False
os.__file__ = []
from os import this_will_never_exist
za
import os
os.__spec__.has_location = False
del os.__file__
from os import this_will_never_exist
zY
import os
os.__spec__.origin = []
os.__file__ = []
from os import this_will_never_exist
)
r�r�r�r�rr�r/r�rV�subTestr%r�r�)	rlr�r��scriptsr��expected_errorr�r�r�s	&        r=�$test_frozen_module_from_import_error�0ImportTests.test_frozen_module_from_import_errorCs��
�
�
�{�
+�
+�r�0�,��
�
�D�R�[�[�M�QR�S������	
��
�
�{�
+�
+�r�1�,��
�
�V������	
�

��(�F����V��,�,�4��&�2�2�4��@��!&�!2�!2�!4����
�
�n�5�-�,��C,�
+�
+��,�
+��8-�,�,�s5�D%�D9�=E	�%D6	�.D6	�9E		�E		�E
�E
c	�*�QoUQ*UQ*,oSFDcoUOUQ59^tt^2QoPPP2[OQU2oUO2vqgUO	WU2Je	P!)%fhKQ9h)z�
import sys
class NotAModule: ...
nm = NotAModule()
nm.symbol = 123
sys.modules["not_a_module"] = nm
from not_a_module import symbol
z'from not_a_module import missing_symbolz8nm.__spec__ = []
from not_a_module import missing_symbolr�s`ImportError: cannot import name 'missing_symbol' from '<unknown module name>' (unknown location)r�)r�r%r�r�r)rlr�r�r�r�r�r�r�s&       r=�!test_non_module_from_import_error�-ImportTests.test_non_module_from_import_erroros�����
�>�>��P�P�
���F����V��,�,�B��-�
"�.�.�t�V�<�E�"�.�.�0�N�F��M�M�.�&�1��,�,�s�B	�B
�B
c
��QQ,oSFCD�vq#UOUQ59^tt^2[O29^tt^2o[[O
O
UQ2QQQ59^tt^2oUOU2PPP2UQ*o[O[O
O
UQ2UQ5oUO2vq�UOV�2[OQQ	UQ5oUO2vq�UOV�2[OQ
QUQ5oUO2vq�UOV�2[OQQUQ5oUO2vq�UOUQ
2[O
O
UQ2o
[OU
2[O[O
O
UQ2U
Q5oUO2vq�UOV�2[OQQ	U
Q5oUO2vq�UOUQ
2[OQ
QU
Q5oUO2vq�UOUQ
2PPP2PPP2CJ�	P!)%fhCKH9h)%fhK39h)%fhCJ�9h)�#import fractions
fractions.Fractionr��fractions.pyr�rr� \(consider renaming '.*fractions.py' since it has the same name as the standard library module named 'fractions' and prevents importing that standard library module\)�r��-m�	fractionsr�zimport fractions�-Pr?�child�r�>AttributeError: module 'fractions' has no attribute 'Fraction'�zfrom fractions import Fractions;ImportError: cannot import name 'Fraction' from 'fractions')r�r	r�r	r�r�r�r
r%r�r�r�r�r�)rl�
script_errorsr��errorr�r`r�r�r�r��	tmp_childs&          r=�test_script_shadowing_stdlib�(ImportTests.test_script_shadowing_stdlib�s[��
�
�	
�
�+�M�F����V��,�,�i�.@�.@�.B�.B�c��"�'�'�,�,�s�N�;�S�7�S�S�WX��G�G�F�O�T�"'�N�"��&�2�2�2�7�7�<�<��^�3T�Z]�^��!&�!2�!2�!4���� � ��8�%�2�2�4��#�N��!&�!2�!2�!4���� � ��8�%�2�2�4�9K�QT�U��!&�!2�!2�!4���� � ��8�&�2�2�4��S�Q��!&�!2�!2�!4���� � ���-��G�G�L�L��g�6�	�����#�&�2�2�2�7�7�<�<��^�3T�Zc�d��!&�!2�!2�!4���� � ��8�%�2�2�4��)�T��!&�!2�!2�!4���� � ���-�%�2�2�4�9K�QZ�[��!&�!2�!2�!4���� � ���-�S/C�,�,�+�S�S�S��/C�.B��,�,�,�sN�K4	�5K!
�<K
�H(K!
�6K4	�
K�K�	K!
�!K1�*K1�,K4	�4L
�=L
c
���QQ,oSFCDvq#UOUQ59^tt^2[O29^tt^2o[O[O
O
UQ22[[O
O
UQQ2QQQ59^tt^2oUOQ2PPP2[[O
O
UQ2QQQ59^tt^2oUOQ	2UOU2PPP2UQ
*o[O[O
O
UQ2UQ5oUO2vq�UOV�2[OQQ
UQ5oUO2vq�UOV�2[OQQUQ5oUO2vq�UOUQ2PPP2PPP2CJ	P!)%fhCKb9h)%fhCK9h)%fhKG9h)%fhCJ`9h)�fractions.Fractionr�r�__init__.pyr�rr�shadowing_module = True�main.pyz-import fractions; fractions.shadowing_module
s� \(consider renaming '.*[\\/]fractions[\\/]+__init__.py' since it has the same name as the standard library module named 'fractions' and prevents importing that standard library module\)rr�mainrs6module 'fractions' has no attribute 'shadowing_module')rr
r)
r�r	r�r�r�r�r�r	r
r%r�r�r��
rlrr�r
r�r`r�r�r�r�s
&         r=�$test_package_shadowing_stdlib_module�0ImportTests.test_package_shadowing_stdlib_module�s���
�
�	
�
�+�M�F����V��,�,�i�.@�.@�.B�.B�c���������c�;�7�8���G�G�L�L��k�=�A�3�QX�����G�G�5�6���"�'�'�,�,�s�I�6��g�N�N�RS��G�G�L�M��G�G�F�O�O�"'�N�"��&�2�2�2�7�7�<�<��Y�3O�UX�Y��!&�!2�!2�!4���� � ��8�%�2�2�4��S�I��!&�!2�!2�!4���� � ��8�&�2�2�4���L��!&�!2�!2�!4���� � ��)b�c�7/C�,�,�+�����O�N�N��
/C�.B��,�,�,�sm�I	�A*I
�1H�<I
�?#H0�"C#I
�I	�H-�%H-�'	I
�0I�9I�;	I
�I�
I�I	�I)
� I)
c
��QQ
,oSFCDuvq#UOUQ59^tt^2[O29^tt^2o[[O
O
UQ2QQQ59^tt^2oUOU2PPP2UQ*o[O[O
O
UQ22oUO2vq�UOV�2[OQQUQ	5oUO2vq�UOV�2[OQ
QUQ	5oUO2vq�UOV�2PPP2PPP2CJx	P!)%fhK�9h)%fhK29h)%fhCJ�9h)�import numpy
numpy.arrayr��numpy.pyr�rrsd \(consider renaming '.*numpy.py' if it has the same name as a library you intended to import\)\s+\zr�numpyrr�zimport numpy)rs7AttributeError: module 'numpy' has no attribute 'array')zfrom numpy import arrays4ImportError: cannot import name 'array' from 'numpy'�r�r	r�r	r�r�r�r
r%r�r�r�rs
&         r=�!test_script_shadowing_third_party�-ImportTests.test_script_shadowing_third_party�sP��
�
�	
�
�+�M�F����V��,�,�i�.@�.@�.B�.B�c��"�'�'�,�,�s�J�7��w�O�O�ST��G�G�F�O�P�"'�M�"��
&�2�2�2�7�7�<�<��Z�3P�Q��!&�!2�!2�!4���� � ��8�%�2�2�4��c�J��!&�!2�!2�!4���� � ��8�%�2�2�4��S�Q��!&�!2�!2�!4���� � ��8�'/C�,�,�+�O�O��/C�.B��,�,�,�sN�F+	�5F
�<F�C F
�.F+	�F�F�F
�F(�!F(�#F+	�+F=
�4F=
c	�6�[O29^tt^2o[[OOUQ2QQQ59^tt^2oUO
Q2PPP2Qo[OQQUQ5oUO2vqVUOVS2Q	o[OQQ
UQ5oUO2vqVUOVS2PPP2P!)%fhK�9h)%fhP!9h)rr�rrz3this_script_does_not_attempt_to_import_numpy = Trues;AttributeError: module 'numpy' has no attribute 'attr'\s+\zr�zimport numpy; numpy.attrrs?ImportError: cannot import name 'attr' from 'numpy' \(.*\)\s+\zzfrom numpy import attr)r	r�r	r�r�r�r
r%r�r�r�)rlr�r`r�r�r�r�s&      r=�+test_script_maybe_not_shadowing_third_party�7ImportTests.test_script_maybe_not_shadowing_third_partys���
�
�
�
!�
!�S��b�g�g�l�l�3�
�3�S�7�K�K�q����M�N�L�P�
�"�.�.�t�5O�UX�Y�E�"�.�.�0�N�F����V�4�T�
�"�.�.�t�5M�SV�W�E�"�.�.�0�N�F����V�4�!"�
!�K�K��"�
!�
!�s0�5D�C4	�&BD�4D
�=D
�?D�D	�D	c	�
�[O29^tt^2o[[OOUQ2QQQ59^tt^2oUO
Q2PPP2[[OOUQ2QQQ59^tt^2oUO
Q2PPP2[OQUQ5oUO2vqEUOQUO22[[OOUQ2QQQ59^tt^2oUO
Q	2PPP2[OQUQ5oUO2vqEUOQUO22[[OOUQ2QQQ59^tt^2oUO
Q
2PPP2[OQUQ5oUO2vqEUO2oUO[U2]2SFDoUOUQ2J	[[OOUQ2QQQ59^tt^2oUO
Q2PPP2[OQUQ5oUO2vqEUO2oUO[U2]2SFDoUOUQ
2J	[[OOUQ2QQQ59^tt^2oUO
Q2PPP2[OQUQ5oUO2vqEUO2oUO[U2]2SFDoUOUQ2J	[[OOUQ2QQQ59^tt^2oUO
Q2PPP2[OQUQ5oUO2vqEUO2oUO[U2]2SFDoUOUQ
2J	PPP2P!)%fhCKG9h)%fhCK
9h)%fhCK�9h)%fhCK9h)%fhCKZ9h)%fhCK�9h)%fhCK9h)%fhP!9h)rr�rrrrz�
import fractions
fractions.shadowing_module
class substr(str):
    __hash__ = None
fractions.__name__ = substr('fractions')
try:
    fractions.Fraction
except TypeError as e:
    print(str(e))
rsunhashable type: 'substr'z�
import fractions
fractions.shadowing_module
class substr(str):
    __hash__ = None
fractions.__name__ = substr('fractions')
try:
    from fractions import Fraction
except TypeError as e:
    print(str(e))
ac
import fractions
fractions.shadowing_module

import sys
sys.stdlib_module_names = None
try:
    fractions.Fraction
except AttributeError as e:
    print(str(e))

del sys.stdlib_module_names
try:
    fractions.Fraction
except AttributeError as e:
    print(str(e))

sys.path = [0]
try:
    fractions.Fraction
except AttributeError as e:
    print(str(e))
s.module 'fractions' has no attribute 'Fraction'a~
import fractions
fractions.shadowing_module

import sys
sys.stdlib_module_names = None
try:
    from fractions import Fraction
except ImportError as e:
    print(str(e))

del sys.stdlib_module_names
try:
    from fractions import Fraction
except ImportError as e:
    print(str(e))

sys.path = [0]
try:
    from fractions import Fraction
except ImportError as e:
    print(str(e))
s5cannot import name 'Fraction' from 'fractions' \(.*\)z�
import fractions
fractions.shadowing_module
del fractions.__spec__.origin
try:
    fractions.Fraction
except AttributeError as e:
    print(str(e))

fractions.__spec__.origin = []
try:
    fractions.Fraction
except AttributeError as e:
    print(str(e))
a
import fractions
fractions.shadowing_module
del fractions.__spec__.origin
try:
    from fractions import Fraction
except ImportError as e:
    print(str(e))

fractions.__spec__.origin = []
try:
    from fractions import Fraction
except ImportError as e:
    print(str(e))
)r	r�r	r�r�r�r
r%r�r�r�rstrip�
splitlinesr��lenr�)rlr�r`r�r�r��lines�lines&       r=�'test_script_shadowing_stdlib_edge_cases�3ImportTests.test_script_shadowing_stdlib_edge_casess��
�
�
�
!�
!�S��b�g�g�l�l�3��7��w�O�O�ST����1�2�P��b�g�g�l�l�3�	�2�C�'�J�J�a����
�
�K�"�.�.�y�c�B�E�"�.�.�0�N�F��M�M�6��
�
��H��b�g�g�l�l�3�	�2�C�'�J�J�a����
�
�K�"�.�.�y�c�B�E�"�.�.�0�N�F��M�M�6��
�
��H��b�g�g�l�l�3�	�2�C�'�J�J�a������K�0"�.�.�y�c�B�E�"�.�.�0�N�F��%�%�'�E����S��Z��+���� � ��'X�Y���b�g�g�l�l�3�	�2�C�'�J�J�a������K�0"�.�.�y�c�B�E�"�.�.�0�N�F��%�%�'�E����S��Z��+���� � ��'`�a���b�g�g�l�l�3�	�2�C�'�J�J�a������K�""�.�.�y�c�B�E�"�.�.�0�N�F��%�%�'�E����S��Z��+���� � ��'X�Y���b�g�g�l�l�3�	�2�C�'�J�J�a������K� "�.�.�y�c�B�E�"�.�.�0�N�F��%�%�'�E����S��Z��+���� � ��'`�a��e"�
!�O�O�O��K�J�J�� K�J�J��$K�J�J��>K�J�J��@K�J�J��0K�J�J��}"�
!�
!�s��5T0�R$	�&<T0�"R8	�4BT0�:S	�BT0�S 	�$B-T0�S4	�#B-T0�T	�"B-T0�T	�!A9T0�$R5
�-R5
�/	T0�8S	
�S	
�	T0�S
�S
�	T0� S1
�)S1
�+	T0�4T
�=T
�?	T0�T
�T
�	T0�T-
�%T-
�'	T0�0U	�9U	zCannot delete cwd on Windows�sunos5z$Cannot delete cwd on Solaris/Illumos�aixzCannot delete cwd on AIXc	�&�[O29^tt^2o[OO	UQ2o[O
U2[
[OO	UQ2QQQ59^tt^2oUOQ2PPP2[OQQUQ5oUO2vqVQ	oUOVW2PPP2P!)%fhKX9h)%fhP!9h)
�subtmprr�rrzl
import sys
assert sys.path[0] == ''

import os
import shutil
shutil.rmtree(os.getcwd())

os.does_not_exist
r�zimport mainrs=AttributeError: module 'os' has no attribute 'does_not_exist')r	r�r�r�r�r�r	r
r%r�r�r�)rlr�r/r`r�r�r�r�s&       r=�(test_script_shadowing_stdlib_cwd_failure�4ImportTests.test_script_shadowing_stdlib_cwd_failure�s����
�
�
!�
!�S��W�W�\�\�#�x�0�F��H�H�V���b�g�g�l�l�6�9�5�s�W�M�M�QR����	�	�N�"�.�.�t�]��O�E�"�.�.�0�N�F�^�N����V�4�%"�
!�N�M��"�
!�
!�s1�A+C?�
C,	�AC?�,C<
�5C<
�7C?�?D	�D	c
�<�QQ,oSFCD@vq#UOUQ59^tt^2[O29^tt^2o[[O
O
UQ2QQQ59^tt^2oUOQ2PPP2[[O
O
UQ2QQQ59^tt^2oUOQ2UOU2PPP2UQ	*o[OQUQ
5oUO2vq�UOV�2PPP2PPP2CJC	P!)%fhK�9h)%fhK~9h)%fhKE9h)%fhCJ�9h)
rr�rr�rrrrz=import sys; sys.path.insert(0, "this_folder_does_not_exist")
rrr	rrrs
&         r=�2test_script_shadowing_stdlib_sys_path_modification�>ImportTests.test_script_shadowing_stdlib_sys_path_modification�s'��
�
�	
�
�+�M�F����V��,�,�i�.@�.@�.B�.B�c��"�'�'�,�,�s�N�;�S�7�S�S�WX��G�G�5�6�T��"�'�'�,�,�s�I�6��g�N�N�RS��G�G�\�]��G�G�F�O�O�"'�N�"��&�2�2�9�#�F��!&�!2�!2�!4���� � ��8�/C�,�,�+�S�S��N�N��/C�.B��,�,�,�sl�F		�5E6
�<E�<E6
�
#E#�-AE6
�9F		�E �E �E6
�#E3�,E3�.E6
�6F�?F�F		�	F
�F
c��UO[Q29^tt^2QQ2o[OU22PPP2UO[Q29^tt^2QQ2o[OU22PPP2P!)%fhK^9h)%fhP!9h)zembedded null characterc� �\sQsQsQsQsQsP!)�2ImportTests.test_create_dynamic_null.<locals>.Speci��ab�abcr�r�r�r�r�r_rAr�rr?r=�Specr7�s�����r?r;c� �\sQsQsQsQsQsP!)�3ImportTests.test_create_dynamic_null.<locals>.Spec2i�r9r8rr:rr?r=�Spec2r=�s����!�r?r>)r�
ValueErrorr��create_dynamic)rlr;r>s&  r=�test_create_dynamic_null�$ImportTests.test_create_dynamic_null�s���
�
#�
#�J�0I�
J�
J�
�
�
�����'�	K��
#�
#�J�0I�
J�
J�
"�
"�
�����(�	K�
J�
K�
J��K�
J�
J�s#�&B�,&B/�B,	�%B,	�/C	�8C	c��QQ2oU2oQUmUO[OU2[2PUmUO[Q29^tt^2[OU2PPP2QUmUO[29^tt^2[OU2PPP2PUmUO[Q29^tt^2[OU2PPP2P!)%fhK�9h)%fhKi9h)%fhP!9h)c��\sQsQsQsP!)�-ImportTests.test_create_builtin.<locals>.Speci�r�r�r�r�r�r�rr?r=r;rE����r?r;rVz!name must be string, not NoneType�nonexistent_libzname must not be empty)
r_rJr��create_builtinrVrrr�r�r?)rlr;rXs&  r=�test_create_builtin�ImportTests.test_create_builtin�s���	�	��v����	��
�
�d�)�)�$�/��5���	�
�
#�
#�I�/R�
S�
S�����%�T�&��	�
�
�
�2�
3�
3�����%�4���	�
�
#�
#�J�0H�
I�
I�����%�J�
I�T�
S��
4�
3��
J�
I�
I�s6�)D�,D$�0D7�D!	�D!	�$D4	�-D4	�7E	�E	c�"�Qo[Q2[O29^tt^2o[U29^tt^2[O
P	Q59^tt^2o[OQ2[OQUQ5[OQQQ5]PH"oPPP2PPP2PPP2UO[QW22,QN2WOOOOoSFD?oUOUOU2UO!UO"[$2JA	P!)%fhK�9h)%fhK�9h)%fhK�9h)	z*test\.test_import\.data\.syntax_warnings\zz%test.test_import.data.syntax_warnings)�recordr
�always)r7�syntax_warningsc3�D�SF �DpOw�	J	P!3hrE)�lineno)�.0�wms& r=�	<genexpr>�DImportTests.test_filter_syntax_warnings_by_module.<locals>.<genexpr>s��D���D�b�	�	�D�s� )���
�
��)rr	r�r(�warnings�catch_warnings�simplefilter�filterwarnings�%test.test_import.data.syntax_warningsr��sortedr1r�rOr�rMrJ�category�
SyntaxWarning)rl�	module_re�tmpdir�wlogrHrMrSs&      r=�%test_filter_syntax_warnings_by_module�1ImportTests.test_filter_syntax_warnings_by_modules��A�	��6�7�� � �"�"�f�&�v�.�.��%�%�T�2�2�d��!�!�'�*��#�#�H�Y�?��#�#�G�4E�F�8�	3�/�#�	
����9�D�9�9�;Q�R��#�#�(�(�8�8�A�A���B����R�[�[�(�3��M�M�"�+�+�}�5��3�2��/�.��#�"�sN�E>� E+	� AE
�+E+	�3E>�E(�!E(�#E+	�+E;
�4E;
�6E>�>F	�F	r)�longlist)<r�r�r�r�r�r�r�r�r�r�r�r
r�r�rrrrr1r>rErOrSrY�skip_if_dont_write_bytecoder`rhror~r�r�r�r�r�r�r&�requires_working_threadingr�r4�
skipUnlessrVr/r�r�r�r�rrrr"r*rqr0r0r3rArJrgr�r�r�s@r=r�r�as�����&��<�3�F�K�h�����*-�+�7�(�7�'�R%�N!�(	3�3�"$�L!�(�!�(�.�	/�!�!�!�!�29��.��.�"�!�c� �	"��	"��0�0�2� �3� �D�������0�2D�E�*@�F�*@�X)�*6�X2�.5.�n'd�R9�B5�&Tb�l�_�_�S�\�\�W�,�.L�M�
�_�_�S�\�\�X�-�/U�V�
�_�_�S�\�\�,�,�U�3�5O�P�5�Q�W�N�5�*9�8)�&�,6�6r?r�c�t`�\sQsQsn\O
\OQ6HQ2\O\	Q2Q22s
\O
\OQ6HQ2\OQ22s
\O
\OQ6HQ2\OQ22sQsQ	sUsP!)
�FilePermissionTestsi�posix�%test meaningful only on posix systemsz$Emscripten's/WASI's umask is a stub.c	�J�]o[U29^tt^2[29^tt^2vq#[OO	U2o[U2o[OOU2%fUOQ2[OU2oPPP2PPP2UO[[OWO22[QU&*22P!)%fhKd9h)%fhKo9h)��4__import__ did not result in creation of a .pyc file�)r#rrQrRrur0r�r��existsr$r{r��oct�S_IMODE�st_mode)rl�maskr_r��cached_pathr7�	stat_infos&      r=�test_creation_mode�&FilePermissionTests.test_creation_modes�����
��
�
��0�0�L�T�#�.�.�:�:�4�@�K���%�F��7�7�>�>�+�.�.��	�	�(�)�����,�I�
 1�
�	
����T�\�\�)�*;�*;�<�=��U�d�U�]�+�	-� 1�0��
�
�s5�D�AC?	�<'C?	�#D�?D
�D
�
D�D"	�D"	c	�f�Qo[]29^tt^2[29^tt^2vq#[OO	U2o[
OV12[U2[
OOU2%fUOQ2[
OU2oPPP2PPP2UO[[OWO22[U22P!)%fhK\9h)%fhKg9h)�rs�r#rrQrRrur��chmodr0r�rur$r{r�rvrwrx)rl�moder_r�rzr{s&     r=�test_cached_mode_issue_2051�/FilePermissionTests.test_cached_mode_issue_20511s���
��
��
�
�� 1� 1�\�d�#�.�.�:�:�4�@�K��H�H�T� ��t���7�7�>�>�+�.�.��	�	�(�)�����,�I�!2�
�	
����T�\�\�)�*;�*;�<�=�s�4�y�I�!2� 1��
�
�s5�D �A'D
	�'D
	�9D �
D
�D
�D � D0	�)D0	c	�x�Qo[]29^tt^2[29^tt^2vq#[OO	U2o[
OV12[U2[
OOU2%fUOQ2[
OU2oPPP2PPP2U]�*oUO[[OWO22[U22P!)%fhKe9h)%fhKp9h)�rsr�)rlr�r_r�rzr{r:s&      r=�test_cached_readonly�(FilePermissionTests.test_cached_readonlyBs�����
��
�
�� 1� 1�\�d�#�.�.�:�:�4�@�K��H�H�T� ��t���7�7�>�>�+�.�.��	�	�(�)�����,�I�!2�
��%�<������T�\�\�)�*;�*;�<�=�s�8�}�M�!2� 1��
�
�s5�D)�A'D	�'D	�9D)�D&
�D&
�!D)�)D9	�2D9	c	�b�[29^tt^2vq[UQQQ59^tt^2oUOQ2PPP2[OU2o[O
V$OUOQ*
12[OUQ2[U2oUOUOQ2[OUQ2[UQQQ59^tt^2oUOQ2PPP2[U2[O2[U2oUOUOQ	2[U2[U2[O2UQ
*o[O [O"O%U2U2[U2oUOUOQ	2PPP2P!)%fhCK�9h)%fhCK9h)%fhP!9h)r�rrzx = 'original'
i�r��originalrzx = 'rewritten'
�	rewrittenr6)rr	r
r�r{rv�st_atime�st_mtimer�r0r�rMrrQr�r�renamerRru)rlr_r�r`�s�m�
bytecode_onlys&      r=�test_pyc_always_writable�,FilePermissionTests.test_pyc_always_writableSsw���
�
�,�4��d�C�'�2�2�a����*�+�3�����
�A��H�H�T�J�J��
�
�9�(<�=�>��H�H�T�5�!��4� �A����Q�S�S�*�-��H�H�T�5�!��d�C�'�2�2�a����+�,�3��4�L��'�'�)��4� �A����Q�S�S�+�.��4�L��4�L��'�'�)� �3�J�M��I�I�i�n�n�6�6�t�<�m�L��4� �A����Q�S�S�+�.�3�
�2�2�2��3�2�2���
�
�sM�H�G5	�B<H�;H		�
CH�5H
�>H
�	H�	H
�H
�	H�H.	�&H.	r)r�r�r�r�r4rlr�r_rqrr|r	�skip_unless_working_chmodr�r�r�r�r�r�s@r=rnrns�����������G�+�@�B�
�_�_��.��
-�	�B�
-�������G�+�@�B��(�(�J�)�B�J�������G�+�@�B��(�(�N�)�B�N�/�/r?rnc�`�\sQsQsnQsQs\OO\	2s
\OO\
\2\O*Q*s
\OO!\
2sQsQsQsQs\O0\O4O6PIQ	2Q
2sQsQsQ
sUs P!\cPsKRh9h)�PycRewritingTestsir�unlikely_module_namez�
import sys
code_filename = sys._getframe().f_code.co_filename
module_filename = __file__
constant = 1000
def func():
    pass
func_filename = func.__code__.co_filename
rVc�
�[OQ*Um[OO	UO
P2Um[OUO2[UOQQQ59^tt^2oUOUO2PPP2[OO]UO2[O 2P!)%fhKQ9h)�NNNr�rr)rVr��sys_pathrWrer��orig_moduler�r��dir_namer	�	file_namer
�
module_sourcer-rQr�)rlr`s& r=r��PycRewritingTests.setUp�s���������
��;�;�?�?�4�+;�+;�T�B���
�������
�$�.�.�#��
8�
8�A�
�G�G�D�&�&�'�9�������4�=�=�)��#�#�%�9�
8�s�
C2�2D	�;D	c�z�UO[OQ$UOd)UO[OUO
$L[
UO
2[UO2UO%c[UO2[UO2P!�r�)r�rVr�r�rWr�rrr��
compiled_namer"r�r�s&r=r��PycRewritingTests.tearDown�sy���m�m���������'�,0�,<�,<�C�K�K��(�(�)��4�#�#�$��t�~�~�������4�%�%�&��t�}�}�r?c��[2o[UOV2[OUO*!rE)rr0r�rVrW)rlr{s& r=r �PycRewritingTests.import_module�s.��
�Y���4�#�#�R�,��{�{�4�+�+�,�,r?c�F�UO2oUOUOUO2UOUOUO2UOUO
UO2[OUOUO2oUOUOUO2UOUOUO2UOUO
UO2P!rE)	r r��module_filenamer��
code_filename�
func_filenamerVrWr��rlr�s& r=�test_basics�PycRewritingTests.test_basics�s���� � �"������,�,�d�n�n�=�����*�*�D�N�N�;�����*�*�D�N�N�;��K�K��(�(�)�� � �"������,�,�d�n�n�=�����*�*�D�N�N�;�����*�*�D�N�N�;r?z1requires sys.implementation.cache_tag is not Nonec�P�[OUOQQ5UO2oUO	UO
UO2UO	UOUO2UO	UOUO2P!)�another_module.py��dfile)�
py_compile�compiler�r r�r�r�r�r�s& r=�test_incorrect_code_name�*PycRewritingTests.test_incorrect_code_name�su��	���4�>�>�1D�E�� � �"������,�,�d�n�n�=�����*�*�D�N�N�;�����*�*�D�N�N�;r?c��QoUOQ*o[OUOV!Q5[OUO2[
O2UO2oUOUOU2UOUOU2UOUOU2P!)r�r6r�)r�r�r�r�r]rQr�r r�r�r�r�)rlr��pyc_filer�s&   r=�test_module_without_source�,PycRewritingTests.test_module_without_source�s���$���>�>�C�'�����4�>�>�8�B�
�	�	�$�.�.�!��#�#�%�� � �"������,�,�h�7�����*�*�F�3�����*�*�F�3r?c��UO9%fUOQ*o[OUOU2[	UQ29^tt^2oUO]2o[OU2oPPP2[WO2o[OOoUOQ2oVeU$UO[U2Q5o[	UQ29^tt^2oUO!W2[O"VB2PPP2UO%f![$O&UO2UO2oUO)UO*O,UO,2P!)%fhCK(9h)%fhK�9h)r6�rbr�)�	co_consts�wb)r�r�r�r�r	r��marshal�load�listr�rQr �__code__�index�replacer�r
�dumpr�r]r��constant�co_filename)	rlr�r`�header�code�	constants�foreign_code�posr�s	&        r=�test_foreign_code�#PycRewritingTests.test_foreign_code�s7���*�*�D�D�t�~�~��/C�
����4�>�>�=�9�
�-��
&�
&�!��V�V�B�Z�F��<�<��?�D�'�����(�	� �.�.�7�7���o�o�d�#��%�#���|�|�e�I�&6�|�7��
�-��
&�
&�!�
�G�G�F�O��L�L��!�'��!�!�!��I�I�d�n�n�%�� � �"��������1�1�<�3K�3K�L�'�
&�
&��'�
&�s$�(F%�(F9�%F6	�.F6	�9G		�G		)r�r�)!r�r�r�r�r�r�r�r�rcr!r�r�rWr�rQrRrur��NotImplementedErrorr�r�r r�r4rqrV�implementation�	cache_tagr�r�r�r�r�r�s@r=r�r�rs�����
)�K��M��w�w���v�&�H������X�{�3�b�i�i�?�$�F�I��!���8�8��C�
�&�	�-�
	<��_�_�S�'�'�1�1�T�9�H�J�<�J�<�	4�M�M��w���
��s�C�C
�C
�C
r�c�`�\sQsQsnQ	s\sQsQsQs	\
O\OQ6HQ2Q2sQsUsP!)
�
PathsTestsi�c��[OUO2[OQ*UmP!r�)r�r�r�rV�syspathr�s&r=r��PathsTests.setUp�s!��
��������x�x��{��r?c�l�[UO2UO[OQ$P!r�)r"r�r�rVr�s&r=r��PathsTests.tearDown�s���t�y�y���l�l�����r?c��[[OOUOQ2QQQ59^tt^2oUO	Q2PPP2[
OO
UOQ*2[Q2oUOUOQ2[Q2P!)%fhKt9h)ztest_trailing_slash.pyr�rrz testdata = 'test_trailing_slash'�/�test_trailing_slash)r	r�r�r�r
rVr9r0r��testdatar)rlr`r�s&  r=r��PathsTests.test_trailing_slash�s���
�"�'�'�,�,�t�y�y�*B�C���)�)�,-�
�G�G�6�7�)�	������	�	�#�
�&��.�/��������'<�=��$�%�
)�)�s�B>�>C	�C	r�r�c��[[OOUOQ2Q29^tt^2oUO	Q2PPP2[
O2[OOUO2o]PH"oUO2oU]*oQU8QU8Q0oVbQ**
o[OU2["OO%]U2['Q2oUO-WO.Q2UO1UO2U2[5Q2P!)%fhCK9h[cZoSO[O[O[O17cSO!QS802gPo=hh9h[(c$oSO+Q	S8Q
S802Po=K�Po=hh9h)ztest_unc_path.pyr�ztestdata = 'test_unc_path'z\\�\�$�rBNNz#cannot access administrative share �
test_unc_pathz&could not import 'test_unc_path' from z: )r	r�r�r�r
rQr�rc�socket�gethostname�listdirrxry�EPERM�EACCES�ENOENTrgrVr-r0r�r$r�r��assertStartsWithr�r)	rlr`r�r��hn�drive�uncr}r�s	&        r=�
test_UNC_path�PathsTests.test_UNC_path�si��
�"�'�'�,�,�t�y�y�*<�=�s�
C�
C�q�
�G�G�0�1�D��#�#�%��w�w���t�y�y�)���
�
�
�
!���Q�����'���B�x���	��J�J�s�O�	������3��	"��_�-�C�	
�������7����c�l�l�C�0����3D�
C�
C���	��w�w�5�;�;����e�l�l�C�C��
�
��N�O���		���	"��I�I��a�!�
"�
"��	"�sS�E�E)�G�E&	�E&	�)	G
�3G
�4=G�2G�G
�	G>�G>�G9�9G>)r�)rHutestäöüßutestéèu
test°³²)r�r�r�r��SAMPLESr!r�r�r�r�r4rlrVr/r�r�r�r�s@r=r�r��sL����)�G��D�#�#�
&��������0�2D�E� �F� r?r�c�\`�\sQsQsnQs\sQsQsQsQs	Qs
QsQ	sQ
s
QsUsP!)�RelativeImportTestsi
c��[Q2P!)ztest.relimport)rr�s&r=r��RelativeImportTests.tearDowns���� r?c�8�]QHGoUOUQ2P!)rB)�	relimportr�)rkr�rK)rlr�s& r=�test_relimport_star�'RelativeImportTests.test_relimport_stars�� ����9�&;�<r?c�F`�U1Qko[QQQ5nU2[QQQ5nU2[QQQ5nUO[U2[QQQ5nUO[U2[[2Q5nUO[U2P!)c�":�[QR2P!)zfrom . import relimport)r)r{s�r=�check_relative�:RelativeImportTests.test_issue3221.<locals>.check_relatives����*�B�/r?rHztest.notarealmodule)�__package__r�znotarealpkg.notarealmoduler�)r�)�dictr�r��objectr)rlr�r{s& @r=�test_issue3221�"RelativeImportTests.test_issue3221s����	0��f�/D�
E�����f�/K�
L�����e�.C�
D�����-�~�>��e�.J�
K�����-�~�>��f�h�
'�����)�^�4r?c�:�[OQQQQ2P!)z-W�ignorer�zfoo = 1; from . import foo)r%�assert_python_failurer�s&r=�)test_parentless_import_shadowed_by_global�=RelativeImportTests.test_parentless_import_shadowed_by_global2s���+�+�D�(�D�(�	*r?c��UO[29^tt^2]QH
GoUO	Q2PPP2P!)%fhP!9h)rA)�sepz>explicit relative import triggered an implicit absolute import)r�r�r�rr$)rlrs& r=�#test_absolute_import_without_future�7RelativeImportTests.test_absolute_import_without_future7s8���
�
�{�
+�
+���I�I�1�
2�,�
+�
+�
+�s�A�A	�
A	c�F�[OO[OO[2QQ2o[QQ29^tt^2[
U29^tt^2UO[29^tt^2]PH&oPPP2UOQ[O2UOQ[O2PPP2PPP2P!)%fhKb9h)%fhK-9h)%fhP!9h)r��package2�
submodule1�
submodule2)
r�r�r�r�r�r'rr�r�r
rrVrW)rlr�r
s&  r=�test_import_from_non_package�0RelativeImportTests.test_import_from_non_package@s����w�w�|�|�B�G�G�O�O�H�5�v�z�J��
�\�<�
0�
0�-��2E�2E��"�"�;�/�/�!�0����\�3�;�;�7����\�3�;�;�7�	3F�
0�
0�/�/��3F�2E��
0�
0�
0�sO�D�,C<	�
C)
�AC<	�D�)C9�2C9�4C<	�<D
�D
�D�D 	�D 	c	�|�[QQQ29^tt^2[[OO	[OO[2Q229^tt^2]PHoUOOPPP2PPP2P!)%fhK9h)%fhP!9h)r	zpackage2.submodule1zpackage2.submodule2r�)
r'rr�r�r�r�r��package2.submodule1r
r)rlr	s& r=�!test_import_from_unloaded_package�5RelativeImportTests.test_import_from_unloaded_packageHso��
�Z�!6�8M�
N�
N�
�2�7�7�<�<�������(A�6�J�
K�
K�&����*�*�L�O�
N�
K�
K��O�
N�
N�s0�AB*�*B	�B*�B'
� B'
�"B*�*B;	�3B;	c	��[OO[OO[2Q2o[QQ29^tt^2[
U29^tt^2]QHGoUOUOQ2]PH.GoUOUOQ2PPP2PPP2[QQ29^tt^2[
U29^tt^2]PH.GoUOUOQ2]QHGoUOUOQ2PPP2PPP2P!)%fhK�9h)%fhK�9h)%fhK@9h)%fhP!9h)r��package3zpackage3.submodule��	submodule�rebound)r�r�r�r�r�r'rrrr��attr�package3.submodule�rlr�rs&  r=�test_rebinding�"RelativeImportTests.test_rebindingNs����w�w�|�|�B�G�G�O�O�H�5�v�>��
�Z�!5�
6�
6�
�d�8K�8K�*����Y�^�^�Y�7�2����Y�^�^�Y�7�	9L�
6�
�Z�!5�
6�
6�
�d�8K�8K�2����Y�^�^�Y�7�*����Y�^�^�Y�7�	9L�
6�
6�9L�8K��
6�
6��
9L�8K��
6�
6�
6��b�E�+AD?	�0E�E8�(AE%	�-E8�?E
�E
�
E�E"	�E"	�%E5
�.E5
�0E8�8F		�F		c	��[OO[OO[2Q2o[QQ29^tt^2[
U29^tt^2]PHGoUOUOQ2]QH.GoUOUOQ2PPP2PPP2[QQ29^tt^2[
U29^tt^2]QH.GoUOUOQ2]PHGoUOUOQ2PPP2PPP2P!)%fhK�9h)%fhK�9h)%fhK@9h)%fhP!9h)r��package4zpackage4.submodulerrrA)r�r�r�r�r�r'r�package4.submodulerr�rrrs&  r=�test_rebinding2�#RelativeImportTests.test_rebinding2]s����w�w�|�|�B�G�G�O�O�H�5�v�>��
�Z�!5�
6�
6�
�d�8K�8K�2����Y�^�^�[�9�*����Y�^�^�[�9�	9L�
6�
�Z�!5�
6�
6�
�d�8K�8K�*����Y�^�^�X�6�2����Y�^�^�[�9�	9L�
6�
6�9L�8K��
6�
6��
9L�8K��
6�
6�
6�rr)r�r�r�r�r�r�r�r�rrrrrr r�r�r�s@r=r�r�
s<����!��E�=�
5�:*�
2�8�+�
8�:�:r?r�c�(`�\sQsQsnQsQsUsP!)�OverridingImportBuiltinTestsikc��]PHoQoUOU2U2[[QQ29^tt^2UOU2]2PPP2[	[2QQ29^tt^2UOU2U2PPP2P!)%fhKP9h)%fhP!9h)rc��]PHoU!r��r�r&s r=r��?OverridingImportBuiltinTests.test_override_builtin.<locals>.foops
����Ir?r0c��]!��r�rMs*r=�<lambda>�DOverridingImportBuiltinTests.test_override_builtin.<locals>.<lambda>us��!r?c��]!r)rr+s*r=r,r-{s��1r?)r�r�r�builtinsrr)rlr�r�s&  r=�test_override_builtin�2OverridingImportBuiltinTests.test_override_builtinls����	�	
������#�
�x��|�
<�
<����S�U�A�&�=��w�y�,��
=�
=����S�U�B�'�>�
=�
=�
<��>�
=�
=�s#�B�8B-�B*	�#B*	�-B>	�6B>	r)r�r�r�r�r0r�r�r�s@r=r#r#ks����(�(r?r#c�(`�\sQsQsnQsQsQs\Q2s\	O\OQ6HQ2\\
O\
O\	O \Q2Q	22222s\Q
2s\Q2sQsQ
sUsP!)�PycacheTestsic�f�[[2[Q2[UO2P!)r^)rr!r"rr(r�s&r=�_clean�PycacheTests._clean�s���v���}���t�{�{�r?c��[OUmP[m[Q*UmUO2[
UOQQQ59^tt^2o[QUQ5PPP2[OO][O2[O2P!)%fhKU9h)Nr[r�rrz/# This is a test file written by test_import.pyr)rV�pycache_prefix�_orig_pycache_prefixr!r(r5r	r!r�r-r�r.rQr�)rl�fps& r=r��PycacheTests.setUp�s~��%(�$6�$6��!�!����u�n������
�
�$�+�+�s�W�
5�
5���C�"�M�6�������2�9�9�%��#�#�%�6�
5�s�$B?�?C	�C	c���[O]*[O6XfPQ2g[O]UO	2UO
[mP!)rzUnexpected sys.path[0])rVr�r�r.r5r9r8r�s&r=r��PycacheTests.tearDown�sD���x�x��{�b�i�i�'�A�)A�A�'��H�H�Q�K����
�!�6�6��r?c��UO[OOQ22[	[
2UO
[OOQ22[OOUO2oUO
[OOU2QOU[
22P!)r^z*bytecode file {!r} for {!r} does not exist)�assertFalser�r�rur0r!�
assertTruerQrRrur(r��rl�pyc_paths& r=�test_import_pyc_path�!PycacheTests.test_import_pyc_path�s�����������
�6�7��6����������}�5�6��>�>�3�3�D�K�K�@����������x�0� � &��x�� 8�	:r?rorpzumask is a stubc��[]�29^tt^2[[2PPP2UO[O
O
Q22[OOUO2oUO[O
O
U2QOU[22P!)%fhK�9h)�r^z"bytecode file {!r} for {!r} exists)
r#r0r!r@r�r�rurQrRrur(r?r�rAs& r=�test_unwritable_directory�&PycacheTests.test_unwritable_directory�s�����
�
��v�����������}�5�6��>�>�3�3�D�K�K�@�����������1�!�!'���&�!9�	;�	�
�s�C	�	C	�C	c��[[2[OO	UO
2oUO
[OOU22[OUO
2[[2[O2UO[[[2P!rE)r0r!rQrRrur(r@r�r�rur]rr�r�r�)rlr�s& r=�test_missing_source� PycacheTests.test_missing_source�sr��	�6���>�>�3�3�D�K�K�@����������x�0�1�
�	�	�$�+�+���v���#�#�%����+�z�6�:r?c	�.�[[2[UO2o[O
UO2[
[2[O2[[2oUOUO[OO[O2[OOU222[O
U2P![O
S2h9hrE)r0r!rr(r�r]rrQr�r�r�r�r��getcwd�relpath)rlr�r�s&  r=�test_missing_source_legacy�'PycacheTests.test_missing_source_legacy�s���	�6��"�4�;�;�/��
�	�	�$�+�+���v���#�#�%��v���	 ����Q�Z�Z��W�W�\�\�"�)�)�+�r�w�w���x�7P�Q�
S�
�I�I�h���B�I�I�h��s
�:A*C<�<Dc�,�[[2[[2[UOQQQ59^tt^2o[QUQ5PPP2[[2oUO
UO]2P!)%fhK=9h)r%rrzx = 5r)r0r!rr	r(r!r�rM)rlr:r�s&  r=�test_recompute_pyc_same_second�+PycacheTests.test_recompute_pyc_same_second�s^��	�6���v��
�$�+�+�s�W�
5�
5���'��#�6��v���������a� �6�
5�s�B�B	�B	)r9r()r�r�r�r�r5r�r�rjrCr4rlr�r_r	r��skip_if_dac_overriderqrrGrJrOrRr�r�r�s@r=r3r3s������
&�7�!�:�!�:�������G�+�@�B� ��(�(��#�#�
�_�_�]�$5�6�	;�7�$�)�!�B�	;�!�	;�!�	;�!� �!� �$!�!r?r3c��`�\sQsQsnQs\Q*sQsQs\O\
\Q2%(9%f\O2Q
6�Q2\
OQ22sQ	sUsP!)�TestSymbolicallyLinkedPackagei��samplez-taggedc�
�[OUO2[OUO2[O
Q*Um[OUO2UO[OUO2[O
OUOQ2o[OU2[O
OU2%fPg[OUOUOP	Q5UO[OUO2[O 2UO#[O
O%UO2P	2[O
O'[O
OUOQ22%fPgP!)r�r)�target_is_directory)r	r"�tagged�package_namerVr��
orig_sys_pathr�r�r�r��create_empty_fileru�symlinkrrQr�r��isdir�isfile)rl�	init_files& r=r��#TestSymbolicallyLinkedPackage.setUp�s4��������%�����*�*�+� �X�X�a�[���	����������	�(�(�$�+�+�6��G�G�L�L����m�<�	��#�#�I�.��w�w�~�~�i�(�(�(�(�	�
�
�4�;�;�� 1� 1�t�L����	�(�(�$�*;�*;�<��#�#�%���������t�'8�'8�9�4�@��w�w�~�~�b�g�g�l�l�4�+<�+<�m�L�M�M�M�Mr?c�B�UO[OQ$P!r�)r\rVr�r�s&r=r��&TestSymbolicallyLinkedPackage.tearDown�s���(�(�����r?�getwindowsversionzWindows Vista or later requiredc�p�Q,[OQ$[OOUO2%fPg[OO[OOUOQ22%fPg[OUO2P!)�.r�r)rVr�r�rur[r�rQr r�s&r=�test_symlinked_dir_importable�;TestSymbolicallyLinkedPackage.test_symlinked_dir_importable�sv���e�������w�w�~�~�d�/�/�0�0�0�0��w�w�~�~�b�g�g�l�l�4�+<�+<�m�L�M�M�M�M�	���� 1� 1�2r?)r\)�r)r�r�r�r�r[rZr�r�r4rlr�rVrer	�skip_unless_symlinkrhr�r�r�s@r=rVrV�sz�����L�
�I�
%�F�N�.)�����C�,�-�-�	-�	-�� � �"�f�,�)�+��"�"�3�#�	+�
3r?rVc�:`�\sQsQsnQsQsQsQsQsUs	P!)�ImportlibBootstrapTestsi
c�X�[OQ*oUOU2P!)�_frozen_importlib)rVrWr@r�s& r=�test_frozen_importlib�-ImportlibBootstrapTests.test_frozen_importlibs���k�k�-�.������r?c��]QHGo[OQ*oUO	V!2UOUOQ2UOUOQ2UOUOQ2P!)r)�
_bootstraprozimportlib._bootstraprQz
_bootstrap.py)
rQrsrVrWrJr�r�r�r\r�)rlrsr�s&  r=�"test_frozen_importlib_is_bootstrap�:ImportlibBootstrapTests.test_frozen_importlib_is_bootstraps]��(��k�k�-�.���
�
�c�&�������'=�>�������+�6����C�L�L�/�:r?c��]QHGo[OQ*oUO	V!2UOUOQ2UOUOQ2UOUOQ2P!)r)�_bootstrap_external�_frozen_importlib_externalzimportlib._bootstrap_externalrQz_bootstrap_external.py)
rQrwrVrWrJr�r�r�r\r�)rlrwr�s&  r=�4test_frozen_importlib_external_is_bootstrap_external�LImportlibBootstrapTests.test_frozen_importlib_external_is_bootstrap_externals^��1��k�k�6�7���
�
�c�/�������'F�G�������+�6����C�L�L�*B�Cr?c��]QHGo[OQ*oUO	UO
UO
2P!)r)�	machineryro)rQr|rVrWrJ�
ModuleSpec)rlr|r�s&  r=�test_there_can_be_only_one�2ImportlibBootstrapTests.test_there_can_be_only_one%s.��	(��k�k�-�.���
�
�i�*�*�C�N�N�;r?r)
r�r�r�r�rprtryr~r�r�r�s@r=rmrm
s�����;�D�<�<r?rmc�8`�\sQsQsnQsQsQsQsQsUs	P!)�GetSourcefileTestsi.z�Test importlib._bootstrap_external._get_sourcefile() as used by the C API.

Because of the peculiarities of the need of this function, the tests are
knowingly whitebox tests.

c��[OQ29^tt^2oP	Um[Q*o[Q*oUO	[U2U2PPP2P!)%fhP!9h)�*importlib._bootstrap_external._path_isfiler\r[�r�patch�return_valuer!r�r)rl�_path_isfiler��expects&   r=�test_get_sourcefile�&GetSourcefileTests.test_get_sourcefile8sU���Z�Z�D�
E�
E��(,�L�%��F�?�D��e�^�F����_�T�2�F�;�	F�
E�
E�
E�s�=A'�'A8	�0A8	c���[OQ29^tt^2oP
Um[Q*oUO	[U2U2PPP2P!)%fhP!9h)r�r\r�)rlr�r�s&  r=�test_get_sourcefile_no_source�0GetSourcefileTests.test_get_sourcefile_no_sourceAsL���Z�Z�D�
E�
E��(-�L�%��F�?�D����_�T�2�D�9�F�
E�
E�
E�s�0A�A+	�#A+	c�X�[Q*oUO[U2U2P!)z.bad_ext)r!r�r)rlr�s& r=�test_get_sourcefile_bad_ext�.GetSourcefileTests.test_get_sourcefile_bad_extIs#���
�"�������.��5r?r)
r�r�r�r�r�r�r�r�r�r�r�s@r=r�r�.s�����<�:�6�6r?r�c�`�\sQsQsnQsQsQQksQsQsQs	Qs
Q	sQ
sQs
QsQ
sQsQs\Q2s\O*\Q2Q2sQsUsP!)�ImportTracebackTestsiPc��[O[2[OQ*Um[OO
][2P!r�)r�r�r!rVr��old_pathr-r�s&r=r��ImportTracebackTests.setUpRs/��
�����������
�������6�"r?c�`�UO[OQ$[[2P!r�)r�rVr�r"r!r�s&r=r��ImportTracebackTests.tearDownWs���m�m�������v�r?c�8�[OO[V*2o[	UQQQ59^tt^2oUOU2PPP2UO
[U2[O2U!)%fhK=9h)r�rr)
r�r�r�r!r	r
r�rrQr�)rlr��contentsr'�fnamer`s&&&&  r=�
create_module�"ImportTracebackTests.create_module[sb�������V�S�Y�/��
�%��w�
/�
/�1�
�G�G�H��0������$��#�#�%���	0�
/�s�B	�	B	�B	c�^�,oU%cWUOOoUOoU%cVSP*6wcUOU2UOoJ^UO[
U2[
U2U2[V22FDvqVUOVe2J	P!�rA)	�tb_framer�r�r9�tb_nextr�r'�zipr)rl�tb�files�
deduped_filesr��fn�pats&&&    r=�assert_traceback�%ImportTracebackTests.assert_tracebackcs����
���;�;�%�%�D��!�!�B� �B��*;�$;��$�$�R�(����B�����]�+�S��Z��G��=�0�G�B��M�M�#�"�1r?c��]PHoUOQ2UO	W[
,2P![coSOoPo=K5Po=hh9h)r�#ImportError should have been raised)�nonexistent_xyzzyr$r��
__traceback__r�r�)rlr�r}r�s&   r=�test_nonexistent_module�,ImportTracebackTests.test_nonexistent_moduleosF��	=�$�
�I�I�;�<����b�8�*�-��	�	!����B��	!�s�1�	A�A�A
�
Ac���UOQQ2]PHoUOQ2UOW[Q,2P![coSOoPo=K6Po=hh9h)r�zimport nonexistent_xyzzyr��foo.py)r�r�r$r�r�r�r��rlr�r}r�s&   r=�test_nonexistent_module_nested�3ImportTracebackTests.test_nonexistent_module_nestedysZ�����5�"<�=�	=��
�I�I�;�<����b�8�X�"6�7��	�	!����B��	!���A�	A%�A%�A � A%c���UOQQ2]PHoUOQ2UOW[Q,2P![coSOoPo=K6Po=hh9h)r��1/0�)ZeroDivisionError should have been raisedr��r�r�r$rDr�r�r�r�s&   r=�test_exec_failure�&ImportTracebackTests.test_exec_failure�sZ�����5�%�(�	C��
�I�I�A�B����b�8�X�"6�7��	!�	!����B��	!�r�c��UOQQ2UOQQ2]PHoUOQ2UOW[QQ,2P![coSOoPo=K7Po=hh9h)r�z
import bar�barr�r�r��bar.pyr�r�s&   r=�test_exec_failure_nested�-ImportTracebackTests.test_exec_failure_nested�sl�����5�,�/����5�%�(�	C��
�I�I�A�B����b�8�X�x�"@�A��	!�	!����B��	!�s�A�	A8�!A8�"A3�3A8c���UOQQ2]PHoUOQ2UOW[,2P![coSOoPo=K5Po=hh9h)r�zinvalid syntax is invalidz#SyntaxError should have been raised)r�r�r$�SyntaxErrorr�r�r�r�s&   r=�test_syntax_error�&ImportTracebackTests.test_syntax_error�sW�����5�"=�>�	=��
�I�I�;�<����b�8�*�-��	�	!����B��	!�s�A�	A$�
A$�A�A$c�d�QoUO[U2[OO	[
U2o[OU2[OO	UQ2o[UQQQ59^tt^2oUOU2PPP2[OO	UQ2o[UQQQ59^tt^2oUOU2PPP2[O2VW1!)%fhKx9h)%fhK;9h)�_parent_foorr�rrr�)r�rr�r�r�r!r�r	r
rQr�)rl�parentr�pkg_name�pkg_path�	init_pathr`�bar_paths&&&     r=�_setup_broken_package�*ImportTracebackTests._setup_broken_package�s��� �������)��7�7�<�<���1��
������G�G�L�L��=�9�	�
�)�S�7�
3�
3�q�
�G�G�F�O�4��7�7�<�<��(�3��
�(�C�'�
2�
2�a�
�G�G�E�N�3��#�#�%��"�"�
4�
3��3�
2�s$�
D�D�D	�D	�D/	�(D/	c���UOPQ2vq]PHoUOQ2UOW[U,2P![coSOoPo=K6Po=hh9h)rkr�r��r��_parent_foo.barr$rDr�r�r��rlr�r�r�r}r�s&     r=�test_broken_submodule�*ImportTracebackTests.test_broken_submodule�s_��"�8�8��U�C��	�	C�"�
�I�I�A�B����b�8�X�"6�7��	!�	!����B��	!���A�	A'�A'�A"�"A'c���UOPQ2vq]QHGoUOQ2UO
W[U,2P![coSO
oPo=K6Po=hh9h)rkr��r�r��r�r�r�r$rDr�r�r��rlr�r�r�r}r�s&     r=�test_broken_from�%ImportTracebackTests.test_broken_from�s^��"�8�8��U�C��	�	=�'�
�I�I�;�<����b�8�X�"6�7��	!�	!����B��	!���A�	A)�A)�A$�$A)c���UOQP2vq]PHoUOQ2UOW[U,2P![coSOoPo=K6Po=hh9h)r�r�r�r�s&     r=�test_broken_parent�'ImportTracebackTests.test_broken_parent�s_��"�8�8���C��	�	C�"�
�I�I�A�B����b�8�Y�"7�8��	!�	!����B��	!�r�c���UOQP2vq]QHGoUOQ2UO
W[U,2P![coSO
oPo=K6Po=hh9h)r�r�r�r�r�s&     r=�test_broken_parent_from�,ImportTracebackTests.test_broken_parent_from�s_��"�8�8���C��	�	C�'�
�I�I�A�B����b�8�Y�"7�8��	!�	!����B��	!�r�c�j�UOQP2[OQ*oQoV!Om]PHoUO
Q2UOW[Q[,2UO;P![coSOoPo=KGPo=hh9hSO;h9h)r�rxc��]]*P!r�r)r�s*r=rU�9ImportTracebackTests.test_import_bug.<locals>.exec_module�s���!��r?r�z<frozen importlib)r�rVrW�SourceLoaderrUr�r$rDr�r�r�)rlrQrUr�r}r�s&     r=�test_import_bug�$ImportTracebackTests.test_import_bug�s���	
���5�"�%��K�K� <�=�	�	3�
�1<�"�"�.�
G���	�	�E�F��!�!�"�x�1D�h�&O�P��&�&�2��
%�
%��_�_���
%���&�&�2�s;�B$�B�.B$�	B!�
B!�B�B$�B!�!B$�$B2zneed TESTFN_UNENCODABLEc��[OP[Q2oUO[U2UPQo[O
QQU*P
Q5P!)rk�passr�zmod = __import__(%a))�
__isolated���)r%rlr$r�rrm)rl�pynamer_s&  r=�test_unencodable_filename�.ImportTracebackTests.test_unencodable_filename�sM���*�*�2�/A�6�J�������'��c�r�{���&�&�t�-C�d�-J�27�	9r?)r�)r[)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r�r4rlr$r�r�r�r�s@r=r�r�Ps�����#�
��
#�.�8�8�	B�.�
#�8�8�9�9��3��3�&���+�-F�G�9�H�9r?r�c�`�\sQsQsnQsQsQsQsQsQs	Qs
Q	sQ
sQs
QsQ
s\\O$\PIQ2Q22sQsQsUsP!)�CircularImportTestsi�zMSee the docstrings of the modules being imported for the purpose of the
test.c��[[OO22FD-oUO	Q2%fJ[OUJ/	P!)zKMake sure no modules pre-exist in sys.modules which are being used to
test.z&test.test_import.data.circular_imports)r�rVrW�keysr0)rl�keys& r=r��CircularImportTests.tearDown�s<������(�(�*�+�C��~�~�F�G�G��K�K��$�,r?c�X�]PHoP![cSOQ2P!h9h)rz/circular import through relative imports failed)�,test.test_import.data.circular_imports.basicr�r$�rlrHs& r=�test_direct�CircularImportTests.test_directs)��	I�?���	I��I�I�G�H�	I���	�	)�)�)c�X�]PHoP![cSOQ2P!h9h)rz@relative import in module contributing to circular import failed)�/test.test_import.data.circular_imports.indirectr�r$r�s& r=�
test_indirect�!CircularImportTests.test_indirects*��	'�B���	'��I�I�&�
'�	'�r�c�X�]PHoP![cSOQ2P!h9h)rz-circular import involving a subpackage failed)�1test.test_import.data.circular_imports.subpackager�r$r�s& r=�test_subpackage�#CircularImportTests.test_subpackages)��	G�D���	G��I�I�E�F�	G�r�c���]PHGtGtGtGo]QHGoUOUOWO2P![
cSO
Q2KLh9h)rz9circular import with rebinding of module attribute failed)rR)
�0test.test_import.data.circular_imports.rebindingr1r��circular_imports�	rebindingr�r$�-test.test_import.data.circular_imports.subpkgrRrJ)rlrrRs&  r=r�"CircularImportTests.test_rebindingsJ��	S�P�P�	G��
�
�d�i�i����0���	S��I�I�Q�R�	S�s�A�	A�
A�Ac�X�]PHoP![cSOQ2P!h9h)rz9circular import with binding a submodule to a name failed)�.test.test_import.data.circular_imports.bindingr�r$r�s& r=�test_binding� CircularImportTests.test_binding s)��	S�A���	S��I�I�Q�R�	S�r�c��]PHo]PHoP!r�)�*test.test_import.data.circular_imports.use�-test.test_import.data.circular_imports.sourcer�s& r=�test_crossreference1�(CircularImportTests.test_crossreference1&s��9�<r?c�<�UO[29^tt^2o]PH
oPPP2[WO2oUOQU2UOQU2UOQU2UOQU2P!)%fhKo9h)rz-test.test_import.data.circular_imports.source�spamzpartially initialized modulezcircular import)r�r�rr/r�r)rlr�rH�errmsgs&   r=�test_crossreference2�(CircularImportTests.test_crossreference2*so��
�
�
�~�
.�
.�"�@�/��R�\�\�"���
�
�E�v�N��
�
�f�f�%��
�
�4�f�=��
�
�'��0�
/�
.�s�B�B	�B	c���UO[29^tt^2o]PH
oPPP2UOQ[	WO
22P!)%fhK79h)rz�cannot import name 'b' from partially initialized module 'test.test_import.data.circular_imports.from_cycle1' (most likely due to a circular import))r�r��2test.test_import.data.circular_imports.from_cycle1rr/r��rlr�rHs&  r=�test_circular_from_import�-CircularImportTests.test_circular_from_import3sE��
�
�
�{�
+�
+�r�E�,��
�
�
5�
�����		
�,�
+���A�A#	�A#	c��UO[Q29^tt^2]PH
oPPP2P!)%fhP!9h)z�partially initialized module 'test.test_import.data.circular_imports.import_cycle' from '.*' has no attribute 'some_attribute' \(most likely due to a circular import\))rr��3test.test_import.data.circular_imports.import_cycler�s& r=�test_circular_import�(CircularImportTests.test_circular_import=s9��
�
#�
#��
d�
�
�

G�
�
�
�
�s�/�A	�A	c���UO[29^tt^2o]PH
oPPP2UOQ[	WO
22P!)%fhK79h)rz�cannot access submodule 'parent' of module 'test.test_import.data.circular_imports.subpkg2' (most likely due to a circular import))r�r��5test.test_import.data.circular_imports.subpkg2.parentrr/r�rs&  r=� test_absolute_circular_submodule�4CircularImportTests.test_absolute_circular_submoduleEsE��
�
�
�~�
.�
.�"�H�/��
�
�
5�
�����		
�/�
.�rrpc��QoQo[V29^tt^2[Oo[VP
Q5oUO	UO
U2UO
U[O2UO
U[O2UO
U[O2UO
U[O2PPP2UOU[O2UOU[O2UOWO2U2[OQUOO2P!)%fhK�9h)aRegression test for gh-123950

Import a single-phase-init module that imports itself
from the PyInit_* function (before it's added to sys.modules).
Manages its own cache (which is `static`, and so incompatible
with multiple interpreters or interpreter reset).
�_testsinglephase_circularz2test.test_import.data.circular_imports.singlephase�rO)r'rdr�rYr��helper_mod_namerrVrWrrJ�clear_static_varrgrhr2rA)rlr_�helper_namerMr�s&    r=�test_singlephase_circular�-CircularImportTests.test_singlephase_circularOs��+��J��
�T�
'�
'�'�0�0�H�-�T�@E�G�C�
���S�0�0�+�>��M�M�$����,��M�M�+�s�{�{�3��M�M�$����,��M�M�+�s�{�{�3�(�	
����s�{�{�+�����c�k�k�2��
�
�c�*�*�,�c�2��)�)�*E�*-�,�,�*=�*=�	?�!(�
'�s�B:E(�(E8	�1E8	c���UO[Q2UO[Q2]PH
GtGtGoUO
[29^tt^2]QH
GoPPP2UO[U2[2UO[W2[2UO[29^tt^2]*UmPPP2P!)%fhK}9h)%fhP!9h)z test.test_import.data.unwritablez"test.test_import.data.unwritable.xr+)r�r� test.test_import.data.unwritabler1r��
unwritable�assertWarns�
ImportWarningrM�assertNotEqualr1r)r�r�r�)rlr.rMs&  r=�test_unwritable_module�*CircularImportTests.test_unwritable_modulens������� B�C����� D�E�=�=�
�
�
�m�
,�
,�:�-�	
���D��,�j�9�����a��*�-�
�
�
�~�
.�
.��J�L�/�
.�-�
,��
/�
.�
.�s$�C�C&�C#	�C#	�&C7	�/C7	r)r�r�r�r�r�r�r�r�rrr
rrrrr"rsr4rqrdr*r2r�r�r�s@r=r�r��s~����
�%�I�'�G�1�S�=�1�
�G�
��
�_�_�%��-�/V�W�?�X��?�:�r?r�c�h`�\sQsQsn\P
P
P	P
Q5s\P
]Q5s\O2TTt-tFDvqV%(aJ	toos]\Q$\	O\\Q2Q2Q2s
Q!QksQ"Q	P
Q
PQP
-QkksQ"Q
P
QP
-QkksQ"QP
-QkksQ
P
QP
-QksQP
-Qks\	O(\PIQ2Q2s\\	O(\PIQ2Q22s\Q2s\	O(\PIQ2Q2s\	O(\PIQ2Q2s\	O(\PIQ2Q2s\	O(\PIQ2Q2s\	O(\PIQ2Q2s \Q2s!\	O(\PIQ2Q2s"\#\Q22s$\#Q2s%Q s&Us'P!ttooh)#�SubinterpImportTestsi|)�
allow_fork�
allow_exec�
allow_threads�allow_daemon_threads)�use_main_obmalloc�gilr;r�zrequires os.pipe()c��[O2vqUO[OU2UO[OU2[	[Q2%c[O
UP
2V1!)�set_blocking)r�r�r�r�r�r=)rlr�r�s&  r=r��SubinterpImportTests.pipe�sU���w�w�y���������!�$�������!�$��2�~�&�&��O�O�A�u�%��v�
r?c���PoUdQUQ0oU%cA[%cQoLQo[OQUQUQUQU8Q	U8Q
U8QUQ02![OQUQ
UQUQ02!)rkzZ
                import _imp
                _imp._override_multi_interp_extensions_check(�)
                rrz
                from importlib.util import spec_from_loader, module_from_spec
                from importlib.machinery import z0
                import os, sys
                z
                loader = �(z, z*)
                spec = spec_from_loader(a4, loader)
                try:
                    module = module_from_spec(spec)
                    loader.exec_module(module)
                except ImportError as exc:
                    text = 'ImportError: ' + str(exc)
                else:
                    text = 'okay'
                os.write(z(, text.encode('utf-8'))
                z1
                try:
                    import z�
                except ImportError as exc:
                    text = 'ImportError: ' + str(exc)
                else:
                    text = 'okay'
                os.write()rr�r�)rlr_�fdrM�check_override�
override_textr3s&&&&&  r=�
import_script�"SubinterpImportTests.import_script�s����
��%�!>�>L�=M�N��M����/��.���?�?�(1�17��9��� � ���4�(�"�X�L�9)�)-��1����$��
�"�?�?�(��� � �6�"�
���
$�
�

r?�check_singlephase_setting�check_singlephase_override�isolatedc�D�[U2[Q-UO@U%c
UOLUO@QU-@oUO2vqxUO
VUU2o	[U	1-U@o
UOU
]2[OU]d2!)a#
Try importing the named module in a subinterpreter.

The subinterpreter will be in the current process.
The module will have already been imported in the main interpreter.
Thus, for extension/builtin modules, the module definition will
have been loaded already and cached globally.

"check_singlephase_setting" determines whether or not
the interpreter will be configured to check for modules
that are not compatible with use in multiple interpreters.

This should always return "okay" for all modules if the
setting is False (with no override).
�check_multi_interp_extensionsr)r0r��
RUN_KWARGS�ISOLATED�NOT_ISOLATEDr�rErr�r�r�)rlr_rMrGrHrI�kwargsr�r�r�r�s&&&$$$     r=�run_here�SubinterpImportTests.run_here�s���(	�4���
��o�o�
� (�t�}�}�d�.?�.?�
�+D�
���y�y�{����#�#�D�X�$>�@��+�6�<�V�<������a� ��w�w�q�#��r?�strictc�T�UOVUUQ5oUOUQ2P!)�rGrI�okay�rPr�)rlr_rMrRrI�outs&&&$$ r=�check_compatible_here�*SubinterpImportTests.check_compatible_here�s1���m�m�D�6<�%-����	
����g�&r?c�z�UOVP	UQ5oUOUOQ2QUQ02P!)TrTr�ImportError: module �, does not support loading in subinterpreters)rPr�r�)rlr_rMrIrWs&&&$ r=�check_incompatible_here�,SubinterpImportTests.check_incompatible_here�sH���m�m�D�6:�%-����	
����J�J�w��"�4�&�(T�U�	
r?c��[Q-UO@U%c
UOLUO@QU-@oUQ*oU]6XcQLU]6XcQL
U]6XcQLSUQ$[O
Q[OQU8QU8QU8Q	UQ
UOUQ28Q022vqgoUOUQ
2UOUQ2P!)rKr;�default�shared�ownr�zP
            import _testinternalcapi, sys
            assert (
                z0 in sys.builtin_module_names or
                z( not in sys.modules
            ), repr(z2)
            config = type(sys.implementation)(**�T)
            ret = _testinternalcapi.run_in_subinterp_with_config(
                �sys.stdout.fileno()�U,
                config,
            )
            assert ret == 0, ret
            r?rUr)
r�rLrMrNr%rmr�r�rEr�)	rlr_rRrIrOr;r�rWr<s	&&$$     r=�check_compatible_fresh�+SubinterpImportTests.check_compatible_fresh�s���
�
��o�o�
� (�t�}�}�d�.?�.?�
�+1�
��
�U�m��%(�A�X�	��q��H�s�a�x�e�S�	�u�
�#�4�4�T�8�?�?�P��������H�1�17��9��#�#�D�*?�@�C�D
�L�<�����	
����c�"�����g�&r?c���[Q-UO@U%c
UOLUO@QP	-@oUQ*oU]6XcQLU]6XcQL
U]6XcQLSUQ$[O
Q[OQU8QU8QUQ	UOUQ
28Q0	22vqVoUOUQ2UOUOQ
2QUQ02P!)rKr;r`rarbr�z>
            import _testinternalcapi, sys
            assert z not in sys.modules, z1
            config = type(sys.implementation)(**rcrdrer?rr[r\r)r�rLrMrNr%rmr�r�rEr�r�)rlr_rIrOr;r�rWr<s&&$     r=�check_incompatible_fresh�-SubinterpImportTests.check_incompatible_fresh	s���
��o�o�
� (�t�}�}�d�.?�.?�
�+/�
��
�U�m��%(�A�X�	��q��H�s�a�x�e�S�	�u�
�#�4�4�T�8�?�?�P��8�0���91�17��9��#�#�D�*?�@�C�D
�	L�	<�	����	
����c�"�����J�J�w��"�4�&�(T�U�	
r?�requires _testinternalcapic�h�Qo[U2[%f9UOUQ029^tt^2UOUP
Q5PPP2UOUQ029^tt^2UOUP	Q5PPP2P!)%fhKJ9h)%fhP!9h)r��: not strict�rR�: strict, not fresh)rCrr�rX�rlr7s& r=�test_builtin_compat�(SubinterpImportTests.test_builtin_compat7	s����������������5�6�6��*�*�6�%�*�@�7�
�\�\�V�H�$7�8�
9�
9��&�&�v�d�&�;�:�
9�7�6��
9�
9�
9�s#�B
�/B �
B	�B	� B1	�)B1	c���Qo[UP	Q5[U2OOQ6wc[O
UQ02g[%f9UOUQ029^tt^2UOUP
Q5PPP2UOUQ029^tt^2UOUP	Q5PPP2P!)%fhKJ9h)%fhP!9h)ro)r8r-z is unexpectedly not frozenrmrnro)	rHr0r2rAr4r5rr�rXrps& r=�test_frozen_compat�'SubinterpImportTests.test_frozen_compatC	s���%���v�D�)��f��&�&�-�-��9��#�#�v�h�.I�$J�K�K���������5�6�6��*�*�6�%�*�@�7�
�\�\�V�H�$7�8�
9�
9��&�&�v�d�&�;�:�
9�7�6��
9�
9�
9�s$�6C�.C�C	�C	�C0	�(C0	c�t�Qo[U2UOUQ029^tt^2UOUP
Q5PPP2UOUQ029^tt^2UOU2PPP2UOUQ029^tt^2UO	U2PPP2UOUQ029^tt^2UO	UP	Q5PPP2P!)%fhK�9h)%fhK�9h)%fhKp9h)%fhP!9h)rdrmrnro�: strict, freshz: isolated, fresh�rI)rFr�rXr]rirps& r=�!test_single_init_extension_compat�6SubinterpImportTests.test_single_init_extension_compatP	s���#���&�!�
�\�\�V�H�L�1�
2�
2��&�&�v�e�&�<�3�
�\�\�V�H�$7�8�
9�
9��(�(��0�:�
�\�\�V�H�O�4�
5�
5��)�)�&�1�6�
�\�\�V�H�$5�6�
7�
7��)�)�&�4�)�@�8�
7�
3�
2��
9�
9��
5�
5��
7�
7�
7�sG�C-�#D�D�D&�-C=	�6C=	�D	�	D	�D#	�D#	�&D7	�/D7	�$test requires _testmultiphase modulec��Qo[U2[%f9UOUQ029^tt^2UOUP
Q5PPP2UOUQ029^tt^2UOUP	Q5PPP2UOUQ029^tt^2UO	UP	Q5PPP2P!)%fhK�9h)%fhK]9h)%fhP!9h)�_testmultiphasermrnrorw)rFrr�rXrfrps& r=� test_multi_init_extension_compat�5SubinterpImportTests.test_multi_init_extension_compat]	s���#���&�!���������5�6�6��*�*�6�%�*�@�7�
�\�\�V�H�$7�8�
9�
9��&�&�v�d�&�;�:�
�\�\�V�H�O�4�
5�
5��'�'��t�'�<�6�
5�	7�6��
9�
9��
5�
5�
5��5�C�/C�'C+�C	�C	�C(	�!C(	�+C<	�4C<	c�8�Qo[Oo[V2o[U2UO	UQ029^tt^2UOVP	Q5PPP2UO	UQ029^tt^2UOVP
Q5PPP2[%f;UO	UQ029^tt^2UOVP
Q5PPP2P!P!)%fhK�9h)%fhKk9h)%fhP!9h)�_test_non_isolatedz
: isolatedrxz: not isolatedrmrn)r}r�rYrFr�r]rrX�rlrLrMr7s&   r=�-test_multi_init_extension_non_isolated_compat�BSubinterpImportTests.test_multi_init_extension_non_isolated_compatk	s���'��"�+�+��+�G�>���&�!�
�\�\�W�I�Z�0�
1�
1��(�(��T�(�J�2�
�\�\�W�I�^�4�
5�
5��(�(��U�(�K�6�������	��6�7�7��*�*�7�U�*�K�8�7��	2�
1��
5�
5��8�7�7�s6�C"�>C5�D�"C2	�+C2	�5D	�>D	�D	�D	c
��QFCDoUOUQ59^tt^2[Oo[V2o[	U2UOUQ029^tt^2UOVP	Q5PPP2UOUQ029^tt^2UO
VP	P
Q5PPP2[%f:UOUQ029^tt^2UO
VP
P
Q5PPP2PPP2CJ	P!)%fhK�9h)%fhKw9h)%fhKE9h)%fhCJU9h)�_test_shared_gil_only)rLz: isolated, strictrxz: not isolated, strict�rRrIz: not isolated, not strict)r��"_test_no_multiple_interpreter_slot)r�r}r�rYrFr]rXrr�s&   r=�4test_multi_init_extension_per_interpreter_gil_compat�ISubinterpImportTests.test_multi_init_extension_per_interpreter_gil_compat|	s��>�G����g��.�.�*�3�3��3�G�F��!�&�)��\�\�W�I�-?�"@�A�A��0�0��:>�1�@�B��\�\�W�I�-C�"D�E�E��.�.�w�6:�U�/�L�F�'������	�1K�&L�M�M��2�2�#�e�e�3�M�N�/�.�>�B�A��F�E��N�M��/�.�.�sr�AE	�&D
�:$E	�D"
�3E	�E	�#D5
�8E	�D�D�E	�"D2�+D2�-E	�5E�>E�E	�E
�E
c���Qo[Oo[VP
Q5oUOUO]2UOUO
]2UOUO]2[UO2oUOUOQ2UOQ22UOUOQ2UOQ22P!)�_testmultiphase_exec_multipler&r%r&r6)r}r�rYr�r%r&r6r�r��
assertLessr�)rlrLrMr7r�s&    r=�!test_testmultiphase_exec_multiple�6SubinterpImportTests.test_testmultiphase_exec_multiple�	s���1��"�+�+��+�G�?D�F��	
������1�%�������1�%�������1�%��F�O�O�$������
�
�3�����C��9�����
�
�3�����C��9r?c��Qo[U2[%f9UOUQ029^tt^2UOUP
Q5PPP2UOUQ029^tt^2UOUP	Q5PPP2UOUQ029^tt^2UO	UP	Q5PPP2P!)%fhK�9h)%fhK]9h)%fhP!9h)r�rmrnrorw)rJrr�rXrfrps& r=�test_python_compat�'SubinterpImportTests.test_python_compat�	s������F�#���������5�6�6��*�*�6�%�*�@�7�
�\�\�V�H�$7�8�
9�
9��&�&�v�d�&�;�:�
�\�\�V�H�O�4�
5�
5��'�'��t�'�<�6�
5�	7�6��
9�
9��
5�
5�
5�r�c�,``�Qn[R2UU1QkoUU1QkoROQ29^tt^2UP	]2PPP2ROQ29^tt^2UP	]2PPP2ROQ29^tt^2UP	P2PPP2ROQ29^tt^2UP
]2PPP2ROQ29^tt^2UP
]2PPP2ROQ29^tt^2UP
P2PPP2P!)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhK�9h)%fhP!9h)	rdc�V:�RORUUQ5oROUQ2P!�)rGrHrUrV��setting�overriderWr7rls&& ��r=�check_compatible�_SubinterpImportTests.test_singlephase_check_with_setting_and_override.<locals>.check_compatible�	s1����-�-��*1�+3� ��C�

���S�'�*r?c�V:�RORUUQ5oROUQ2P!r�)rPr1r�s&& ��r=�check_incompatible�aSubinterpImportTests.test_singlephase_check_with_setting_and_override.<locals>.check_incompatible�	s1����-�-��*1�+3� ��C�

����W�-r?z(config: check enabled; override: enabledz+config: check enabled; override: use configz)config: check enabled; override: disabledz)config: check disabled; override: enabledz,config: check disabled; override: use configz*config: check disabled; override: disabled)rFr�)rlr�r�r7sf  @r=�0test_singlephase_check_with_setting_and_override�ESubinterpImportTests.test_singlephase_check_with_setting_and_override�	s���#���&�!�	+�	.��\�\�D�
E�
E��t�Q�'�F�
�\�\�G�
H�
H��t�Q�'�I�
�\�\�E�
F�
F��T�2�&�G��\�\�E�
F�
F��u�a�(�G�
�\�\�H�
I�
I��U�A�&�J�
�\�\�F�
G�
G��U�B�'�H�
G�F�
E��
H�
H��
F�
F��G�
F��
I�
I��
G�
G�
G�sk�
D#�#
D6�
E	�9
E�$
E/�
F�#D3	�,D3	�6E	�?E	�	E	�E	�E,	�%E,	�/E?	�8E?	�F	�F	c�T�Qo[U2UOUQ029^tt^2UOUP	P	Q5PPP2UOUQ029^tt^2UOUP	P	Q5PPP2P!)%fhKK9h)%fhP!9h)r�ror�rw)rJr�rXrfrps& r=�test_isolated_config�)SubinterpImportTests.test_isolated_config�	s������F�#�
�\�\�V�H�$7�8�
9�
9��&�&�v�d�T�&�J�:�
�\�\�V�H�O�4�
5�
5��'�'��t�d�'�K�6�
5�:�
9��
5�
5�
5�s#�B�$B�B	�B	�B'	�B'	c�.`�[OQ2o[O2nUO	U1Qk2[O
RU2oUO
UP2[O
RU2oUO
UP2P!)zU
            import _testsinglephase
            print(_testsinglephase)
            c�2:�[OR2!rE)ru�destroy�r�s�r=r,�?SubinterpImportTests.test_disallowed_reimport.<locals>.<lambda>�	s���
� 5� 5�h� ?r?)r�r�ru�creater�r��assertIsNot)rlr��excsnapr�s&  @r=�test_disallowed_reimport�-SubinterpImportTests.test_disallowed_reimport�	sy������"���!�'�'�)�����?�@��*�*�8�V�<������$�'��*�*�8�V�<������$�'r?c��]PHoUOoQU8Q0o[O2o[	29^tt^2o[O
VC2oUOoPPP2[OU2UOW2UOUOOQ2UOUOQ2UOW2UOUO[2UO[!UO"2Q2P!)%fhK�9h[OS2h9h)rz�if True:
        from test.test_import import import_extension_from_file

        import_extension_from_file('_testsinglephase_raise_exception', r�r�z5failed to import from subinterpreter due to exception�evil)rdr�rur�rr��
unraisabler�rr1r�rrrJ�exc_type�RuntimeErrorr�r/�	exc_value)rlrdrMr��interpr�r�r�s&       r=�%test_pyinit_function_raises_exception�:SubinterpImportTests.test_pyinit_function_raises_exception�	s��	 �#�,�,��H�IQ�|�ST�X��
�%�%�'��	*�+�-�-��)�4�4�V�D�	��]�]�
�.�
�!�!�&�)����Y�'����Y�^�^�4�4�m�D����Y�]�]�,c�d����Z�(��
�
�j�)�)�<�8�����Z�1�1�2�F�;�.�-��
�!�!�&�)�s)�E�#D-�$E�-D=	�6D=	�8E�Er)NNrE)(r�r�r�r�r�rLrM�itemsrNr4rlr�r�r�rErPrXr]rfrirqrgrqr
rtrsryr}r~r�r�r�r�r�r�rvr�r�r�r�)r��vr�s00@r=r5r5|s���������"�	�J���
��H�*2���)9�:�)9���A�u�H�)9�:�L��L���
�����V�,�.B�C��D��*�X"�+0�"�,0�"� �"�H
'�%*�
'�',�
'�
�u�
�'�U�'�U�'�:
��
�8�_�_�&�$�.�0L�M�	<�N�	<��
�_�_�&�$�.�0L�M�	<�N��	<��
A��
A��_�_�_��,�.T�U�=�V�=��_�_�_��,�.T�U�L�V�L� �_�_�_��,�.T�U�M�V�M�6�_�_�_��,�.T�U�:�V�:��_�_�&�$�.�0L�M�	=�N�	=�� (�� (�D�_�_�&�$�.�0L�M�L�N�L���
(���
(��<��<��Q;s�F.r5c�``�\sQsQsnQs\U1Qk2s\O\	OQ2O2*s\U1Qk2sQs
UsU9s!)�TestSinglePhaseSnapshoti
a�A representation of a single-phase init module for testing.

Fields from ModuleSnapshot:

* id - id(mod)
* module - mod or a SimpleNamespace with __file__ & __spec__
* ns - a shallow copy of mod.__dict__
* ns_id - id(mod.__dict__)
* cached - sys.modules[name] (or None if not there or not snapshotable)
* cached_id - id(sys.modules[name]) (or None if not there)

Extra fields:

* summed - the result of calling "mod.sum(1, 2)"
* lookedup - the result of calling "mod.look_up_self()"
* lookedup_id - the object ID of self.lookedup
* state_initialized - the result of calling "mod.state_initialized()"
* init_count - (optional) the result of calling "mod.initialized_count()"

Overridden methods from ModuleSnapshot:

* from_module()
* parse()

Other methods from ModuleSnapshot:

* build_script()
* from_subinterp()

----

There are 5 modules in Modules/_testsinglephase.c:

* _testsinglephase
   * has global state
   * extra loads skip the init function, copy def.m_base.m_copy
   * counts calls to init function
* _testsinglephase_basic_wrapper
   * _testsinglephase by another name (and separate init function symbol)
* _testsinglephase_basic_copy
   * same as _testsinglephase but with own def (and init func)
* _testsinglephase_with_reinit
   * has no global or module state
   * mod.state_initialized returns None
   * an extra load in the main interpreter calls the cached init func
   * an extra load in legacy subinterpreters does a full load
* _testsinglephase_with_state
   * has module state
   * an extra load in the main interpreter calls the cached init func
   * an extra load in legacy subinterpreters does a full load

(See Modules/_testsinglephase.c for more info.)

For all those modules, the snapshot after the initial load (not in
the global extensions cache) would look like the following:

* initial load
   * id: ID of nww module object
   * ns: exactly what the module init put there
   * ns_id: ID of new module's __dict__
   * cached_id: same as self.id
   * summed: 3  (never changes)
   * lookedup_id: same as self.id
   * state_initialized: a timestamp between the time of the load
     and the time of the snapshot
   * init_count: 1  (None for _testsinglephase_with_reinit)

For the other scenarios it varies.

For the _testsinglephase, _testsinglephase_basic_wrapper, and
_testsinglephase_basic_copy modules, the snapshot should look
like the following:

* reloaded
   * id: no change
   * ns: matches what the module init function put there,
     including the IDs of all contained objects,
     plus any extra attributes added before the reload
   * ns_id: no change
   * cached_id: no change
   * lookedup_id: no change
   * state_initialized: no change
   * init_count: no change
* already loaded
   * (same as initial load except for ns and state_initialized)
   * ns: matches the initial load, incl. IDs of contained objects
   * state_initialized: no change from initial load

For _testsinglephase_with_reinit:

* reloaded: same as initial load (old module & ns is discarded)
* already loaded: same as initial load (old module & ns is discarded)

For _testsinglephase_with_state:

* reloaded
   * (same as initial load (old module & ns is discarded),
     except init_count)
   * init_count: increase by 1
* already loaded: same as reloaded
c�,:�[RU_U2oUO]]2UmUO	2Um[
UO
2UmUO2Um[UQ2%cUO2UmU!)rA�initialized_count)�superr��sum�summed�look_up_self�lookeduprz�lookedup_id�state_initializedr�r��
init_count)r�r�rl�	__class__s&& �r=r��#TestSinglePhaseSnapshot.from_moduler
sx����w�"�3�'���g�g�a��m����(�(�*��
��d�m�m�,���!$�!6�!6�!8����3�+�,�,�!�3�3�5�D�O��r?a�
        snapshot['module'].update(dict(
            int_const=mod.int_const,
            str_const=mod.str_const,
            _module_initialized=mod._module_initialized,
        ))
        snapshot.update(dict(
            summed=mod.sum(1, 2),
            lookedup_id=id(mod.look_up_self()),
            state_initialized=mod.state_initialized(),
            init_count=mod.initialized_count(),
            has_spam=hasattr(mod, 'spam'),
            spam=getattr(mod, 'spam', None),
        ))
        c�T:�[RU_U2oUO%fU;U;U!rE)r�r��has_spamr)r�r�rlr�s&& �r=r��TestSinglePhaseSnapshot.parse�
s)����w�}�T�"���}�}�}��	��M��r?)r�r�r�r�r�)r�r�r�r�r�r�r�rxr�r�r�r%r�r�r��
__classcell__)r�r�s@@r=r�r�
se����d�L����!�,�,�x���@�0
��V�X��K� ����r?r�c�`�\sQsQsnQs\Q2sQs\Q2sQs	Qs
QsQ	sQ
s
Q$QPQP
-Q
kksQsQsQsQsQsQsQsQsQsQsQsQs\O8\PIQ2Q2s\QQ5\ Q22s!\ODQ2\Q Q5\ Q!222s#\ Q"2s$Q#s%Us&P!)%�SinglephaseInitTestsi�
rdc���[OOUO2o[	UO
2Um[%c�UO[IfPgUOUm
[UOQ*Q29^tt^2o[OO[OO[ O"2UO%2O'22UmPPP2L8UO[*IfPgUOUm
UOUmUO-2P!)%fhK"9h)z.originr�)rQrRr��NAMEr1r3�LOADERrrrA�ORIGINr	r�r�r�r�rVr�r�r��FILEr�clean_up)r�rXr`s&  r=�
setUpClass�SinglephaseInitTests.setUpClass�
s����~�~�'�'����1���$�+�+�&��
�
�?��:�:�!5�5�5�5����C�J��d�k�k�I�-�s�3�3�q��7�7�<�<��G�G�O�O�C�N�N�3��F�F�H�N�N�$����4�3��:�:�!4�4�4�4����C�J��{�{�C�H�	����4�3�s�A-E�E-	�&E-	c�(�UO2P!rE)r�r�s&r=r��SinglephaseInitTests.tearDown�
s���
�
�r?c��UOoU[O7c�[[OU*Q2%c�[OU*OUO
6Xf6P[OU*OQUO
02g[OU*O
2[OU[OVO2P!)rfz != )
r�rVrWr�r�r�rfrgrhr�)r�r_s& r=r��SinglephaseInitTests.clean_up�
s����x�x���3�;�;���s�{�{�4�(�*:�;�;��{�{�4�(�1�1�S�X�X�=�B��{�{�4�(�1�1�2�$�s�x�x�j�A�B�=����D�!�0�0�2����D�!��)�)�$�
�
�;r?c�<``�UU1QkoROU2P!)c�L:�[ORRO2P!rE)rgrhr�)r_rls��r=r��9SinglephaseInitTests.add_module_cleanup.<locals>.clean_up�
s����-�-�d�D�K�K�@r?)r�)rlr_r�sff r=�add_module_cleanup�'SinglephaseInitTests.add_module_cleanup�
s���	A�	
����!r?c��]QHGoUOV2o[OOVUQ5oUU2!)z
Load an extension module.
)�_load)r3)�importlib._bootstrapr�r�rQrR�spec_from_file_location)rlr_r�r�r3rXs&&&   r=�
_load_dynamic�"SinglephaseInitTests._load_dynamic�
s>��
	/����T�(���~�~�5�5�d�=C�6�E���T�{�r?c�4�UOoV7fPgUOVO2oUO	V2O22V2U$[OUU[OU2Q5![c-9p mK�h9h��r_r7�snapshot)
�already_loadedr�r�r�r�valuesr�r�r�r�)rlr_r�r�s&&  r=r��SinglephaseInitTests.load�
s���	6�!�0�0�N��)�)�)�� � ��{�{�3������3�3�5�6�"�t���$�$���,�8�8��=�
�	
��
�	6�35�5�N�0�	6�s�B�	B�	B�Bc��[OU*UIfPgUOUO6XfPgUOVO2o[
OUU[OU2Q5!r�)	rVrWr�r�r�r�r�r�r�)rlr_r��reloadeds&&& r=�re_load�SinglephaseInitTests.re_load�
sj���{�{�4� �C�'�'�'��|�|�s�|�|�+�+�+��%�%�d�K�K�8���$�$���,�8�8��B�
�	
r?c��``�[OQ2nU1QkoROU2[OR[O
Q22UU1QkoROU2R!)�legacyc�p:�[OR2P![OcP!h9hrE)rur��InterpreterNotFoundErrorr�s�r=�ensure_destroyed�ASinglephaseInitTests.add_subinterpreter.<locals>.ensure_destroyed�
s.���
��%�%�h�/�� �9�9�
��
�s��5�5�5zI
            import sys
            import _testinternalcapi
            c
��:�[OR[OQRO8QRO
8Q022[OR2P!)z
                name = z�
                if name in sys.modules:
                    sys.modules.pop(name)._clear_globals()
                _testinternalcapi.clear_extension(name, r@)rurr�r�r�r�r�)r�rls��r=r��9SinglephaseInitTests.add_subinterpreter.<locals>.clean_upsW������x����>��	�	�}�%9�:>����H�	:�*�
�
�!�!�(�+r?)rur�r�rr�r�)rlr�r�r�sf  @r=�add_subinterpreter�'SinglephaseInitTests.add_subinterpreter�
s_��� �'�'��1��	�
	
���(�)����8�X�_�_�6�&�	�	,�	
����!��r?r�r�c	���UOoU%cUeQLPoQUQUO8Q0oUOo[OUUUP	UUQ5o	[OUPU	Q5![cc[O
29vqx9p`mSO
[OS2SO
[OS2K�h9h)Nzimport _testinternalcapiz
                z^
                mod._clear_globals()
                _testinternalcapi.clear_extension(name, r@)r�r�r�r�r�)r�r��_piper�r�r�r�r�r�r�r�r�)
rlr�r�r�r_�import_r�r�r�r�s
&&$$      r=�import_in_subinterp�(SinglephaseInitTests.import_in_subinterps����y�y���4<�4D�0�"�G���	�9�9=����H��K�	)��:�:�D�+�9�9�����!�#�
:�
���$�$����
�	
���	)�')�w�w�y�0�D�A�0�4�*��O�O�B�H�H�a�(��O�O�B�H�H�a�(�	)�s�A3�3	C �=A C �C c�4�P
oUOoU%fP	oUOOoUOUOOUO2UOUO
UO2UOUOOUO2U%f!UOUO[2UOUOQ2UOUOQ2UOUO[ 2UO#UO]2UOoUOUO$]2UO&d=UOUO&[ 2UO#UO&]2U%c�UOUO(UO*2UOUO,UO*2UO/[029^tt^2UO2PPP2P!UO5UO6U2UO5UO8U2P!)%fhP!9h)Fi�zsomething different)r7r�r�r2r_r�r�rAr��assertIsSubclassr
r6�	int_const�	str_const�assertIsInstance�_module_initialized�float�
assertGreaterr�r�r�rzr~r�r�rrJr�r})rl�loadedrIr��snaps&&   r=�check_common�!SinglephaseInitTests.check_common2s������m�m����H��/�/�(�(�C�������*�*�F�K�K�8�������t�y�y�1�������,�,�d�k�k�:���!�!�#�)�)�Y�7��������-�������(=�>����c�5�5�u�=����3�2�2�A�6�����������a�(��!�!�-��!�!�$�"8�"8�%�@����t�5�5�q�9��
���T�-�-�t�w�w�7����T�^�^�T�W�W�5��"�"�>�2�2��	�	�3�2�
�M�M�$�-�-��-��M�M�$�+�+�s�+�	3�2�2�s�5
J�J	�J	c���UOUOOUO2UO	UO
OUO2P!rE)r�r7r�r_rJr�r��rlrs&&r=�check_direct�!SinglephaseInitTests.check_directUs<��������/�/����=��
�
�f�o�o�.�.��
�
�>r?c�$�V!OIfPgUOUO6wfPgUOUOOUO2UO	UO
OUO2P!rE)r7r�r_r1rJr�r�)rlr�origs&&&r=�check_indirect�#SinglephaseInitTests.check_indirectZsb���=�=�(�(�(��}�}����+�+�+����F�M�M�2�2�F�K�K�@��
�
�f�o�o�.�.��
�
�>r?c��UOoUOUOP2UOUO[
2UO
UO]2UOUOU2P!rE)r�r�r�rr��intrr�)rlr�expected_init_countrs&&& r=�check_basic� SinglephaseInitTests.check_basicas`����������/�/��6����d�o�o�s�3����4�?�?�A�.�������*=�>r?c��P!rErrs&&r=�check_with_reinit�&SinglephaseInitTests.check_with_reinitjs��	
r?c��UOoUOUO]2UOUOOUO
2P!)zE
The module had not been loaded before (at least since fully reset).
)r�r�r�r7rr�)rlrrs&& r=�check_fresh� SinglephaseInitTests.check_freshosH������
	
������!�,�	
������8�8��/�/�	1r?c�n�UOoUOUOUOO2UOUOUOO2UOUOUOO]*2UOUO
OUO2UOUOUOO2UOUOUOO2P!)zX
The module had been loaded before and then reset
(but the module global state wasn't).
�r�r1rzr�r�r7rr�)rlrr_�prevrs&&&& r=�check_semi_fresh�%SinglephaseInitTests.check_semi_fresh~s���
����
	
���D�G�G�T�]�]�%5�%5�6����D�G�G�T�]�]�%5�%5�6�������$�-�-�*B�*B�Q�*F�G�	
������8�8��/�/�	1����D�2�2� �M�M�;�;�	=����D�2�2� �M�M�;�;�	=r?c��UOoUOUOUOO2UOUOUOO2UOUO
OUO2UOUOUOO2P!)z4
The module had been loaded before and never reset.
r)rlrr_rs&&& r=�check_copied�!SinglephaseInitTests.check_copied�s�������
	
���D�G�G�T�]�]�%5�%5�6�������$�-�-�*B�*B�C�	
������8�8��/�/�	1�����/�/����8�8�	:r?c�J�UOUO2oUOoUO2oUO2UO2oUO
2oUO
U]2UOU]2UOUP2P!r�)r�r�r7r�rfr�rr�)rlrrd�init_before�
init_afterr�s&     r=�test_cleared_globals�)SinglephaseInitTests.test_cleared_globals�s������4�9�9�%��!�=�=��&�8�8�:���'�'�)�%�7�7�9�
�%�7�7�9�
����;��*�����Q�'�����R�(r?c�@	�PUmUOo]oUOU29^tt^2UOU2oUO	U2UOU2UO
V22PPP2WOoUOQ0oUOU2U]*
oUOU29^tt^2UOU2oUO	U2UOV42UO
V22UOUO2UO2UOUO2U2PPP2UOoUOQ0oUOU2U]*
oUOU29^tt^2UOU2oUO	U2UOU2UO
V22UOUO2U2UOUO2U2PPP2UOQ0oUOU2UOU29^tt^2UOU2oUO	U2UOUOOP2UOU2UO!U2UOUO2U2UOUO2U2PPP2UOQ0oUOU2UOU29^tt^2UOU2oUO#UOO$2UO	U2UO'UOOP2UOU2UO!U2UOUO2U2UOUO2U2PPP2P!)%fhCK�9h)%fhCK�9h)%fhCK89h)%fhCK`9h)%fhP!9h)N�_basic_wrapper�_basic_copy�_with_reinit�_with_state)�maxDiffr�r�r�rrrr7r�rrJr�r�r�r�r�rr��_clear_module_stater�)rlr_rr�basic�basic_lookedups&     r=�
test_variants�"SinglephaseInitTests.test_variants�s�������y�y����
�\�\�$�
�
��Y�Y�t�_�F����f�%����f�%����V�9� ��
�
���)�)��N�+������%��q� ��
�\�\�$�
�
��Y�Y�t�_�F����f�%�����.����V�9�
�M�M�%�,�,�.��
�
�>����U�4�4�6�8K�L� � �����)�)��K�(������%��q� ��
�\�\�$�
�
��Y�Y�t�_�F����f�%����f�%����V�9�
�M�M�%�,�,�.��?����U�4�4�6�8K�L� ��)�)��L�)������%�
�\�\�$�
�
��Y�Y�t�_�F����f�%��M�M�&�/�/�;�;�T�B����f�%��"�"�6�*�
�M�M�%�,�,�.��?����U�4�4�6�8K�L� ��)�)��K�(������%�
�\�\�$�
�
��Y�Y�t�_�F��O�O�F�M�M�=�=�>����f�%����V�_�_�>�>��E����f�%��"�"�6�*�
�M�M�%�,�,�.��?����U�4�4�6�8K�L� �
� �
�
�� �
�
��& �
�
�� �
�
��  �
�
�s^�AP<�BQ�0BQ$�6B+Q8�"CR�<Q
	�Q
	�Q!	�Q!	�$Q5	�-Q5	�8R		�R		�R	�R	c	�.�PUmUOUOQ0UOQ01FCD�oUOU2UOU29^tt^2UO	U2oUOVO2oUOU2UOU2UO[UOO2UOO2UOUOOOUOO2UOUOOOUO2UOUOO UOOO 2UO#UOUO2UO#UOOUOO2UO#UOO$UOO$2UOUOO&UOO&2UOUOO(UOO(2UO#UOO*UO2PPP2CJ�	P!)%fhCJ�9h)Nr+r,)r/r�r�r�r�r�r7rr�rzr�r�r|r{r2r_r�rJr�r�r�r})rlr_rr�s&   r=�test_basic_reloaded�(SinglephaseInitTests.test_basic_reloadeds1�����
�I�I��y�y�k��(��y�y�k��%�
�D�

�#�#�D�)����d�#�#����4����<�<��m�m�<���!�!�&�)��!�!�(�+�� � ��F�M�M�$:�$:�!;�!'���!6�!6�8�� � ����!3�!3�!<�!<�!'���!7�!7�9�� � ����!9�!9�!>�!>��
�
�N�� � ����!9�!9�!)�!2�!2�!5�!5�!>�!>�@��
�
�h�o�o�v�}�}�=��
�
�h�o�o�6�6��
�
�8N�8N�O��
�
�h�/�/�8�8�$�o�o�6�6�8�� � ��!2�!2�!D�!D�!'���!B�!B�D�� � ��!2�!2�!=�!=�!'���!;�!;�=��
�
�h�/�/�6�6����H�;$�#�

�$�#�#�s�!JL	�L
�L
c	��PUmUOUO2oUOQ0P
1UOQ0P	11FCD vq#UOU2UO	V#Q59^tt^2UOU2oU%c&UOUOO2UOV$O2oU%c&UOUOO2UOU2UOU2UO[UOO2UOO2UOUOOOUOO2UOUOO O"UO"2UOUOO$UOOO$2UO'UOUO2UO)UOOUOO2UO+UOO,UO2UOO.e(UO+UOO.P2L:UO1UOO.UOO.2UO+UOO2UO2PPP2CJ#	P!)%fhCJ99h)Nr-r.)r_�	has_state)r/r�r�r�r�r�r7r0r�rr�rzr�r�r|r{r2r_r�r�r1rJr�r�rr})rlr1r_r9rr�s&     r=�test_with_reinit_reloaded�.SinglephaseInitTests.test_with_reinit_reloaded5sz������	�	�$�)�)�$���	�	�{�,�
'��/��	�	�{�+�
&��-� 
�O�D�
�#�#�D�)����4��=�=����4�����O�O�F�M�M�$E�$E�F��<�<��m�m�<����O�O�H�O�O�$G�$G�H��!�!�&�)��!�!�(�+�� � ��F�M�M�$:�$:�!;�!'���!6�!6�8�� � ����!3�!3�!<�!<�!'���!7�!7�9�� � ����!9�!9�!>�!>��
�
�N�� � ����!9�!9�!)�!2�!2�!5�!5�!>�!>�@�� � ����&�-�-�@��#�#�H�O�O�$<�$<�$*�M�M�$:�$:�<��
�
�h�/�/�8�8�(�/�/�J��?�?�4�4�<��M�M�(�"3�"3�"E�"E�t�L��&�&�x�'8�'8�'J�'J�'-���'H�'H�J��
�
�h�/�/�6�6����H�A>�=� 
�
>�=�=�s'�8M.	�AM.	�G3M.	�BM.	�.N
�7N
rkc	��QFD�oUOUQ0oUOU29^tt^2UOV O2oUO	UO
U2[OOUP2[OV O2PPP2J�	P!)%fhJ�9h)rk�_check_cache_first)rkr-r.)r�r�r�r�r�r�rVrWrergrh)rl�variantr_r�s&   r=�test_check_state_first�+SinglephaseInitTests.test_check_state_firstcs���:�G��i�i�[��	�);�<�D����d�#�#��(�(��{�{�;��� � ����t�4�������d�+�!�1�1�$���D�	$�#�;�#�#�#�s�A8B8	�8C	
�C	
z+module state is not cleared (see gh-140657))�reasonc��UOUO2oUOoQUmUO	U2UOU2UO
2oUO
2oUO2oUO	U2UOVQ2UOU2oUO	U2UOVQ2UOU2oUO	U2UOVQ2P!)z&spam, spam, spam, spam, eggs, and spam)	r�r�r7rrrr�r�r#)rl�main_loadedrd�	interpid1�	interpid2rs&     r=�.test_basic_multiple_interpreters_main_no_reset�CSinglephaseInitTests.test_basic_multiple_interpreters_main_no_resetss����i�i��	�	�*��&�-�-�� H������+�&�����%��+�+�-�	��+�+�-�	��)�)�+�����&�!����&�.��)�)�)�4�����&�!����&�.��)�)�)�4�����&�!����&�.r?z&gh-131229: This is suddenly very flakyzArerun not possible; module state is never cleared (see gh-102251)c��[%c[OQ2gUO2oUO2oUO	UO
2oUOO2[OUO
UO2UOQQ5oUOU2UOU2UOU2oUOU2UOVT2UOU2oUOU2UOVe2P!)zcrashes on Py_TRACE_REFS buildsz�
                # Attrs set after loading are not in m_copy.
                mod.spam = 'spam, spam, mash, spam, eggs, and spam'
                )r�)rr4r5r�r�r�r7rfrgrhr�r�rrr#)rlrDrE�loaded_mainr_�loaded_interp1�loaded_interp2s&      r=�1test_basic_multiple_interpreters_deleted_no_reset�FSinglephaseInitTests.test_basic_multiple_interpreters_deleted_no_reset�s���=��#�#�$E�F�F��+�+�-�	��+�+�-�	��i�i��	�	�*�����)�)�+��)�)�$�)�)�T�[�[�A��'�'��(���
	
���$��������1�1�)�<�����.�)����.�/��1�1�)�<�����.�)����.�9r?c��UO2oUO2oUOQP	Q5oUOU2UOU2UOUP	Q5oUOU2UOU2UOUP	Q5oUOU2UOU2P!)z�
            # Attrs set after loading are not in m_copy.
            mod.spam = 'spam, spam, mash, spam, eggs, and spam'
            )r�r�)r�)r�r�rr)rlrDrErs&   r=�+test_basic_multiple_interpreters_reset_each�@SinglephaseInitTests.test_basic_multiple_interpreters_reset_each
s����+�+�-�	��+�+�-�	��)�)���*�
��	
���&�!����� ��)�)�)��)�F�����&�!����� ��)�)�)��)�F�����&�!����� r?)r�r�r/rE)'r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr r#r(r3r6r:r4rqrgr?rrvrFr8rLrOr�r�r�s@r=r�r��
sC�����D�����2��
<��
<�"�	�

�
��."
�'+�"
�(-�"
�L!,�F?�
?�?�
�

1�=�,:�,)�RM�h(I�T,I�\�_�_�&�$�.�0L�M�E�N�E��B�C��:/��D�:/�F�]�]�;�<�
�X�Y��A:��Z�=�A:�T�0!��0!r?r�r{c�`�\sQsQsnQs\Q2sQsQsQs	\Q2s
QsQ	sQ
s
\Q2Q2sQ
sUsP!)�ModexportTestsi@
c�~�Qo[Oo[VP
Q5oUOUOU2P!)�_test_from_modexportr&)r}r�rYr�r�r�s&   r=�test_from_modexport�"ModexportTests.test_from_modexportB
s8��(��"�+�+��+�G�?D�F��	
������'�2r?c�f�Qo[Oo[OO	2oUOUO2[OO2oUOUUUQ5[O2oUOQ[Q02UOUO2U2UOUO2P	2UOUO!22UOU[O22P!)�_test_from_modexport_gil_used�rLrM�queue�uif True:
            import sys
            from test.support.warnings_helper import check_warnings
            from a� import import_extension_from_file
            with check_warnings((".*GIL..has been enabled.*", RuntimeWarning),
                                quiet=True):
                module = import_extension_from_file(modname, filename,
                                                    put_in_sys_modules=False)
            queue.put(module.__name__)
            queue.put(sys._is_gil_enabled())
        )r}r��
concurrent�interpretersr�r�r��create_queue�prepare_mainrV�_is_gil_enabledrr�r�r�r@�empty�rlrLrMr�rZ�enabled_befores&     r=�test_from_modexport_gil_used�+ModexportTests.test_from_modexport_gil_usedJ
s���2��"�+�+���(�(�/�/�1��������%��'�'�4�4�6��������	�	
�
�,�,�.��������	�
�
	
�	
�������g�.��������d�+�������
�&������)<�)<�)>�?r?c��Qo[OoUO[29^tt^2[	VP
Q5PPP2P!)%fhP!9h)�_test_from_modexport_nullr&�r}r�r��SystemErrorrY�rlrLrMs&  r=�test_from_modexport_null�'ModexportTests.test_from_modexport_nullk
s@��-��"�+�+��
�
�
�{�
+�
+�&�w�:?�
A�,�
+�
+�
+���A	�	A	�A	c��Qo[OoUO[29^tt^2[	VP
Q5PPP2P!)%fhP!9h)�_test_from_modexport_exceptionr&)r}r�r�r?rYrjs&  r=�test_from_modexport_exception�,ModexportTests.test_from_modexport_exceptionr
s@��2��"�+�+��
�
�
�z�
*�
*�&�w�:?�
A�+�
*�
*�
*�rmc�r�Qo[Oo[VP
Q5oUOU[2P!)�%_test_from_modexport_create_nonmoduler&)r}r�rYrr/r�s&   r=�$test_from_modexport_create_nonmodule�3ModexportTests.test_from_modexport_create_nonmoduley
s2��9��"�+�+��+�G�?D�F�����f�c�*r?c�n�Qo[Oo[OO	2oUOUO2[OO2oUOUUUQ5[O2oUOQ[Q02UOUO2[2UO!UO2P	2UO#UO%22UO!U[O22P!)�._test_from_modexport_create_nonmodule_gil_usedrYr[a� import import_extension_from_file
            with check_warnings((".*GIL..has been enabled.*", RuntimeWarning),
                                quiet=True):
                module = import_extension_from_file(modname, filename,
                                                    put_in_sys_modules=False)
            queue.put(module)
            queue.put(sys._is_gil_enabled())
        )r}r�r\r]r�r�r�r^r_rVr`rr�rr�r/r�r@rarbs&     r=�-test_from_modexport_create_nonmodule_gil_used�<ModexportTests.test_from_modexport_create_nonmodule_gil_used�
s���C��"�+�+���(�(�/�/�1��������%��'�'�4�4�6��������	�	
�
�,�,�.��������	�
�
	
�	
���e�i�i�k�3�/��������d�+�������
�&������)<�)<�)>�?r?c�6�Qo[Oo[VP
Q5oUOUOQ2UOUO
]�2UOUO
2Q2UOUO2]2P!)�_test_from_modexport_smoker&zthe expected docstring�)	r}r�rYr�r��number�
get_state_intr�get_test_tokenr�s&   r=�test_from_modexport_smoke�(ModexportTests.test_from_modexport_smoke�
s��/��"�+�+��+�G�?D�F��������)A�B��������,�����-�-�/��5����6�0�0�2�A�6r?c�p�[Q2oQo[Oo[V#P
Q5oUO	2oUOUO
U2U2UOoUOUOVe2U2QQU2oUOUOVu2U2P!)r�r{r&c��\sQsQsQsP!)�;ModexportTests.test_from_modexport_smoke_token.<locals>.Subi�
rrFrr?r=�Subr��
rGr?r�)	r r}r�rYrr��pymodule_get_token�Example�pytype_getmodulebytoken)rlr�rLrMr7�token�tpr�s&       r=�test_from_modexport_smoke_token�.ModexportTests.test_from_modexport_smoke_token�
s���!�+�.�	�.��"�+�+��+�G�?D�F���%�%�'������5�5�f�=�u�E�
�^�^������:�:�2�E�v�N�	�"�	�����:�:�3�F��Or?c��Qo[OoUO[29^tt^2[	VP
Q5PPP2P!)%fhP!9h)� _test_from_modexport_empty_slotsr&rhrjs&  r=�test_from_modexport_empty_slots�.ModexportTests.test_from_modexport_empty_slots�
s?��4��"�+�+��
�
�
�{�
+�
+�&��e�
=�,�
+�
+�
+�rmzthis module re-enables GILc�F�Qo[Oo[VP
Q5oUOUOU2UOUO
P2[
Q2o[QUP
Q5oUOUOU2UO22P!)�"_test_from_modexport_minimal_slotsr&r�r{)	r}r�rYr�r�r�r r��get_modexport_minimal_slots)rlrLrMr7r��	smoke_mods&     r=�!test_from_modexport_minimal_slots�0ModexportTests.test_from_modexport_minimal_slots�
s���
7��"�+�+��+��%�9��	
������'�2��������.�!�+�.�	�.�(�(�u�N�	�����5�5�f�=�"�>�>�@�	Br?r)r�r�r�r�rUrvrdrkrprtrxr�r�r�rr�r�r�r�s@r=rRrR@
su����3��@��@�@A�A�+��@��@�@
7�P� =��6�7�B�8�Br?rRc�(`�\sQsQsnQsQsUsP!)�TestMagicNumberi�
c�H�[OO]Q2oUOUQ*Q2[OUQ*Q2oQ[OO]2**oUOU[V3]2*22P!)rV�littler�s
:NrBNiT)r��pyc_magic_number_token�to_bytesr�r�
from_bytesrV�version_info�minorrr8)rl�magic_number_bytes�magic_number�starts&   r=�test_magic_number_endianness�,TestMagicNumber.test_magic_number_endianness�
sy��!�8�8�A�A�!�X�N�����+�B�/��9��~�~�&8��&<�h�G���s�'�'�-�-��2�2���
�
�l�E�%���$<�=r?r)r�r�r�r�r�r�r�r�s@r=r�r��
s����>�>r?r��__main__)rr/ryr�r��importlib.utilrQ�importlib._bootstrap_externalr�importlib.machineryrrrrrr�r�r�r"r
r�r{r�rVr�r�r�r�r\r4rr�rIr	r
rrr
rrrrrrrrrrr�test.support.import_helperrrrrrrrr �test.support.os_helperr!r"r#r$r%r&�test.test_importlib.utilr'r(r)rdr�r}ru�concurrent.interpretersr\r�rgrq�dont_write_bytecoder�r�rjr>rCrFrHrJrNrYrarirsrvr�rx�TestCaser�rnr�r�r�r#r3rVrmr�r�r�r5r�r�rRr�r�rrr?r=�<module>r�s��������9����	��
�	�
���
���������"������"/�/�/�4�4�&�)�F�F��������"���
'�o�o����G�G�3�#5�#5�#?�#?�4�#G�4�6��
�8A�E�A�;�e�;�?�4�?�4��4�6������� �*:� �J�=�`(�U�*�*�`(�F �s6�(�#�#�s6� �s6�l�V/�(�+�+�V/��V/�r_M��)�)�_M�D3 ��"�"�3 �l^:�(�+�+�^:�B(�8�#4�#4�(�(]!�8�$�$�]!�@+3�H�$5�$5�+3�\�<�h�/�/�<��<�@�6��*�*�6��6�Bf9�8�,�,�f9�R@�(�+�+�@�FL<�8�,�,�L<�^H�n�H�V�_
!�8�,�,�_
!��_
!�R
����D�(�*P�Q�UB�X�&�&�UB�R�UB�n�>�h�'�'�>��>��z���M�M�O���Mm���������O���
���M��J���
�����s`�L,�L<� 
M�+M�,L9�2L9�8L9�<M	�M	�M	�M�M�M�M+�$M+�*M+

Youez - 2016 - github.com/yon3zu
LinuXploit