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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/test_importlib/__pycache__/test_threaded_import.cpython-313.pyc
�

��i2��L�SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J
r
 SSKJr SSK
JrJr SSKJrJrJr SSKJrJr \R,"SS9 S	rS
SSS
S.r"SS5r"SS5r"SS\R65rSr\S:Xa\R>"5 gg)�N)�support)�verbose)�forget�mock_register_at_fork)�TESTFN�unlink�rmtree)�
script_helper�threading_helperT)�modulec��[U5S-(a	SSKnSSKnOSSKnSSKnURSS5nUR[R"55 [U5U:HnU(aUR5 gg![a*nURUR
S55 SnANzSnAff=f!UR[R"55 [U5U:HnU(aUR5 ff=f)N�r��)
�len�modulefinder�random�	randrange�	Exception�append�with_traceback�	threading�	get_ident�set)	�N�done�
done_tasks�errorsrr�x�e�finisheds	         �=C:\Python313\\Lib\test\test_importlib\test_threaded_import.py�taskr#s�����z�?�Q���������Q��"��	���)�-�-�/�0��z�?�a�'����H�H�J����.��
�
�a�&�&�t�,�-�-��.��	���)�-�-�/�0��z�?�a�'����H�H�J��s*�6B�
B7�
 B2�-B:�2B7�7B:�:ADzaif 1:
        import time
        time.sleep(%(delay)s)
        x = 'a'
        import C
        zaif 1:
        import time
        time.sleep(%(delay)s)
        x = 'b'
        import D
        zimport Bzimport A)�A�B�C�Dc�(�\rSrSrSrSrSSjrSrg)�Finder�@zEA dummy finder to detect concurrent access to its find_spec()
method.c�T�SUlSUl[R"5Ulg�Nr)�numcallsrr�Lock�lock��selfs r"�__init__�Finder.__init__Ds����
�����N�N�$��	�Nc�
�[R"5(deUR U=RS-
slSSS5 URn[
R"S5 US-Ulg!,(df   N;=f)Nr�{�G�z�?)�imp�	lock_heldr/r-r�time�sleep)r1�name�path�targetrs     r"�	find_spec�Finder.find_specIsV���}�}�����
�Y�Y��M�M�Q��M���F�F���
�
�4���Q����	�Y�s�A4�4
B)r/r-r�NN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r2r>�__static_attributes__�r4r"r)r)@s���%�
	r4r)c�"�\rSrSrSrSSjrSrg)�FlushingFinder�TzIA dummy finder which flushes sys.path_importer_cache when it gets
