Your IP : 3.133.127.131


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/subprocess.cpython-312.opt-2.pyc

�

�Q�f�Z���	ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
Z
	ddlZgd�Z	ddlZdZej(dvZer@ddlZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(ejSgd��nYerCdd	l*m+Z,ejZZ.ej^Z0ejbZ2ejfZ4ejjZ6ndZ,dZ.dZ0dZ2dZ4dZ6ddl7Z7ddl8Z8Gd
�de9�Z:Gd�d
e:�Z;Gd�de:�Z<erGd�d�Z=Gd�de>�Z?n,e@e7dd�ZAeBe8d�r
e8j�ZDne8j�ZDerdZFd�ZGngZFd�ZGdZHdZIdZJd�ZKd�ZLd�ZMdd�d �ZNd!�ZOdd�d"�ZPGd#�d$eQ�ZRddddd%�d&�ZSd'�ZTddd(�d)�ZUddd(�d*�ZVd+�ZWeW�ZXdZYGd,�d-�ZZy#e$rdZY���wxYw#e$rdZY���wxYw).�N)�	monotonic)�Popen�PIPE�STDOUT�call�
check_call�getstatusoutput�	getoutput�check_output�run�CalledProcessError�DEVNULL�SubprocessError�TimeoutExpired�CompletedProcessTF>�wasi�
emscripten)�CREATE_NEW_CONSOLE�CREATE_NEW_PROCESS_GROUP�STD_INPUT_HANDLE�STD_OUTPUT_HANDLE�STD_ERROR_HANDLE�SW_HIDE�STARTF_USESTDHANDLES�STARTF_USESHOWWINDOW�ABOVE_NORMAL_PRIORITY_CLASS�BELOW_NORMAL_PRIORITY_CLASS�HIGH_PRIORITY_CLASS�IDLE_PRIORITY_CLASS�NORMAL_PRIORITY_CLASS�REALTIME_PRIORITY_CLASS�CREATE_NO_WINDOW�DETACHED_PROCESS�CREATE_DEFAULT_ERROR_MODE�CREATE_BREAKAWAY_FROM_JOB)rrrrrrrr�STARTUPINFOrrrrr r!r"r#r$r%)�	fork_execc��eZdZy)rN)�__name__�
__module__�__qualname__���1/opt/alt/python312/lib64/python3.12/subprocess.pyrr{s�r-rc�P�eZdZ	dd�Zd�Zed��Zejd��Zy)r
Nc�<�||_||_||_||_y�N)�
returncode�cmd�output�stderr)�selfr2r3r4r5s     r.�__init__zCalledProcessError.__init__�s��$�����������r-c�&�|jr@|jdkr1d|j�dtj|j��d�Sd|j|jfzS#t$rd|j|jfzcYSwxYw)Nr�	Command 'z' died with �.z)Command '%s' died with unknown signal %d.z.Command '%s' returned non-zero exit status %d.)r2r3�signal�Signals�
ValueError�r6s r.�__str__zCalledProcessError.__str__�s����?�?�t����2�
4����&�.�.�$�/�/�1A�"B�D�D�D��H�H�d�o�o�G/�/�
/��	�
4�B����4�?�?�"2�F4�4�4�
4�s�0A(�(%B�Bc��	|jSr1�r4r>s r.�stdoutzCalledProcessError.stdout�s��9��{�{�r-c��||_yr1rA�r6�values  r.rBzCalledProcessError.stdout������r-�NN�r)r*r+r7r?�propertyrB�setterr,r-r.r
r
~s=����
/������]�]���r-r
c�P�eZdZ	dd�Zd�Zed��Zejd��Zy)rNc�<�||_||_||_||_yr1)r3�timeoutr4r5)r6r3rMr4r5s     r.r7zTimeoutExpired.__init__�s�������������r-c�<�d|j�d|j�d�S)Nr9z' timed out after z seconds)r3rMr>s r.r?zTimeoutExpired.__str__�s�����4�<�<�)�	*r-c��|jSr1rAr>s r.rBzTimeoutExpired.stdout�s���{�{�r-c��||_yr1rArDs  r.rBzTimeoutExpired.stdout�rFr-rGrHr,r-r.rr�s=����*������]�]���r-rc�(�eZdZddddddd�d�Zd�Zy)r&rN��dwFlags�	hStdInput�
hStdOutput�	hStdError�wShowWindow�lpAttributeListc�d�||_||_||_||_||_|xsdgi|_y)N�handle_listrR)r6rSrTrUrVrWrXs       r.r7zSTARTUPINFO.__init__�s8��"�D�L�&�D�N�(�D�O�&�D�N�*�D��#2�#I�}�b�6I�D� r-c���|jj�}d|vrt|d�|d<t|j|j
|j|j|j|��S)NrZrR)	rX�copy�listr&rSrTrUrVrW)r6�	attr_lists  r.r\zSTARTUPINFO.copy�sf���,�,�1�1�3�I��	�)�+/�	�-�0H�+I�	�-�(��t�|�|�)-���*.�/�/�)-���+/�+;�+;�/8�:�
:r-)r)r*r+r7r\r,r-r.r&r&�s��&'�4�D�#��D�	J�
	:r-r&c�>�eZdZdZej
