AlkantarClanX12

Your IP : 3.141.42.41


Current Path : /lib64/python3.8/multiprocessing/__pycache__/
Upload File :
Current File : //lib64/python3.8/multiprocessing/__pycache__/popen_spawn_win32.cpython-38.pyc

U

e5d��@s�ddlZddlZddlZddlZddlZddlmZmZmZddl	m
Z
ddl	mZdgZdZ
ejdkoreed	d
�Zej���d�Zdd
�Zeejej�Zdd�ZGdd�de�ZdS)�N�)�	reduction�get_spawning_popen�set_spawning_popen)�spawn)�util�PopeniZwin32�frozenFzpythonservice.execCs ||kptj�|�tj�|�kS�N)�os�path�normcase)Zp1Zp2�r�9/usr/lib64/python3.8/multiprocessing/popen_spawn_win32.py�_path_eqsrcGs|D]}t�|�qdSr
)�_winapi�CloseHandle)Zhandles�handlerrr�_close_handlessrc@sJeZdZdZdZdd�Zdd�Zddd	�Zd
d�Zdd
�Z	e	Z
dd�ZdS)rz@
    Start a subprocess to run the code of a process object
    rcCsTt�|j�}t�dd�\}}t�|d�}tjt�	�|d�}d�
dd�|D��}t��}tr�t
|tj�r�tj}tj��}tj|d<nd}t|ddd	���}	z0t�||ddd
d|dd�	\}
}}}
t�|�Wnt�|��YnX||_d|_|
|_t|
�|_t�|t|jt|�f�|_t|�zt �!||	�t �!||	�W5td�XW5QRXdS)Nr)Z
parent_pidZpipe_handle� css|]}d|VqdS)z"%s"Nr)�.0�xrrr�	<genexpr>9sz!Popen.__init__.<locals>.<genexpr>�__PYVENV_LAUNCHER__�wbT)�closefdF)"rZget_preparation_data�_namerZ
CreatePipe�msvcrtZopen_osfhandleZget_command_liner�getpid�joinZget_executable�WINENVr�sys�
executable�_base_executable�environ�copy�openZ
CreateProcessr�pid�
returncode�_handle�int�sentinelrZFinalizer�	finalizerrr�dump)�selfZprocess_objZ	prep_dataZrhandleZwhandleZwfd�cmdZ
python_exe�envZto_childZhpZhtr'�tidrrr�__init__,sT
�
�

�zPopen.__init__cCs|t�kst�t�||j�Sr
)r�AssertionErrorrZ	duplicater+)r.rrrr�duplicate_for_childaszPopen.duplicate_for_childNcCst|jdkrn|dkrtj}ntdt|dd��}t�t|j�|�}|tjkrnt�|j�}|t	krht
j}||_|jS)Nri�g�?)r(rZINFINITE�maxr*ZWaitForSingleObjectr)Z
WAIT_OBJECT_0ZGetExitCodeProcess�	TERMINATE�signal�SIGTERM)r.�timeoutZmsecs�res�coderrr�waites

z
Popen.waitcCs|jdd�S)Nr�r9)r<�r.rrr�pollusz
Popen.pollcCsL|jdkrHzt�t|j�t�Wn&tk
rF|jdd�dkrB�YnXdS)Ng�?r=)r(rZTerminateProcessr*r)r6�OSErrorr<r>rrr�	terminatexs
zPopen.terminatecCs|��dSr
)r,r>rrr�close�szPopen.close)N)�__name__�
__module__�__qualname__�__doc__�methodr2r4r<r?rA�killrBrrrrr&s5
)rrr7r!r�contextrrr�rr�__all__r6�platform�getattrZWINEXEr"�lower�endswithZ
WINSERVICErr#r r�objectrrrrr�<module>s