Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_concurrent_futures/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_concurrent_futures/__pycache__/util.cpython-312.pyc

�

*Μg����ddlZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZmZddl
mZddlmZddlmZeddfd�Zee��Zee��Zee	��Zee
��Zeee��	�Zeed
��ZGd�d
ej6�ZGd�d�ZGd�de�ZGd�de�ZGd�de�Z Gd�de�Z!efeee!e ffd�Z"d�Z#y)�N)�futures)�PENDING�RUNNING�	CANCELLED�CANCELLED_AND_NOTIFIED�FINISHED�Future)�_check_system_limits)�support)�threading_helperc�D�t�}||_||_||_|S�N)r	�_state�
_exception�_result)�state�	exception�result�fs    �>/usr/local/lib/python3.12/test/test_concurrent_futures/util.py�
create_futurers#����A��A�H��A�L��A�I��H�)r)rr�*)rrc��eZdZd�Zd�Zy)�BaseTestCasec�6�tj�|_yr)r�threading_setup�_thread_key��selfs r�setUpzBaseTestCase.setUp s��+�;�;�=��rc�d�tj�tj|j�yr)r�
reap_childrenr�threading_cleanuprrs r�tearDownzBaseTestCase.tearDown#s"�������*�*�D�,<�,<�=rN)�__name__�
__module__�__qualname__r!r%�rrrrs��>�>rrc�6��eZdZdZiZ�fd�Z�fd�Zd�Z�xZS)�
ExecutorMixin�c�@��t�|��tj�|_t|d�r=|jd|j|j�d�|j��|_
y|jdd|ji|j��|_
y)N�ctx)�max_workers�
mp_contextr/r))�superr!�time�	monotonic�t1�hasattr�
executor_type�worker_count�get_context�executor_kwargs�executor�r �	__class__s �rr!zExecutorMixin.setUp,s����
��
���.�.�"����4���.�D�.�.�(� �-�-��+�+�-�(��&�&�(�D�M�
/�D�.�.�(� �-�-�(��&�&�(�D�Mrc���|jjd��d|_tj�|jz
}t
jrtd|zd��|j|dd�t�|�)�y)NT)�waitz%.2fs� )�endi,z+synchronization issue: test lasted too long)r:�shutdownr2r3r4r�verbose�print�
assertLessr1r%)r �dtr<s  �rr%zExecutorMixin.tearDown:se����
�
���D��)���
�
�^�^�
����
'���?�?��'�B�,�C�(�����C�!N�O�
���rc�@�tj|j�Sr)�multiprocessingr8r.rs rr8zExecutorMixin.get_contextEs���*�*�4�8�8�4�4r)	r&r'r(r7r9r!r%r8�
__classcell__�r<s@rr+r+(s����L��O�(�	�5rr+c�$�eZdZejZy)�ThreadPoolMixinN)r&r'r(r�ThreadPoolExecutorr6r)rrrKrKIs
���.�.�MrrKc�:��eZdZejZdZ�fd�Z�xZS)�ProcessPoolForkMixin�forkc���	t�tjdk(r|jd�tjd��r|jd�t�|�!�S#t$r|jd�Y�uwxYw�N�.ProcessPoolExecutor unavailable on this system�win32zrequire unix systemT)�threadz'TSAN doesn't support threads after fork�	r
�NotImplementedError�skipTest�sys�platformr�check_sanitizerr1r8r;s �rr8z ProcessPoolForkMixin.get_contextQ�s���	L� �"��<�<�7�"��M�M�/�0��"�"�$�/��M�M�C�D��w�"�$�$��
#�	L��M�M�J�K�	L���
A&�&B�B�	r&r'r(r�ProcessPoolExecutorr6r.r8rHrIs@rrNrNMs����/�/�M�
�C�	%�	%rrNc�:��eZdZejZdZ�fd�Z�xZS)�ProcessPoolSpawnMixin�spawnc�v��	t�t�|��S#t$r|jd�Y�*wxYw)NrR)r
rVrWr1r8r;s �rr8z!ProcessPoolSpawnMixin.get_contextas?���	L� �"��w�"�$�$��#�	L��M�M�J�K�	L�s�
�8�8r]rIs@rr`r`]s����/�/�M�
�C�%�%rr`c�:��eZdZejZdZ�fd�Z�xZS)�ProcessPoolForkserverMixin�
forkserverc���	t�tjdk(r|jd�tjd��r|jd�t�|�!�S#t$r|jd�Y�uwxYwrQrUr;s �rr8z&ProcessPoolForkserverMixin.get_contextmr[r\r]rIs@rrdrdis����/�/�M�
�C�	%�	%rrdc��d�}|d}|D]E}||j��||j��d�}t||f|fz|zd|i�}|||<�Gy)Nc�^�|jd�r|ddS|jd�r|ddS|S)N)�Mixin�Tests����Test���)�endswith)�names r�strip_mixinz*create_executor_tests.<locals>.strip_mixin~s8���=�=�+�,����9��
�]�]�6�
"����9���Krr&rlr')r&�type)	�remote_globals�mixin�bases�executor_mixinsrp�module�exero�clss	         r�create_executor_testsryysg��
��J�
'�F����s�|�|�,�k�%�.�.�.I�K���4�%��S�F�*�U�2�\�6�4J�K��"��t��	rc���tjtjj�tj�}tjt
jg|���yr)�unittest�addModuleCleanuprG�util�_cleanup_testsrrr$)�thread_infos r�setup_moduler��sD�����o�2�2�A�A�B�"�2�2�4�K����.�@�@�O�;�Or)$rGrXr2r{�
concurrentr�concurrent.futures._baserrrrrr	�concurrent.futures.processr
�testr�test.supportrr�PENDING_FUTURE�RUNNING_FUTURE�CANCELLED_FUTURE�CANCELLED_AND_NOTIFIED_FUTURE�OSError�EXCEPTION_FUTURE�SUCCESSFUL_FUTURE�TestCaserr+rKrNr`rdryr�r)rr�<module>r�s����
������<��)� �4��
��W�-���W�-�� �y�1�� -�4J� K�� �x�7�9�E��!���<��>�8�$�$�>�5�5�B/�m�/�
%�=�
%� 	%�M�	%�
%��
%� 9E��+:�+?�+E�+@�+B�#�*Pr

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists