Your IP : 52.15.92.58


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

�

�Q�f����	ddlmZddlZddlZddlZddlmZmZddlmZmZmZgd�Z	dZ
dZdZdZ
d�Zd	�Zd
�Zd�Zd�Zd
�Zeefd�Zeefd�Zy)�)�selectN)�close�waitpid)�setraw�	tcgetattr�	tcsetattr)�openpty�fork�spawn��c��		tj�S#ttf$rYnwxYwt	�\}}t|�}||fS�N)�osr	�AttributeError�OSError�_open_terminal�
slave_open)�	master_fd�
slave_name�slave_fds   �*/opt/alt/python312/lib64/python3.12/pty.pyr	r	sR��E�
��z�z�|����G�$�
��
��*�,��I�z��*�%�H��h��s��)�)c��	ddl}|jdtd��	tj�\}}tj
|�}tj|�||fS#ttf$rYt�SwxYw)Nr�Use pty.openpty() instead.r
��
stacklevel)
�warnings�warn�DeprecationWarningrr	�ttynamerrrr)rrrrs    r�master_openr!&s���*���M�M�.�0B�q�M�Q�%� �j�j�l��	�8��Z�Z��)�
�
������*�$�$��
�G�$�
�����
�s�A$�$A?�>A?c���	dD]C}dD]<}d|z|z}	tj|tj�}|d|z|zfccS�Etd��#t$rY�WwxYw)N�pqrstuvwxyzPQRST�0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devices)r�open�O_RDWRr)�x�y�pty_name�fds    rrr9sx��;�
��#�A�!�A�~��)�H�
��W�W�X�r�y�y�1���
�Q���*�+�+�
$� ��&�
'�'���
��
�s�$A�	A!� A!c��	ddl}|jdtd��tj|tj
�}	ddlm}m}	|||d�|||d�|S#t$r|cYSwxYw#t$rY|SwxYw)Nrrr
r)�ioctl�I_PUSH�ptem�ldterm)rrrrr%r&�fcntlr,r-�ImportErrorr)�tty_namer�resultr,r-s     rrrEs���*�
��M�M�.�0B�q�M�Q�
�W�W�X�r�y�y�
)�F��'�
�
�f�f�f�%�
�f�f�h�'��M�����
���
�
���M�
�s$�A"�A3�"A0�/A0�3	B�?Bc��		tj�\}}|tk(r	tj�||fS||fS#t$rY||fSwxYw#t
tf$rYnwxYwt
�\}}tj�}|tk(r.tj|�tj|�||fStj|�||fSr)
r�forkpty�CHILD�setsidrrr	r
r�	login_tty)�pidr*rrs    rr
r
Zs���M���*�*�,���R��%�<�
��	�	���B�w��s�B�w����
���B�w��
��

�G�$�
��
��"�)��I�x�
�'�'�)�C�
�e�|�
�����
���X��
�	�>��	������	�>�s"�A�A�	A�A�A$�#A$c�0�	tj|d�S)Ni)r�read)r*s r�_readr<vs�� �
�7�7�2�t���c��	tj|�r<tj|d�	t|||��tj|d�yd}|tk7}|t
k7}d}d}	g}g}	|r#t
|�|kr|jt�|rt
|�|kr|j|�|r#t
|�dkDr|	jt
�t
|�dkDr|	j|�t||	g�\}}	}
t
|	vr 	tjt
|�}||d}||vr	||�}|sy||z
}||	vrtj||�}||d}|rt|vr|t�}|sd}n||z
}��#tj|d�wxYw#t$rd}Y�~wxYw#t$rd}Y��wxYw)NF)�master_read�
stdin_readTir=r)r�get_blocking�set_blocking�_copy�STDIN_FILENO�
STDOUT_FILENO�len�appendr�writer)
rr?r@�high_waterlevel�stdin_avail�stdout_avail�i_buf�o_buf�rfds�wfds�_xfds�n�datas
             rrCrCzs���<�
���y�!�	���	�5�)�	-��)���L�
�O�O�I�t�,���O��|�+�K��
�-�L��E��E�
������3�u�:��7��K�K��%��C��J��8��K�K�	�"��C��J��N��K�K�
�&��u�:��>��K�K�	�"�"�4��r�2���d�E��D� �
%��H�H�]�E�2���a�b�	�����
�"�9�-�����T�M�E��������E�*�A��!�"�I�E��<�4�/��l�+�D��#����
��U��
�O�O�I�t�,��2�
%�$��
%���
���
�s/�F	�F$�8F5�	F!�$F2�1F2�5G�Gc��	t|t�r|f}tjd|�t	�\}}|t
k(rt
j|dg|���	tt�}tt�d}	t|||�|r tttj�	t!|�t#|d�dS#tj$rd}Y�awxYw#|r tttj�wwxYw)Nz	pty.spawnrTFr)�
isinstance�str�sys�auditr
r6r�execlprrDr�tty�errorrCr�	TCSAFLUSHrr)�argvr?r@r9r�mode�restores       rrr�s���#��$����w���I�I�k�4� ��V�N�C��
�e�|�
�	�	�$�q�'�!�D�!����&���|����9�
�i��j�1���l�C�M�M�4�8�	�)���3��?�1�����9�9��������l�C�M�M�4�8��s� C�<
C �C�C� $D)rrrVrYrrrrr�__all__rDrE�
STDERR_FILENOr6r	r!rrr
r<rCr�r=r�<module>rbsq�� ��	�
�
��,�,�
&�����
��
�	��
��&
(��*�8�"'�5�?�B"�e�r=

?>