Your IP : 18.116.86.134


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/pty.cpython-310.opt-2.pyc

o

6��f]�@s�	ddlmZddlZddlZddlZddlmZmZddlmZmZmZgd�Z	dZ
dZdZdZ
dd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zeefdd�Zeefdd�ZdS)�)�selectN)�close�waitpid)�setraw�	tcgetattr�	tcsetattr)�openpty�fork�spawn��c	Cs>	zt��WSttfyYnwt�\}}t|�}||fS�N)�osr�AttributeError�OSError�_open_terminal�
slave_open)�	master_fd�
slave_name�slave_fd�r�*/opt/alt/python310/lib64/python3.10/pty.pyrs
�
rc	CsJ	zt��\}}Wn
ttfyYt�Swt�|�}t�|�||fSr
)rrrr�ttynamerr)rrrrrr�master_open&s�

rc
Csf	dD]+}dD]&}d||}z	t�|tj�}Wn	ty!Yqw|d||fSqtd��)NZpqrstuvwxyzPQRSTZ0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devices)r�open�O_RDWRr)�x�yZpty_name�fdrrrr6s��rcCsp	t�|tj�}z
ddlm}m}Wnty|YSwz|||d�|||d�W|Sty7Y|Sw)Nr)�ioctl�I_PUSHZptemZldterm)rrrZfcntlrr �ImportErrorr)Ztty_name�resultrr rrrrBs���rc	Cs	zt��\}}WnttfyYnw|tkr/z	t��W||fSty.Y||fSw||fSt�\}}t��}|tkrwt��t�|�t�	|t
�t�	|t�t�	|t�|tkrdt�|�t�
t�t�tj�}t�|�||fSt�|�||fSr
)r�forkptyrr�CHILD�setsidrr	r�dup2�STDIN_FILENO�
STDOUT_FILENO�
STDERR_FILENOrrr)�pidrrrZtmp_fdrrrr	Ts<�
��




�r	cCs*	|rt�||�}||d�}|sdSdSr
)r�write)r�data�nrrr�_writen|s
�r.cCs	t�|d�S)Ni)r�read)rrrr�_read�sr0cCs�	|tg}|rIt|gg�\}}}||vr0z||�}Wnty%d}Ynw|s*dSt�t|�t|vrE|t�}|s@|�t�nt||�|sdSdS)N�)r'rrrr+r(�remover.)r�master_read�
stdin_readZfdsZrfdsZ_wfdsZ_xfdsr,rrr�_copy�s&�
�r5c
Cs�	t|�td�kr|f}t�d|�t�\}}|tkr&tj|dg|�R�ztt�}t	t�d}Wnt
jy>d}Ynwzt|||�W|rPt
tt
j|�n|r[t
tt
j|�wwt|�t|d�dS)N�z	pty.spawnrTFr)�type�sys�auditr	r$r�execlprr'r�tty�errorr5rZ	TCSAFLUSHrr)�argvr3r4r*r�modeZrestorerrrr
�s0
����r
)rrr8r;rrrrr�__all__r'r(r)r$rrrrr	r.r0r5r
rrrr�<module>s*(

?>