called.Nc�@�[RR5 g�N)�sys�path_importer_cache�clear)r1r;r<r=s    r"r>�FlushingFinder.find_specXs�����%�%�'r4rGr@)rArBrCrDrEr>rFrGr4r"rIrITs���(r4rIc�B�\rSrSrSrSr\S5r\R"SSSS9S	5r
\R"SSSS9S
5r\R"SSSS9S5rSr
S
r\S5r\R"SSSS9S5r\R"SSSS9S5rSrSrg)�ThreadedImportTests�\c�N�[RRSS5Ulg�Nr)rM�modules�pop�
old_randomr0s r"�setUp�ThreadedImportTests.setUp^s���+�+�/�/�(�D�9��r4c�Z�URbUR[RS'ggrU)rXrMrVr0s r"�tearDown�ThreadedImportTests.tearDownas%���?�?�&�$(�O�O�C�K�K��!�'r4c�<^^^	^
�[R"5(a[R"S5e[R
"5mSGH)m[(a[STSSS9 SHn[RU	M /m
/m	TR5 [R"5n[R"UUU	U
4Sj[!T555 SSS5 TR#S	5n[R"5U-
n[(a[S
US--SSS
9 S[%T	5<ST<3nUR'T
U5 UR)XF5 [(dGM[S5 GM, g![a GM f=f!,(df   N�=f)Nz"can't run when import lock is held)��2r_r`r_r`�Tryingzthreads ...� )�end)rrc3�^># �UH"n[R"[TTTT4S9v� M$ g7f)�r=�argsN)r�Threadr#)�.0�irrrrs  ����r"�	<genexpr>�AThreadedImportTests.check_parallel_module_init.<locals>.<genexpr>|s.����0'�%���$�$�D��4��V�7U�V�%�s�*-iXz%.1f msg@�@T)�flushrczdone: �/zOK.)r7r8�unittest�SkipTestr�Eventr�printrMrV�KeyErrorrOr9�	monotonicr�
start_threads�range�waitr�assertFalse�
assertTrue)r1�mock_os�modname�t0�	completed�dt�dbg_inforrrrs       @@@@r"�check_parallel_module_init�.ThreadedImportTests.check_parallel_module_iniths?����=�=�?�?��#�#�$H�I�I���� ���A��w��h��=�c�:�5������G�,�6�
�F��J��J�J�L����!�B�!�/�/�0'�"�1�X�0'�'��'��	�	�'�*�I����!�B�&�B��w��i�2�c�6�*�$�C�@��(+�J���;�H����V�X�.��O�O�I�0��w��e��3�� �����'�'�s�-E;�F
�;
F
�	F
�
F	r`i�F)�size�memuse�dry_runc�$�UR5 grL)r)r1r�s  r"�test_parallel_module_init�-ThreadedImportTests.test_parallel_module_init�s���'�'�)r4c��[5n[RRSU5 UR	5 URURS5 URURUR5 [RRU5 g![RRU5 f=fr,)
r)rM�	meta_path�insertr�
assertGreaterr-�assertEqualr�remove)r1r��finders   r"�test_parallel_meta_path�+ThreadedImportTests.test_parallel_meta_path�s������
�
���Q��'�	)��+�+�-����v����2����V�X�X�v���7��M�M� � ��(��C�M�M� � ��(�s�AB�!B?c�^�[5m[5nU4Sjn[RR	SU5 [R
R
U5 URS5 UR5nURTRS5 URTRTR5 [R
RU5 [RRU5 g![R
RU5 [RRU5 f=f)Nc�2>�TRS5 [e)N�)r>�ImportError)r<r�s �r"�	path_hook�?ThreadedImportTests.test_parallel_path_hooks.<locals>.path_hook�s������R� ��r4rr�)r)rIrM�
path_hooksr�r�rr>rr�r-r�rr�)r1r��flushing_finderr��numtestsr�s     @r"�test_parallel_path_hooks�,ThreadedImportTests.test_parallel_path_hooks�s�������)�*��	�	�����a��+��
�
���_�-�	-��%�%�b�)��6�6�8�H����v����2����V�X�X�v���7��M�M� � ��1��N�N�!�!�)�,��
�M�M� � ��1��N�N�!�!�)�,�s�A#C>�>AD>c��[RS	SSKnUR	UR
RR5 g![a N@f=f)Nz+test.test_importlib.threaded_import_hangersr)rMrVrr�+test.test_importlib.threaded_import_hangersrw�test_importlib�threaded_import_hangersr)r1�tests  r"�test_import_hangers�'ThreadedImportTests.test_import_hangers�sM��	����I�J�	;�����,�,�D�D�K�K�L���	��	�s�A�
A�Ac��^	�Sn[R"[5 UR[R
[5 [RRS[5 UR[RR[5 [R5H|up#USU0-n[[RR[US-5S5nURURS55 SSS5 UR[ U5 M~ ["R$"5 /m	U	4SjnU	4Sjn[&R("US	9n[&R("US	9nUR+5 UR+5 UR5 UR5 UR-[/T	5S
S15 g!,(df   N�=f)Ng�?r�delay�.py�wb�utf-8c�F>�SSKnTR[USS55 g�Nrr)r$r�getattr)r$�resultss �r"�	import_ab�<ThreadedImportTests.test_circular_imports.<locals>.import_ab�������N�N�7�1�c�4�0�1r4c�F>�SSKnTR[USS55 gr�)r%rr�)r%r�s �r"�	import_ba�<ThreadedImportTests.test_circular_imports.<locals>.import_ba�r�r4)r=�a�b)�os�mkdirr�
addCleanup�shutilr	rMr<r�r��circular_imports_modules�items�open�join�write�encoder�	importlib�invalidate_cachesrrg�startr�r)
r1r�r;�contents�fr�r��t1�t2r�s
         @r"�test_circular_imports�)ThreadedImportTests.test_circular_imports�sA�����
���������
�
�v�.�������6�"����������0�6�<�<�>�N�D��7�E�"2�2�H��b�g�g�l�l�6�4�%�<�8�$�?�1��������0�1�@��O�O�F�D�)�	?�	�#�#�%���	2�	2��
�
�Y�
/��
�
�
�Y�
/��
���
�
���
�
���	�
���	�����W���S�z�2�%@�?�s�%!G�
G	c���Sn[RRS[R5 UR[RR[R5 [S-n[US5nURURS55 SSS5 UR[U5 UR[[5 UR[S5 [R"5 [ R""5 [%[5 SSS5 [R&[	g!,(df   N�=f!,(df   N5=f)Nz�if 1:
            import threading
            def target():
                import random
            t = threading.Thread(target=target)
            t.start()
            t.join()
            t = Nonerr�r�r��__pycache__)rMr<r�r��curdirr�r�rr�r�r�rrr	r�r�r�wait_threads_exit�
__import__rV)r1ry�code�filenamer�s     r"�test_side_effect_import�+ThreadedImportTests.test_side_effect_import�s�����	������2�9�9�%������������3��E�>��
�(�D�
!�Q�
�G�G�D�K�K��(�)�"������)������'�����
�.��#�#�%�
�
/�
/�
1��v��2��K�K���"�
!��2�
1�s�>!E�E�
E�
E$rg�������Ac��[RR[RR[5SS5n[
R"U5 g)N�partialzcfimport.py�r�r<r��dirname�__file__r
�assert_python_ok�r1r��fns   r"�'test_concurrent_futures_circular_import�;ThreadedImportTests.test_concurrent_futures_circular_import�s8���W�W�\�\�"�'�'�/�/�(�3�#�]�4���&�&�r�*r4c��[RR[RR[5SS5n[
R"U5 g)Nr�zpool_in_threads.pyr�r�s   r"�)test_multiprocessing_pool_circular_import�=ThreadedImportTests.test_multiprocessing_pool_circular_import�s9���W�W�\�\�"�'�'�/�/�(�3�#�%9�;���&�&�r�*r4c�^^^�[R"[5 UR[R
[5 [RRS[5 UR[RR[5 Sm[[RR[TS-5S5nURS5 SSS5 UR[T5 [R"5 /m/mSUUU4Sjjn[!S5H�nTR#5 TR#5 T[R$;a[R$T	[&R("USS	9n[&R("US
S	9nUR+5 UR+5 UR5 UR5 UR-T/ST35 M� g!,(df   GN =f)Nr�failing_import_moduler��wz�
import time
PARTIAL_ATTR = 'initialized'
time.sleep(0.05)  # Widen race window
raise RuntimeError("Intentional import failure")
c�>�[R"U5 [T5nT[R;aTRSU<ST<S35 g[RTULaTRST<S35 gTRSU45 g![a TRS5 g[anTRSU35 SnAgSnAff=f)	NzGot module z but z not in sys.modulesz&Got different module than sys.modules[�]�success)�RuntimeErrorzUnexpected exception: )r9r:r�rMrVrr�r)r��modr rrzr�s   ���r"�	do_import�IThreadedImportTests.test_import_failure_race_condition.<locals>.do_import"s�����J�J�u��
<� ��)���#�+�+�-��M�M�%�c�W�E�'��<O�P���[�[��)��4��M�M�@���1�M���N�N�I�s�#3�4���
2����0�1��
<��
�
� 6�q�c�:�;�;��
<�s)�9B�,B�B�C�1	C�:C�C�
)rre)r6zRace condition detected: )r�r�rr�r�r	rMr<r�r�r�r�r�rr�r�rurOrVrrgr�r�)	r1r�r��_r�r�rrzr�s	      @@@r"�"test_import_failure_race_condition�6ThreadedImportTests.test_import_failure_race_conditions_���	���������
�
�v�.�������6�"����������0�*��
�"�'�'�,�,�v�w���7��
=��
�G�G��
�>�	
�����(��#�#�%�����	<�	<�*�r��A��L�L�N��M�M�O��#�+�+�%��K�K��(��!�!���>�B��!�!���A�B��H�H�J��H�H�J��G�G�I��G�G�I�
���V�R�+D�V�H�)M�N��E>�
=�s�G2�2
H)rXN)rArBrCrDrYr\rrr�
bigmemtestr�r�r�r�r�r�r�r�r�rFrGr4r"rRrR\s���:�4�����B
���R��%�@�*�A�*�
���R��%�@�)�A�)�
���R��%�@�-�A�-�.M�$3�L� �� �,
���Q�y�%�@�+�A�+�
���Q�y�%�@�+�A�+�?Or4rRc�:�[R"5n[R"[R/UQ76 [
R"5n[R"[
RU5 [R"S5 g![a gf=f)Ng�h㈵��>)
r�threading_setuprn�addModuleCleanup�threading_cleanuprM�getswitchinterval�setswitchintervalr�AttributeError)�thread_info�old_switchintervals  r"�setUpModuler�Hsu��"�2�2�4�K����.�@�@�O�;�O�
� �2�2�4���!�!�#�"7�"7�9K�L��!�!�$�'���
��
�s�AB
�
B�B�__main__) �_impr7r�r�rMr9r�rrnr�r�test.supportr�test.support.import_helperrr�test.support.os_helperrrr	r
r�requires_working_threadingr#r�r)rI�TestCaserRr�rA�mainrGr4r"�<module>r�s����	��
��
���� �D�;�;�8��+�+�4�8��0
�
�
�	���"��((�(�iO�(�+�+�iO�X
��z���M�M�O�r4

Youez - 2016 - github.com/yon3zu
LinuXploit