fd�Zd�Zd�ZeZ	y)�HandleFc�<�|jsd|_||�yy)NT)�closed)r6�CloseHandles  r.�ClosezHandle.Close�s���;�;�"����D�!�r-c�T�|jsd|_t|�Std��)NTzalready closed)rb�intr=r>s r.�Detachz
Handle.Detach�s&���;�;�"����4�y� ��-�.�.r-c�J�d|jjt|�fzS)Nz%s(%d))�	__class__r)rfr>s r.�__repr__zHandle.__repr__�s ���t�~�~�6�6��D�	�B�B�Br-N)
r)r*r+rb�_winapircrdrgrj�__del__r,r-r.r`r`�s'����$+�$7�$7�	"�
	/�	C��r-r`�PIPE_BUFi�PollSelectorc��yr1r,r,r-r.�_cleanuprps��r-c��t�ytddD];}|jtj��}|��&	tj	|��=y#t
$rY�JwxYw)N��
_deadstate)�_active�_internal_poll�sys�maxsize�remover=)�inst�ress  r.rprps[���?���A�J�D��%�%����%�=�C�����N�N�4�(�	��
"����s�A�	A�A���������c�x�	g}tjj}|dkDr|jdd|zz�|S)Nr�-�O)rv�flags�optimize�append)�argsrEs  r.�"_optim_args_from_interpreter_flagsr�"s<��+�
�D��I�I���E��q�y����C�#��+�%�&��Kr-c��	ddddddd�}t�}|j�D]<\}}ttj|�}|dkDs�&|jd	||zz��>tjjr|jd
�n�tjjr|jd�tjjr|jd�tjjr|jd
�tjdd}ttdi�}tjj}tjj}|dkDr|jd�n|r|jd�|r|jd�|D]}|jd|z��|r|jd�dD]-}||vs�||}	|	dur|}
n|�d|	��}
|jd|
f��/|S)N�d�B�S�v�b�q)�debug�dont_write_bytecode�no_site�verbose�
bytes_warning�quietrrz-Iz-Ez-sz-P�	_xoptions�zerror::BytesWarningzdefault::BytesWarning�defaultz-W)�-X�dev)�faulthandler�tracemalloc�
importtime�frozen_modules�showrefcount�utf8T�=r�)r��items�getattrrvr�r��isolated�ignore_environment�no_user_site�	safe_path�warnoptionsr��dev_moderx�extend)�flag_opt_mapr��flag�optr��warnopts�xoptionsr�r�rE�args           r.�_args_from_interpreter_flagsr�,s���A�� #�����
�L�.�/�D�!�'�'�)�	��c��C�I�I�t�$���q�5��K�K��c�A�g�
�&�*�
�y�y������D���9�9�'�'��K�K����9�9�!�!��K�K����9�9����K�K������q�!�H��s�K��,�H��I�I�+�+�M��y�y�!�!�H��q�����-�.�	����/�0�����	�"������D�3�J�������M�"�:���(�?��S�M�E���}���!$�e�,���K�K��s��$�:��Kr-c��tjjr�tj�}|jj
}d}|jx}r.|jj
|k7rn|dz
}|jx}r�.tjdt|�tjjrytj�S)N�r�z"'encoding' argument not specified.zutf-8)
rvr��warn_default_encoding�	_getframe�f_code�co_filename�f_back�warnings�warn�EncodingWarning�	utf8_mode�locale�getencoding)�f�filename�
stacklevels   r.�_text_encodingr�is����y�y�&�&��M�M�O���8�8�'�'���
��8�8�m�a�m��x�x�#�#�x�/���!�O�J��8�8�m�a�m�	�
�
�:�%�z�	3��y�y�����!�!�#�#r-�rMc��	t|i|��5}	|j|��cddd�S#|j��xYw#1swYyxYw)Nr�)r�wait�kill)rM�	popenargs�kwargs�ps    r.rr}sQ���
�	�	$�V�	$��	��6�6�'�6�*����	�
�F�F�H���

%�	$�s�A�*�=�A�A	c�h�	t|i|��}|r$|jd�}|�|d}t||��y)Nr�r)r�getr
)r�r��retcoder3s    r.rr�sG����I�(��(�G���j�j�� ���;��A�,�C� ��#�.�.�r-c��	dD]}||vs�t|�d���d|vrS|d�N|jd�s3|jd�s"|jd�s|jd�rd}nd	}||d<t|t|d
d�|��jS)N)rB�checkz- argument not allowed, it will be overridden.�input�universal_newlines�text�encoding�errors�r-T)rBrMr�)r=r�rrrB)rMr�r��kw�emptys     r.rr�s���!�D"��
��<���t�#P�Q�R�R�"��&��V�G�_�4��:�:�*�+�v�z�z�&�/A�V�Z�Z�PZ�E[��:�:�h�'��E��E���w���	�$��t������ r-c�F�eZdZ	dd�Zd�Zeej�Zd�Z	y)rNc�<�||_||_||_||_yr1)r�r2rBr5)r6r�r2rBr5s     r.r7zCompletedProcess.__init__�s����	�$��������r-c��dj|j�dj|j�g}|j�*|j	dj|j��|j
�*|j	dj|j
��djt
|�jdj|��S)Nz	args={!r}zreturncode={!r}zstdout={!r}zstderr={!r}z{}({})z, )	�formatr�r2rBr�r5�typer)�join)r6r�s  r.rjzCompletedProcess.__repr__�s����"�"�4�9�9�-�!�(�(����9�;���;�;�"��K�K�
�,�,�T�[�[�9�:��;�;�"��K�K�
�,�,�T�[�[�9�:����t�D�z�2�2�D�I�I�d�O�D�Dr-c��	|jr6t|j|j|j|j��yr1)r2r
r�rBr5r>s r.�check_returncodez!CompletedProcess.check_returncode�s7��D��?�?�$�T�_�_�d�i�i����%)�[�[�2�
2�r-rG)
r)r*r+r7rj�classmethod�types�GenericAlias�__class_getitem__r�r,r-r.rr�s*��	��E�$�E�$6�$6�7��2r-r)r��capture_outputrMr�c��	|�%|jd��td��t|d<|r?|jd��|jd��td��t|d<t|d<t|i|��5}	|j	||��\}}|j�}
|r|
rt|
|j||���ddd�tj
�S#t
$rJ}	|j
�tr|j	�\|	_|	_	�|j��d}	~	w|j
��xYw#1swY��xYw)N�stdinz/stdin and input arguments may not both be used.rBr5z@stdout and stderr arguments may not be used with capture_output.r��r4r5)r�r=rr�communicaterr��
_mswindowsrBr5r��pollr
r�r)r�r�rMr�r�r��processrBr5�excr�s           r.rr�sO���8
���:�:�g��*��N�O�O���w����:�:�h��+�v�z�z�(�/C�/O��4�5�
5���x����x��	�	�	$�V�	$��	�$�0�0���0�H�N�F�F�&�,�,�.���W�$�W�g�l�l�,2�6�C�
C�/
%�2�G�L�L�'�6�6�B�B��-�
	��L�L�N��*1�)<�)<�)>�&��
�C�J�

�������	��L�L�N���)
%�	$�s1�5E�7C�
-E�	D>�#AD(�(D>�>E�E
c�D�	g}d}ttj|�D]�}g}|r|jd�d|vxs	d|vxs|}|r|jd�|D]x}|dk(r|j|��|dk(r4|jdt	|�zdz�g}|jd��S|r|j|�g}|j|��z|r|j|�|s��|j|�|jd���dj
|�S)	NF� �	�"�\r�z\"r�)�map�os�fsdecoder��lenr�r�)�seq�result�	needquoter��bs_buf�cs      r.�list2cmdliner�@s���:�F��I��2�;�;��$������M�M�#���C�Z�<�T�S�[�<��W�	���M�M�#���A��D�y��
�
�a� ��c���
�
�d�S��[�0��2�3����
�
�e�$���M�M�&�)��F��
�
�a� ��"��M�M�&�!���M�M�&�!��M�M�#��C%�F�7�7�6�?�r-�r�r�c��		t|ddt||��}d}|dddk(r|dd}||fS#t$r"}|j}|j}Yd}~�7d}~wwxYw)NT)�shellr�r5r�r�rr{�
)rrr
r4r2)r3r�r��data�exitcode�exs      r.r	r	�sq���(!��C�t�$�v�%-�f�>�����B�C�y�D���C�R�y���T�>����!��y�y���=�=���!�s�+�	A�A�Ac�&�	t|||��dS)Nr�r�)r	)r3r�r�s   r.r
r
�s����3��&�A�!�D�Dr-c��	tsttd�sytjdvry	tj
d�}|j
d��}t|�dk7rt�|d	}ttt|dj
d
���}tjdk(r|dk(r|d
k\ryy#tttf$rYywxYw)N�posix_spawnF)�darwin�sunos5T�CS_GNU_LIBC_VERSIONr�)�maxsplitr�rr:�linux�glibc)r��)r��hasattrr�rv�platform�confstr�splitr�r=�tupler�rf�AttributeError�OSError)�ver�parts�libc�versions    r.�_use_posix_spawnr�s�������]�3��
�|�|�+�+��
��j�j�.�/���	�	�1�	�%���u�:��?����Q�x����C��q�����!4�5�6���<�<�7�"�t�w��7�g�;M����
�J��0�
���
�s�BB7�7C�
Cc�8�eZdZ	dZ							d,dddddddddd�	d�Zd�Zeej�Z	e
d��Zejd��Zd	�Z
d
�Zd�Zej"ej&fd�Zd
�Zd�Zd-d�Zd�Zd�Z	d.d�Zd/d�Zd�Zej<d��Ze rDd�Z!d�Z"d�Z#d�Z$de%jLe%jNe%jPfd�Z)d�Z*d�Z+d�Z,d�Z-d�Z.e.Z/yd �Z!d!�Z0d"�Z$e1e2e3fd#�Z4de5e6e7jpfd$�Z)d%�Z9d&�Z*d'�Z,d(�Z:d)�Z-d*�Z.d+�Z/y)0rFr{N)	�user�group�extra_groupsr�r�r��umask�pipesize�
process_groupc	��
�	ts+ttjtj
�d���t
�tj�|_	d|_
d|_|�d}t|t�std��|�d}t|t�std��tr
|�Ht!d��|r|st#j$dt&�d}|
�t!d	��|d
k7rt!d��||_d|_d|_d|_d|_d|_||_||_||_|�$|�"t;|�t;|�k7rt=d��|xs
|xs|xs||_|j>r|�tA�x|_}d
|_!d|_"|j>r|dk(rd}d}nd}|�d}d}|��tGtHd�st!d��t|tJ�r!	d
dl&}|jQ|�jR}n6t|t�r|}n#tdjUtW|����|d
krt!d|����d}|��tGtHd�st!d��t|tJ�rt!d��g}|D]�}t|tJ�r0	d
dl&}|jY|jQ|�jR��Ct|t�r|jY|��etdjUtW|����|D]} | d
ks�	t!d| ����d}!|�}tGtHd�st!d��t|tJ�r!	d
dl-}"|"j]|�j^}!nt|t�r|}!ntd��|!d
krt!d|!����|ja|||�\}#}$}%}&}'}(tr{|$dk7r$tcjd|$jg�d
�}$|%dk7r$tcjd|%jg�d
�}%|'dk7r$tcjd|'jg�d
�}'	|$dk7rQtijj|$d|�|_|j>r)tijl|j*d||��|_|%dk7rOtijj|%d |�|_|j>r'tijl|j,||�!�|_|'dk7rOtijj|'d |�|_|j>r'tijl|j.||�!�|_|jo||||||
||
||	|#|$|%|&|'|(||||!|||�y#tN$rt!d��wxYw#tN$rt!d��wxYw#tN$rt!d��wxYw#tqd|j*|j,|j.f�D]"})	|)js��#t$rY� wxYw|jDs�g}*|ttk(r|*jY|#�|ttk(r|*jY|&�|ttk(r|*jY|(�tG|d"�r|*jY|jv�|*D]N}+	tr!t|+tx�r|+j{�ntIjr|+��A#t$rY�LwxYw�xYw)#Nz does not support processes.Fr{zbufsize must be an integerzpipesize must be an integerz0preexec_fn is not supported on Windows platformszpass_fds overriding close_fds.Tz2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformszlCannot disambiguate when both text and universal_newlines are supplied but different. Pass one or the other.g�?r��setregidz>The 'group' parameter is not supported on the current platformzHThe group parameter cannot be a string on systems without the grp modulez,Group must be a string or an integer, not {}z!Group ID cannot be negative, got �	setgroupszEThe 'extra_groups' parameter is not supported on the current platformz#Groups must be a list, not a stringzIItems in extra_groups cannot be strings on systems without the grp modulez9Items in extra_groups must be a string or integer, not {}�setreuidz=The 'user' parameter is not supported on the current platformzGThe user parameter cannot be a string on systems without the pwd modulez#User must be a string or an integerz User ID cannot be negative, got �wb)�
write_through�line_bufferingr�r��rbr��_devnull)>�_can_fork_execr�errno�ENOTSUPrvr
rp�	threading�Lock�
_waitpid_lock�_input�_communication_started�
isinstancerf�	TypeErrorr�r=r�r��RuntimeWarningr�r�rBr5�pidr2r�r�r�boolr�	text_moder��_sigint_wait_secs�_closed_child_pipe_fdsr	r��str�grp�ImportError�getgrnam�gr_gidr�r�r��pwd�getpwnam�pw_uid�_get_handles�msvcrt�open_osfhandlerg�io�open�
TextIOWrapper�_execute_child�filter�closerr$r`rd),r6r��bufsize�
executabler�rBr5�
preexec_fn�	close_fdsr��cwd�envr��startupinfo�
creationflags�restore_signals�start_new_session�pass_fdsrrrr�r�r�rrrr"�gidr6�gids�extra_group�	gid_check�uidr:�p2cread�p2cwrite�c2pread�c2pwrite�errread�errwriter��to_close�fds,                                            r.r7zPopen.__init__'s���	)����
�
�#�,�,��/K�L��
�	�
�'�^�^�-������&+��#��?��G��'�3�'��8�9�9����H��(�C�(��9�:�:���%� �"-�.�.��	��
�
�>��O� �	��&� �"-�.�.���!� �"-�.�.���	���
������������� ��
���� ��
�
��!3�!?��'�(�D��J�6�!�#F�G�
G�"�I�V�I�t�I�7I����>�>�h�.�'5�'7�7�D�M�H�
"&���&+��#��>�>��!�|�!%����!&��� ��M������2�z�*� �"4�5�5��E�3�'�J��
�l�l�5�)�0�0���E�3�'���� N�!'���U��!4�6�6��Q�w� �#D�S�E�!J�K�K����#��2�{�+� �"E�F�F��L�#�.� �!F�G�G��D�+���k�3�/�7�"��K�K����[� 9� @� @�A���S�1��K�K��,�#�%9�%+�V�D��,=�%>�@�@� ,�&"�	��q�=�$�'H���%T�U�U�"������2�z�*� �"8�9�9��D�#�&�J���l�l�4�(�/�/���D�#�&���� E�F�F��Q�w� �#C�C�5�!I�J�J�&#�/�/��v�v�F�	��(�	�(�	�(���2�~�!�0�0����1B�A�F���"�}� �/�/����0@�!�D���"�}� �/�/����0@�!�D��6	��2�~��W�W�X�t�W�=��
��>�>�!#�!1�!1�$�*�*�D�+9�%-�f�">�D�J��"�}� �g�g�g�t�W�=����>�>�"$�"2�"2�4�;�;�%-�f�#>�D�K��"�}� �g�g�g�t�W�=����>�>�"$�"2�"2�4�;�;�%-�f�#>�D�K�
����j�*�i� (�#�s� +�]�E� '�� '�� '�� /� #�T�3�� 1�=�
B��o#�J�$�&I�J�J�J��8'�7�(�*6�7�7�7��8#�J�$�&I�J�J�J��P	��D�4�:�:�t�{�{�D�K�K�"H�I����G�G�I�������J��.�.����D�=��O�O�G�,��T�>��O�O�H�-��T�>��O�O�H�-��4��,��O�O�D�M�M�2�"�B��%�*�R��*@��H�H�J��H�H�R�L��"�����
#�
�sz�#U0�V�V �
D%V8�0V�V� V5�82[#�+W<�;[#�<	X�[#�X�B[#�<[�[#�	[�[#�[�[#c��d|jj�d|j�d|j�d�}t	|�dkDr|dddz}|S)N�<z: returncode: z args: �>�P�Lz...>)rir)r2r�r�)r6�obj_reprs  r.rjzPopen.__repr__(s]������'�'�(�)��?�?�+�7�4�9�9�-�q�
B�	��x�=�2�����}�v�-�H��r-c��|jSr1)r2r>s r.r�zPopen.universal_newlines3s���~�~�r-c�$�t|�|_yr1)r1r2)r6r�s  r.r�zPopen.universal_newlines9s���0�1��r-c�j�|j||�}|jdd�jdd�S)Nz
r��
)�decode�replace)r6r�r�r�s    r.�_translate_newlineszPopen._translate_newlines=s0���{�{�8�V�,���|�|�F�D�)�1�1�$��=�=r-c��|Sr1r,r>s r.�	__enter__zPopen.__enter__As���r-c��|jr|jj�|jr|jj�	|jr|jj�|tk(r<|j
dkDr%	|j
|j
��d|_yd|_y|j�y#t$r
Yd|_ywxYw#|tk(rF|j
dkDr-	|j
|j
��n#t$rYnwxYwd|_Yy|j�wxYw)Nrr�)	rBrEr5r��KeyboardInterruptr3�_waitrr�)r6�exc_typerE�	tracebacks    r.�__exit__zPopen.__exit__Ds���;�;��K�K�����;�;��K�K����	��z�z��
�
� � �"��,�,��)�)�A�-���
�
�4�+A�+A�
�B�*+��&��*+��&��
�I�I�K��
*���)*��&�����,�,��)�)�A�-���
�
�4�+A�+A�
�B��)�����)*��&��
�I�I�K�sH�&C �
C
�
	C�C� E�:D�E�	D#� E�"D#�#E�0Ec���|jsy|j�|d|jzt|��|j	|��|j�t
�t
j
|�yyy)Nzsubprocess %s is still running)�sourcerr)�_child_createdr2r0�ResourceWarningrurtr�)r6�_maxsize�_warns   r.rlz
Popen.__del__`si���"�"���?�?�"�
�2�T�X�X�=�!�$�
0�	
���x��0��?�?�"�w�':��N�N�4� �(;�"r-c��t|d�s7tjtjtj�|_|j
S�Nr$)r	r�rA�devnull�O_RDWRr$r>s r.�_get_devnullzPopen._get_devnullos0���t�Z�(��G�G�B�J�J��	�	�:�D�M��}�}�r-c�r�|r	|jj|�	|jj
�y#t$rY�'t$r)}|jtj
k(rn�Yd}~�Sd}~wwxYw#t$rYyt$r)}|jtj
k(rn�Yd}~yd}~wwxYwr1)r��write�BrokenPipeErrorrr&�EINVALrE)r6r�r�s   r.�_stdin_writezPopen._stdin_writets����
��
�
� � ��'�	��J�J�����#�
���
��9�9����,�����
���	���	��y�y�E�L�L�(�����	�s8�;�A:�	A7�A7�A2�2A7�:	B6�B6�
B1�1B6c���	|jr
|rtd��|��|js�|j|j|jgjd�dk\r�d}d}|jr|j
|�n�|jr5|jj�}|jj�n@|jr4|jj�}|jj�|j�||fS|�t�|z}nd}	|j|||�\}}	d|_|j|j|���}||fS#t$r_|�&t|j|j|��}n|j}d|_	|j!|���#t"$rY�wxYwwxYw#d|_wxYw)Nz.Cannot send input after starting communicationr�rr�T)r,r=r�rBr5�countr��readrEr��_time�_communicatern�minr3�_remaining_timeror)r6r�rMrBr5�endtime�sigint_timeout�stss        r.r�zPopen.communicate�s���	�"�&�&�5��M�N�N�

�O�D�$?�$?�
�Z�Z����d�k�k�2�8�8��>�!�C��F��F��z�z��!�!�%�(�������)�)�+�����!�!�#�������)�)�+�����!�!�#��I�I�K�:����7�"��'�G�+����
3�!%�!2�!2�5�'�7�!K����"/3��+��)�)�D�$8�$8��$A�)�B�C������)%�

��&�%(��)?�)?�)-�)=�)=�g�)F�&H�N�&*�%;�%;�N�)*��&���J�J�~�J�6���&������

�� /3��+�s=�(E+�+AG�0G�G�	G�G�G�G�G�	Gc�$�	|j�Sr1)rur>s r.r�z
Popen.poll�s��	��"�"�$�$r-c�$�	|�y|t�z
Sr1)r�)r6r�s  r.r�zPopen._remaining_time�s��C��?���U�W�$�$r-c��	|�y|s
t�|kDrDt|j||rdj|�nd|rdj|����d���y)Nr-r�)r�rr�r�)r6r��orig_timeout�
stdout_seq�
stderr_seq�skip_check_and_raises      r.�_check_timeoutzPopen._check_timeout�sg��@��?���5�7�W�#4� ��I�I�|�3=�3�8�8�J�/�4�3=�3�8�8�J�/�I�
I�DH�I�
I�$5r-c��	|�
t�|z}	|j|��S#t$r_|�&t|j|j��}n|j}d|_	|j|���#t$rY�wxYwwxYw)Nr�r)r�rornr�r3r�r)r6rMr�r�s    r.r�z
Popen.wait�s���K����g��'�G�	��:�:�g�:�.�.�� �	�
�"�!$�T�%;�%;�%)�%9�%9�'�%B�"D��"&�!7�!7��%&�D�"�
��
�
�>�
�2�
��"�
���
��	�s.�$�AB�)A<�;B�<	B�B�B�Bc��t|dd�}tj�5}tra|dk7r|j	|j
�|dk7r|j	|j
�|dk7r�|j	|j
�n�|dk7r*|dk7r%||k7r |j	tj|�|dk7r*|dk7r%||k7r |j	tj|�|dk7r*|dk7r%||k7r |j	tj|�|� |j	tj|�ddd�d|_y#1swYd|_yxYw)Nr$r{T)	r��
contextlib�	ExitStackr��callbackrdr�rEr4)	r6rVrWrXrYrZr[�
devnull_fd�stacks	         r.�_close_pipe_fdszPopen._close_pipe_fdss��
�T�:�t�4�
�
�
!�
!�
#�u���b�=��N�N�7�=�=�1��r�>��N�N�8�>�>�2��r�>��N�N�8�>�>�2��b�=�X��^��:�8M��N�N�2�8�8�W�5��r�>�g��m��J�8N��N�N�2�8�8�X�6��r�>�g��m��J�8N��N�N�2�8�8�X�6��%����r�x�x��4�#$�('+��#�)$�('+��#�s�DE	�	Ec#� K�	g}	|��y#t|d�r|j|j�|`|D]N}	tr!t	|t
�r|j
�ntj|��A#t$rY�LwxYw�xYw�wrz)
r	r�r$r�r-r`rdr�rEr)r6r\r]s   r.�_on_error_fd_closerzPopen._on_error_fd_closers�����Q���	��N��	��t�Z�(�����
�
�.��M����!�j��V�&<����
������������
�
�s<�B��B�0B�<A:�9B�:	B�B�B�B�Bc�F�	|�|�|�yd\}}d\}}d\}}	|j�5}
|�qtjtj�}|��
tjdd�\}}t|�}|
j
|�tj|�n�|tk(rCtjdd�\}}t|�t|�}}|
j||f�nv|tk(r$tj|j��}nIt|t�rtj|�}n#tj|j!��}|j#|�}|�qtjtj$�}|��
tjdd�\}}t|�}|
j
|�tj|�n�|tk(rCtjdd�\}}t|�t|�}}|
j||f�nv|tk(r$tj|j��}nIt|t�rtj|�}n#tj|j!��}|j#|�}|�qtjtj&�}	|	��tjdd�\}}	t|	�}	|
j
|	�tj|�n�|tk(rCtjdd�\}}	t|�t|	�}	}|
j||	f�n�|t(k(r|}	nv|tk(r$tj|j��}	nIt|t�rtj|�}	n#tj|j!��}	|j#|	�}	ddd�||||||	fS#1swY�xYw)N)r{r{r{r{r{r{�r{r{r)r�rk�GetStdHandler�
CreatePiper`r�rcrr�rr>�
get_osfhandler}r-rf�fileno�_make_inheritablerrr)r6r�rBr5rVrWrXrYrZr[�
err_close_fds�_s            r.r=zPopen._get_handles7s���
��}���F�N�/� &��G�X� &��G�X� &��G�X��)�)�+�}��=�%�2�2�7�3K�3K�L�G���%,�%7�%7��a�%@�
���"(��/��%�,�,�W�5��+�+�A�.��d�]�(/�(:�(:�4��(C�%�G�X�(.�w����9I�X�G�!�(�(�'�8�)<�=��g�%�$�2�2�4�3D�3D�3F�G�G���s�+�$�2�2�5�9�G�%�2�2�5�<�<�>�B�G��0�0��9���>�&�3�3�G�4M�4M�N�H��'�&-�&8�&8��q�&A���8�#)�(�#3��%�,�,�X�6��+�+�A�.��t�^�(/�(:�(:�4��(C�%�G�X�(.�w����9I�X�G�!�(�(�'�8�)<�=��w�&�%�3�3�D�4E�4E�4G�H�H����,�%�3�3�F�;�H� &�3�3�F�M�M�O�D�H��1�1�(�;���>�&�3�3�G�4L�4L�M�H��'�&-�&8�&8��q�&A���8�#)�(�#3��%�,�,�X�6��+�+�A�.��t�^�(/�(:�(:�4��(C�%�G�X�(.�w����9I�X�G�!�(�(�'�8�)<�=��v�%�'�H��w�&�%�3�3�D�4E�4E�4G�H�H����,�%�3�3�F�;�H� &�3�3�F�M�M�O�D�H��1�1�(�;��{,�~�X��X��X�'�
'�,�+�s�OP�P c��	tjtj�|tj�ddtj�}t	|�S)Nrr�)rk�DuplicateHandle�GetCurrentProcess�DUPLICATE_SAME_ACCESSr`)r6�handle�hs   r.r�zPopen._make_inheritable�sH��D��'�'��)�)�+�V��)�)�+�Q���-�-�/�A��!�9�r-c��	t|D�chc]2}|dzdk7s&tj|�tjk7r|��4c}�Scc}w)N�)r]rk�GetFileType�FILE_TYPE_CHAR)r6rZr�s   r.�_filter_handle_listzPopen._filter_handle_list�s\��
A��k�4�k�F�"�S�L�C�/�#�/�/��7�#�2�2�3� �k�4�5�
5��4s�7A	c��	t|t�rnit|t�r|
rtd��t	|g�}n?t|t
j�r|
rtd��t	|g�}nt	|�}|�tj|�}|�t�}n|j�}d|||fv}|r8|xjtjzc_
||_
||_||_|j }t#|xrd|vxr|d�}|s|r�|r�|�	ix}|_t%|j'dg��x}|d<|r#|t)|�t)|�t)|�gz
}|j+|�|dd|r|st-j.dt0�d}|
r�|xjtj2zc_
tj4|_|s�t
j8j'd�}|skt
j8j'dd	�}t
j:j=|d
d�}t
j:j?|�stAd��t
j:j?|�r|}n|}d
jC||�}|�tj|�}tEjFd||||�	tjH||ddt)|�|	|||�	\}}} }!|jK|||
|||�d|_&tO|�|_(| |_)tjT|�y#|jK|||
|||�wxYw)Nz$bytes args is not allowed on Windows�0path-like args is not allowed when shell is truer{rZz?startupinfo.lpAttributeList['handle_list'] overriding close_fdsF�ComSpec�
SystemRootr��System32zcmd.exez:shell not found: neither %ComSpec% nor %SystemRoot% is setz
{} /c "{}"�subprocess.PopenT)+r-r5�bytesr.r�r��PathLiker�r&r\rSrkrrTrUrVrXr1r]r�rfr�r�r�r/rrrW�environ�pathr��isabs�FileNotFoundErrorr�rv�audit�
CreateProcessr�rur`�_handler0rc)"r6r�rGrHrIrPrJrKrLrMr�rVrWrXrYrZr[�unused_restore_signals�
unused_gid�unused_gids�
unused_uid�unused_umask�unused_start_new_session�unused_process_group�use_std_handles�attribute_list�have_handle_listrZ�comspec�system_root�hp�htr0�tids"                                  r.rCzPopen._execute_child�s6��
7��$��$���D�%�(��#�$J�K�K�#�T�F�+���D�"�+�+�.��#�%4�5�5�#�T�F�+��#�D�)���%��[�[��4�
��"�)�m��*�.�.�0�� ��(�H�(E�E�O���#�#�w�'C�'C�C�#�(/��%�)1��&�(0��%�(�8�8�N�#�N�%B�$1�^�$C�%B�$2�=�$A� C��
 �O�	�!�)�CE�E�N�[�%@���+�+�M�2�>�?�@��n�]�;�#��C��L�#�h�-��X��#O�O�K�!%�!9�!9�+�!F��A���$� �
�
�'=�>L�N�!&�I���#�#�w�'C�'C�C�#�*1�/�/��'�!�!�j�j�n�n�Y�7�G�"�&(�j�j�n�n�\�2�&F��"$�'�'�,�,�{�J�	�"R��!�w�w�}�}�W�5�"3�4p�"q�q��w�w�}�}�W�-�%,�
�(�G�#�*�*�G�T�:�����k�k�#�&���I�I�(�*�d�C��E�
8�#*�#8�#8��T�)-�t�),��]�);�)6�),�),�)4�$6� ��B��S��$�$�W�h�%,�h�%,�h�8�
#'�D��!�"�:�D�L��D�H�����#���$�$�W�h�%,�h�%,�h�8�s�,M�Mc��	|j�-||jd�|k(r||j�|_|jS�Nr)r2r�)r6rs�_WaitForSingleObject�_WAIT_OBJECT_0�_GetExitCodeProcesss     r.ruzPopen._internal_polls@��
����&�'����a�8�N�J�&9�$�,�,�&G�D�O��?�?�"r-c�`�	|�tj}n|dkrd}nt|dz�}|j�mtj|j
|�}|tjk(rt|j|��tj|j
�|_|jS)Nri�)
rk�INFINITErfr2�WaitForSingleObjectr��WAIT_TIMEOUTrr��GetExitCodeProcess)r6rM�timeout_millisr�s    r.rozPopen._wait,s���?���!(�!1�!1���A��!"��!$�W�t�^�!4�����&� �4�4�T�\�\�5C�E���W�1�1�1�(����G�<�<�")�"<�"<�T�\�\�"J����?�?�"r-c�b�|j|j��|j�yr1)r�r�rE)r6�fh�buffers   r.�
_readerthreadzPopen._readerthread>s���M�M�"�'�'�)�$��H�H�Jr-c���|jrzt|d�sng|_tj|j
|j|jf��|_d|j_|jj�|jrzt|d�sng|_
tj|j
|j|jf��|_d|j_|jj�|jr|j|�|j�Z|jj|j|��|jj!�rt#|j$|��|j�Z|jj|j|��|jj!�rt#|j$|��d}d}|jr&|j}|jj'�|jr&|j}|jj'�|r|dnd}|r|dnd}||fS)N�_stdout_buff)�targetr�T�_stderr_buffr)rBr	r�r(�Threadr��
stdout_thread�daemon�startr5r��
stderr_threadr�r�r�r��is_aliverr�rE)r6r�r�r�rBr5s      r.r�zPopen._communicateCs���{�{�7�4��#@�$&��!�!�(�(��0B�0B�/3�{�{�D�<M�<M�.N�P��"�-1��"�"�)��"�"�(�(�*��{�{�7�4��#@�$&��!�!�(�(��0B�0B�/3�{�{�D�<M�<M�.N�P��"�-1��"�"�)��"�"�(�(�*��z�z��!�!�%�(�
�{�{�&��"�"�'�'��(<�(<�W�(E�F��%�%�.�.�0�(����L�A�A��{�{�&��"�"�'�'��(<�(<�W�(E�F��%�%�.�.�0�(����L�A�A��F��F��{�{��*�*�����!�!�#��{�{��*�*�����!�!�#�#)�V�A�Y�d�F�"(�V�A�Y�d�F��F�#�#r-c��	|j�y|tjk(r|j�y|tjk(r/tj|jtj�y|tjk(r/tj|jtj�ytdj|���)NzUnsupported signal: {})r2r;�SIGTERM�	terminate�CTRL_C_EVENTr�r�r0�CTRL_BREAK_EVENTr=r��r6�sigs  r.�send_signalzPopen.send_signalus���/����*���f�n�n�$���� ���+�+�+�������&�"5�"5�6���/�/�/�������&�"9�"9�:� �!9�!@�!@��!E�F�Fr-c���	|j�y	tj|jd�y#t$r=tj
|j�}|tjk(r�||_YywxYw)Nr�)r2rk�TerminateProcessr��PermissionErrorr��STILL_ACTIVE)r6�rcs  r.r�zPopen.terminate�sh��)����*��
%��(�(����q�9��"�
%��/�/����=����-�-�-��"$���

%�s� 1�AA7�6A7c�h�	d\}}d\}}d\}}	|j�5}
|�n�|tk(rytj�\}}|
j	||f�|j
dkDr}t
td�rmtj|tj|j
�n=|tk(r|j�}n#t|t�r|}n|j�}|�n�|tk(rytj�\}}|
j	||f�|j
dkDr}t
td�rmtj|tj|j
�n=|tk(r|j�}n#t|t�r|}n|j�}|�n�|tk(rytj�\}}	|
j	||	f�|j
dkDr�t
td�r�tj|	tj|j
�nm|tk(r'|dk7r|}	n\tj j�}	n=|tk(r|j�}	n#t|t�r|}	n|j�}	ddd�||||||	fS#1swY�xYw)Nr�r�F_SETPIPE_SZr{)r�rr��piper�rr	�fcntlr�rr}r-rfr�rrv�
__stdout__)r6r�rBr5rVrWrXrYrZr[r�s           r.r=zPopen._get_handles�s@��
�!'��G�X� &��G�X� &��G�X��)�)�+�}��=���d�]�(*���	�%�G�X�!�(�(�'�8�)<�=��}�}�q�(�W�U�N�-K����H�e�.@�.@�$�-�-�P��g�%�"�/�/�1�G���s�+�#�G�$�l�l�n�G��>���t�^�(*���	�%�G�X�!�(�(�'�8�)<�=��}�}�q�(�W�U�N�-K����H�e�.@�.@�$�-�-�P��w�&�#�0�0�2�H����,�%�H� &�}�}��H��>���t�^�(*���	�%�G�X�!�(�(�'�8�)<�=��}�}�q�(�W�U�N�-K����H�e�.@�.@�$�-�-�P��v�%��2�~�#+��#&�>�>�#8�#8�#:���w�&�#�0�0�2�H����,�%�H� &�}�}��H�c,�f�X��X��X�'�
'�g,�+�s�I7J(�(J1c��	|�tj}i}|r3g}dD]'}
tt|
d�}|��|j	|��)||d<g}|||	fD])}|dk7s�	|j	tj
|f��+|df|df|
dffD]-\}}|dk7s�|j	tj||f��/|r||d<tj|||fi|��|_d|_	|j|||||	|
�y)	N)�SIGPIPE�SIGXFZ�SIGXFSZ�	setsigdefr{rr�r��file_actionsT)r�r�r�r;r��POSIX_SPAWN_CLOSE�POSIX_SPAWN_DUP2rr0rur�)r6r�rGrKrNrVrWrXrYrZr[r��sigset�signame�signumrr]�fd2s                  r.�_posix_spawnzPopen._posix_spawn�s&��
:��{��j�j���F����?�G�$�V�W�d�;�F��)��
�
�f�-� @�'-��{�#��L���'�2����8� �'�'��)=�)=�r�(B�C�3��!���1�
��1�
����C�
��8� �'�'��)<�)<�b�#�(F�G�
��)5��~�&��~�~�j�$��F�v�F�D�H�"&�D��� � ��(�!(�(�!(�(�
4r-c�^	��	t|ttf�r|g}n6t|tj�r|
rtd��|g}nt
|�}|
r"ttd�rdnd}|dg|z}�r�|d<��|d�tjd�|||�trrtjj��rS|�Q|sO|sM|�K|dk(s|d	kDrA|dk(s|d	kDr7|dk(s|d	kDr-|s+|dk(r&|�$|�"|� |dkr|j|�|||||
|||�
y�}tj�\}}g}|d
kr,|j|�tj |�}|d
kr�,|D]}tj"|��		|�ig}|j%�D]S\}} tj&|�}d|vrt)d��|j|dztj&| �z��Und}tj&���tjj��r�f}!n't+�fd
�tj,|�D��}!t/|�}"|"j1|�t3||!|t+t5t7t8|"���|||||
|||||||||||||t:�|_d|_tj"|�|jA|||
|||�tC�}#	tjD|d�}$|#|$z
}#|$rtG|#�dkDrn�-	tj"|�|#�r	tjH|j<d�\}%}&|%|j<k(r|jK|&�ntjL|_'	|#jSdd	�\}'}(})|)jU�})tYtZ|'jUd�t\�}*t_|*t`�rS|(rQt9|(d�}+|)dk(rd})|},n|)dk(rd})d},n|},|+dk7rtjb|+�})|,�
|*|+|)|,��|*|+|)��|*|)��y#tj"|�wxYw#tj"|�wxYw#tP$rY��wxYw#t($r!d}'d}(djWt|#��})Y��wxYw)Nr��getandroidapilevelz/system/bin/shz/bin/shz-crr�r{r�r��=z!illegal environment variable namec3��K�|]7}tjjtj|������9y�wr1)r�r�r��fsencode)�.0�dirrGs  �r.�	<genexpr>z'Popen._execute_child.<locals>.<genexpr>Xs1�����0>�'<���G�G�L�L����S�)9�:�F�'<�s�=ATiP��:sSubprocessError�0z#Bad exception data from child: {!r}�ascii�znoexec:chdirr��noexec)2r-r5r�r�r�r.r]r	rvr��_USE_POSIX_SPAWNr��dirnamerr�r��duprEr�r
r=r
�
get_exec_path�set�add�
_fork_exec�sortedr�rf�
_USE_VFORKr0rur��	bytearrayr�r��waitpid�_handle_exitstatusrwr2�ChildProcessErrorrrhr�r��builtinsr�
issubclassr�strerror)-r6r�rGrHrIrPrJrKrLrMr�rVrWrXrYrZr[rNrQrRrUrrOr�
unix_shell�orig_executable�errpipe_read�
errpipe_write�low_fds_to_close�low_fd�env_list�kr��executable_list�fds_to_keep�errpipe_data�partr0r��exception_name�	hex_errno�err_msg�child_exception_type�	errno_num�err_filenames-  `                                          r.rCzPopen._execute_child�s����
2��$��e��-��v���D�"�+�+�.��#�%4�5�5��v���D�z���"�#�';�<�/�BK��"�D�)�D�0���(�D��G��!�!�!�W�
��I�I�(�*�d�C��E� ������
�3�"�*�%�$��� �B��'�A�+�!�R��8�a�<�!�R��8�a�<�-�%��+���������	��!�!�$�
�C��")�8�")�8�")�8�5��(�O�
+-�'�'�)�'�L�-�!���!�#� �'�'�
�6� "���}� 5�
� �!�#�+������ �+�7
'�&,���#%��$'�I�I�K�D�A�q� "���A��A�#�q�y�&0�1T�&U� U�$�O�O�A��H�r�{�{�1�~�,E�F�	%0�$(��!#���Z�!8�J��w�w���z�2�+5�-��+0�0>�')�'7�'7��'<�0>�+>��#&�h�-�K��O�O�M�2�)� �/�%�u�V�C��[�4I�-J�'K���#�X�w��#�X�(�-�+�->�)�3��c�5�&�
�	 4�D�H�+/�D�'��H�H�]�+��$�$�W�h�%,�h�%,�h�8� )�{����7�7�<��7�D� �D�(�L��3�|�#4�u�#<��	������&���!�z�z�$�(�(�A�6�H�C���d�h�h���/�/��4�*-�+�+���7�(�.�.�t�Q�7�7�N�I�w�
&�n�n�.�G�(/� �.�"7�"7��"@�'�()�$��2�G�<�� #�I�r� 2�I��.�0�"$��'*�� �H�,�"$��'+��'6�� �A�~�"$�+�+�i�"8��#�/�2�9�g�|�T�T�2�9�g�F�F�*�7�3�3�U��%�H�H�]�+�� ����&��)�����"�7�%7�N� $�I�C�J�J�"'��"5�7�G�7�sE�9D9P?�2A#Q�/AQ3�	&R�?Q�Q�Q0�3	Q?�>Q?�'R,�+R,c�N�	||�r||�|_y||�|_yr1)r2)r6r��_waitstatus_to_exitcode�_WIFSTOPPED�	_WSTOPSIGs     r.r!zPopen._handle_exitstatus�s+��
M��3��#,�S�>�/���"9�#�">��r-c�4�	|j��|jjd�sy	|j�&|j|jj�S||j|�\}}||jk(r|j|�|jj�|jS|jS#t$r*}|�||_n|j|k(rd|_Yd}~�`d}~wwxYw#|jj�wxYw)NFr)r2r*�acquire�releaser0r!rr&)r6rs�_waitpid�_WNOHANG�_ECHILDr0r��es        r.ruzPopen._internal_poll�s���
����&��)�)�1�1�%�8� �1����2�#����&�&�.�.�0� (����(�;�H�C���d�h�h���/�/��4��&�&�.�.�0��?�?�"�4�?�?�"���	,�!�-�*4������G�+�+,�����	,���&�&�.�.�0�s/�C�6C�	C8� C3�.C;�3C8�8C;�;Dc��		tj|j|�\}}||fS#t$r|j}d}Y||fSwxYwr�)r�r r0r")r6�
wait_flagsr0r�s    r.�	_try_waitzPopen._try_wait�sY��L�
��Z�Z����*�=�
��c���:���
%�
��h�h������:��

�s�#*�A�Ac��	|j�|jS|��6t�|z}d}	|jjd�r�	|j�'	|jj	�|jS|jtj�\}}||jk(r8|j|�	|jj	�|jS	|jj	�|j|�}|dkrt|j|��t|dz|d�}tj|���&|j�w|j5|j�	ddd�|jS|jd�\}}||jk(r|j|�ddd�|j��w|jS#|jj	�wxYw#1swY�AxYw)Ng����Mb@?Frr�g�������?)r2r�r*r=r>rEr��WNOHANGr0r!r�rr�r��time�sleep)r6rMr��delayr0r��	remainings       r.rozPopen._wait�s���=����*����&��"��'�G�+������)�)�1�1�%�8�	9�#���:� %�!�.�.�6�6�8�"�?�?�"�/*.����
�
�)C�J�S�#�"�d�h�h�� $� 7� 7�� <� %� �.�.�6�6�8�"�?�?�"�+ /�!�.�.�6�6�8� $� 4� 4�W� =�I� �A�~�,�T�Y�Y��@�@����	�9�c�:�E��J�J�u�%�!�$�o�o�-��+�+��?�?�6�!�9��?�?�"�
&*�^�^�A�%6�
��c��$�(�(�?� �3�3�C�8�,��o�o�-��?�?�"��#!�.�.�6�6�8��,�+�s%�	G"�<AG"�+H�
4H�"G>�H
c�
�|jrD|js8	|jj�|s	|jj	�d}d}|jsQi|_|jrg|j
|j<|jrg|j
|j<|jr|j
|j}|jr|j
|j}|j|�|jrt|j�}t�5}|jr,|r*|j|jtj�|jr@|jjs*|j|jtj �|jr@|jjs*|j|jtj �|j#��r�|j%|�}|�&|dkr!|j'||||d��t)d��|j+|�}	|j'||||�|	D�]o\}
}|
j,|jur�|j.|j.t0z}	|xj.t3j4|
j6|�z
c_|j.t9|j�k\s��|j;|
j,�|
j,j	���|
j,|j|jfvs��t3j<|
j6d�}
|
s5|j;|
j,�|
j,j	�|j
|
j,j?|
���r|j#�r���ddd�|jA|j%|���|�djC|�}|�djC|�}|jDrz|�;|jG||jjH|jjJ�}|�;|jG||jjH|jjJ�}||fS#t$rY���wxYw#t$rY���wxYw#t$r9|j;|
j,�|
j,j	�Y���wxYw#1swY��@xYw)NrT)r�zN_check_timeout(..., skip_check_and_raise=True) failed to raise TimeoutExpired.i�r�r-)&r�r,�flushr�rE�_fileobj2outputrBr5�_save_inputr+�
memoryview�_PopenSelector�register�	selectors�EVENT_WRITErb�
EVENT_READ�get_mapr�r��RuntimeError�select�fileobj�
_input_offset�	_PIPE_BUFr�rr]r��
unregisterr�r�r�r�r2rjr�r�)r6r�r�r�rBr5�
input_view�selectorrM�ready�key�events�chunkr�s              r.r�zPopen._communicates>���z�z�$�"=�"=���J�J�$�$�&����
�
�(�(�*��F��F��.�.�')��$��;�;�8:�D�(�(����5��;�;�8:�D�(�(����5��{�{��-�-�d�k�k�:���{�{��-�-�d�k�k�:�����U�#��{�{�'����4�
��!�X��:�:�%��%�%�d�j�j�)�2G�2G�H��;�;�t�{�{�'9�'9��%�%�d�k�k�9�3G�3G�H��;�;�t�{�{�'9�'9��%�%�d�k�k�9�3G�3G�H��&�&�(�"�2�2�7�;�G��*�w��{��+�+�G�\�,2�F�AE�,�G�+�>�?�?�%�O�O�G�4�E��'�'���v�v�N�
(-���V��;�;�$�*�*�4�$.�t�/A�/A�/3�/A�/A�I�/M�%O�E�8� $� 2� 2�b�h�h�s�v�v�u�6M� M� 2�
$(�#5�#5��T�[�[�9I�#I�$,�$7�$7����$D�$'�K�K�$5�$5�$7� �[�[�T�[�[�$�+�+�,F�F�#%�7�7�3�6�6�5�#9�D�#'� (� 3� 3�C�K�K� @� #��� 1� 1� 3� �0�0����=�D�D�T�J�%(-�!�&�&�(�"�X
�I�I�d�2�2�7�;�I�<��!����&�)���!����&�)���~�~��%�!�5�5�f�6:�k�k�6J�6J�6:�k�k�6H�6H�J�F��%�!�5�5�f�6:�k�k�6J�6J�6:�k�k�6H�6H�J�F��F�#�#��{'�����
+�����l$3�4� (� 3� 3�C�K�K� @� #��� 1� 1� 3�4��="�!�sa�S�S(�8FT=�:3S8�-"T=�AT=�+BT=�	S%�$S%�(	S5�4S5�8>T:�6T=�9T:�:T=�=Uc��|jru|j�hd|_||_|�W|jrJ|jj	|jj
|jj�|_yyyyyr�)r�r+rZr2�encoder�r�)r6r�s  r.rOzPopen._save_inputtsn���z�z�d�k�k�1�%&��"�#����$����"&�+�+�"4�"4�T�Z�Z�5H�5H�59�Z�Z�5F�5F�#H�D�K�*8�$�2�zr-c��	|j�|j�y	tj|j|�y#t
$rYywxYwr1)r�r2r�r�r0�ProcessLookupErrorr�s  r.r�zPopen.send_signal�sF��/�"
�I�I�K����*��

�������#�&��%�
��
�s� A�	A
�A
c�D�	|jtj�yr1)r�r;r�r>s r.r�zPopen.terminate����
����V�^�^�,r-c�D�	|jtj�yr1)r�r;�SIGKILLr>s r.r�z
Popen.kill�rhr-)r{NNNNNTFNNNNrTFr,rG)Fr1);r)r*r+rur7rjr�r�r�r�rIr�rJrjrlrrrvrwr�r�rlr}r�r�r�r�r�r�r�r��contextmanagerr�r�r=r�r�rCrkr��
WAIT_OBJECT_0r�ruror�r�r�r�r�rr9r:r;r!r?r@r&�ECHILDrErOr,r-r.rr�s���6�n�N�48�15�,0�EI�12�9>��
�'+�$�T��t�$�b�2�#��B�$�E�$6�$6�7��
����
���2��2�>���8 #�{�{�(�-�-�
!��
�2A �H%�%�-2�	I��.+�:������&�L	'�^	�
	5�}	$�~-1�%,�%@�%@�&�4�4�$+�$>�$>�	#�"	#�$	�
0	$�d	G�
	%���=	'�@%	4�Ng	4�V8O�+6�)2�
	?�-1�8�!�5�<�<� 	#�F
	�&	#�Rc	$�L		H�	�@	-�
	-r-r)[r#r&r@r�r�rHr;rvr(r�r�rr�r�r�r7�__all__r>r��ModuleNotFoundErrorr
r%rkrrrrrrrrrrrrr r!r"r#r$r%r��_posixsubprocessr'rr r?�waitstatus_to_exitcoder9�
WIFSTOPPEDr:�WSTOPSIGr;rGr@rXrS�	Exceptionrr
rr&rfr`r�r[r	rnrQ�SelectSelectorrtrprrrr�r�r�rrr�objectrrr�r	r
rrrrr,r-r.�<module>rwsQ�� �D��	�
�	��
�
����#����
D�����J����%;�;��
��O�O�O�O�O��N�N�	N�	O��<��:�:��"$�";�";���m�m���K�K�	��:�:���
���"&�����	�����'�i�&�"��"�J�_��8�:�:�.���,��
�C�0�I�
�y�.�)�"�/�/��"�1�1����G�
��G��
��	��
���:�z$�("��"
�&&*�2 �j!2�v�!2�J�5�$�e�CC�LC�R&*�$��@ $�D�
E�-�d$�%��
�
�{-�{-��e���E������J��s#�F=�G�=G�G�G�G

?>