AlkantarClanX12

Your IP : 3.15.203.246


Current Path : /proc/self/root/opt/alt/python39/lib64/python3.9/asyncio/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python39/lib64/python3.9/asyncio/__pycache__/subprocess.cpython-39.pyc

a

R�f��@s�dZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ej
Z
ejZejZGd	d
�d
ej
ej�ZGdd�d�Zddddejfd
d�Zddddejd�dd�ZdS))�create_subprocess_exec�create_subprocess_shell�N�)�events)�	protocols)�streams)�tasks)�loggercsXeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Z�ZS)�SubprocessStreamProtocolz0Like StreamReaderProtocol, but for a subprocess.csHt�j|d�||_d|_|_|_d|_d|_g|_|j	�
�|_dS)N��loopF)�super�__init__�_limit�stdin�stdout�stderr�
_transport�_process_exited�	_pipe_fds�_loopZ
create_future�
_stdin_closed)�self�limitr��	__class__��7/opt/alt/python39/lib64/python3.9/asyncio/subprocess.pyrsz!SubprocessStreamProtocol.__init__cCsn|jjg}|jdur&|�d|j���|jdurB|�d|j���|jdur^|�d|j���d�d�|��S)Nzstdin=zstdout=zstderr=z<{}>� )r�__name__r�appendrr�format�join)r�inforrr�__repr__s



z!SubprocessStreamProtocol.__repr__cCs�||_|�d�}|durDtj|j|jd�|_|j�|�|j�	d�|�d�}|dur�tj|j|jd�|_
|j
�|�|j�	d�|�d�}|dur�tj||d|jd�|_dS)Nr�rr�r)�protocol�readerr)
r�get_pipe_transportr�StreamReaderrrrZ
set_transportrr r�StreamWriterr)r�	transportZstdout_transportZstderr_transportZstdin_transportrrr�connection_made)s,
�
�
�z(SubprocessStreamProtocol.connection_madecCs:|dkr|j}n|dkr |j}nd}|dur6|�|�dS)Nrr&)rrZ	feed_data)r�fd�datar(rrr�pipe_data_receivedAsz+SubprocessStreamProtocol.pipe_data_receivedcCs�|dkrN|j}|dur|��|�|�|dur>|j�d�n|j�|�dS|dkr^|j}n|dkrn|j}nd}|dur�|dur�|��n
|�|�||j	vr�|j	�
|�|��dS)Nrrr&)r�closeZconnection_lostrZ
set_resultZ
set_exceptionrrZfeed_eofr�remove�_maybe_close_transport)rr.�exc�piper(rrr�pipe_connection_lostKs*



z-SubprocessStreamProtocol.pipe_connection_lostcCsd|_|��dS)NT)rr3�rrrr�process_exitedfsz'SubprocessStreamProtocol.process_exitedcCs(t|j�dkr$|jr$|j��d|_dS)Nr)�lenrrrr1r7rrrr3js
z/SubprocessStreamProtocol._maybe_close_transportcCs||jur|jSdS�N)rr)r�streamrrr�_get_close_waiteros
z*SubprocessStreamProtocol._get_close_waiter)
r�
__module__�__qualname__�__doc__rr$r-r0r6r8r3r<�
__classcell__rrrrr
s	

r
c@sjeZdZdd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�ZdS)�ProcesscCs8||_||_||_|j|_|j|_|j|_|��|_dSr:)rZ	_protocolrrrrZget_pid�pid)rr,r'rrrrruszProcess.__init__cCsd|jj�d|j�d�S)N�<r�>)rrrBr7rrrr$~szProcess.__repr__cCs
|j��Sr:)rZget_returncoder7rrr�
returncode�szProcess.returncodec�s|j��IdHS)z?Wait until the process exit and return the process return code.N)rZ_waitr7rrr�wait�szProcess.waitcCs|j�|�dSr:)r�send_signal)r�signalrrrrG�szProcess.send_signalcCs|j��dSr:)r�	terminater7rrrrI�szProcess.terminatecCs|j��dSr:)r�killr7rrrrJ�szProcess.killc
�s�|j��}|j�|�|r,t�d|t|��z|j��IdHWn:tt	fyz}z|rft�d||�WYd}~n
d}~00|r�t�d|�|j�
�dS)Nz%%r communicate: feed stdin (%s bytes)z%r communicate: stdin got %rz%r communicate: close stdin)r�	get_debugr�writer	�debugr9Zdrain�BrokenPipeError�ConnectionResetErrorr1)r�inputrMr4rrr�_feed_stdin�s

�$zProcess._feed_stdinc�sdSr:rr7rrr�_noop�sz
Process._noopc�s�|j�|�}|dkr|j}n|dks(J�|j}|j��rV|dkrDdnd}t�d||�|��IdH}|j��r�|dkrzdnd}t�d||�|�	�|S)Nr&rrrz%r communicate: read %sz%r communicate: close %s)
rr)rrrrKr	rM�readr1)rr.r,r;�name�outputrrr�_read_stream�s

zProcess._read_streamNc�s�|dur|�|�}n|��}|jdur2|�d�}n|��}|jdurP|�d�}n|��}tj||||jd�IdH\}}}|��IdH||fS)Nrr&r)	rQrRrrVrrZ_gatherrrF)rrPrrrrrr�communicate�s


�zProcess.communicate)N)rr=r>rr$�propertyrErFrGrIrJrQrRrVrWrrrrrAts	
rAc
�sb�durt���ntjdtdd���fdd�}�j||f|||d�|��IdH\}}	t||	��S)N�ZThe loop argument is deprecated since Python 3.8 and scheduled for removal in Python 3.10.r&��
stacklevelcst��d�S�Nr%�r
rr%rr�<lambda>�s�z)create_subprocess_shell.<locals>.<lambda>�rrr)r�get_event_loop�warnings�warn�DeprecationWarningZsubprocess_shellrA)
�cmdrrrrr�kwds�protocol_factoryr,r'rr%rr�s"
����r)rrrrrc�sh�durt���ntjdtdd���fdd�}�j||g|�R|||d�|��IdH\}	}
t|	|
��S)NrYr&rZcst��d�Sr\r]rr%rrr^�s�z(create_subprocess_exec.<locals>.<lambda>r_)rr`rarbrcZsubprocess_execrA)Zprogramrrrrr�argsrerfr,r'rr%rr�s&
�����r)�__all__�
subprocessra�rrrr�logr	�PIPEZSTDOUTZDEVNULLZFlowControlMixinZSubprocessProtocolr
rAZ_DEFAULT_LIMITrrrrrr�<module>s*�bV�
