uawdijnntqw1x1x1
IP : 3.15.10.104
Hostname : host45.registrar-servers.com
Kernel : Linux host45.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
..
/
lib64
/
td-agent-bit
/
..
/
python3.8
/
collections
/
..
/
__pycache__
/
pty.cpython-38.opt-1.pyc
/
/
U e5d��@s�dZddlmZddlZddlZddlZdddgZdZdZdZdZ d d�Z d d�Zdd �Zdd�Z dd�Zdd�Zdd�Zeefdd�Zeefdd�ZdS)zPseudo terminal utilities.�)�selectN�openpty�fork�spawn��c Cs>z t��WSttfk r"YnXt�\}}t|�}||fS)zdopenpty() -> (master_fd, slave_fd) Open a pty master/slave pair, using os.openpty() if possible.)�osr�AttributeError�OSError�_open_terminal� slave_open)� master_fd� slave_name�slave_fd�r�/usr/lib64/python3.8/pty.pyrs c CsLzt��\}}Wnttfk r(YnXt�|�}t�|�||fSt�S)z�master_open() -> (master_fd, slave_name) Open a pty master and return the fd, and the filename of the slave end. Deprecated, use openpty() instead.)rrr r �ttyname�closer)r rrrrr�master_open"s rc CsndD]\}dD]R}d||}zt�|tj�}Wntk rFYqYnX|d||fSqtd��dS)z1Open pty master and return (master_fd, tty_name).ZpqrstuvwxyzPQRSTZ0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devicesN)r�open�O_RDWRr )�x�yZpty_name�fdrrrr2s rcCsrt�|tj�}zddlm}m}Wntk r:|YSXz|||d�|||d�Wntk rlYnX|S)z�slave_open(tty_name) -> slave_fd Open the pty slave and acquire the controlling terminal, returning opened filedescriptor. Deprecated, use openpty() instead.r)�ioctl�I_PUSHZptemZldterm)rrrZfcntlrr�ImportErrorr )Ztty_name�resultrrrrrr>s rc Cs�zt��\}}Wnttfk r(Yn4X|tkrTzt��Wntk rRYnX||fSt�\}}t��}|tkr�t��t�|�t� |t �t� |t�t� |t�|tkr�t�|�t� t�t�tj�}t�|�n t�|�||fS)zdfork() -> (pid, master_fd) Fork and make the child a session leader with a controlling terminal.)r�forkptyr r �CHILD�setsidrrr�dup2�STDIN_FILENO� STDOUT_FILENO� STDERR_FILENOrrr)�pidrr rZtmp_fdrrrrPs0 cCs"|rt�||�}||d�}qdS)z#Write all the data to a descriptor.N)r�write)r�data�nrrr�_writenxsr)cCst�|d�S)zDefault read function.i)r�read)rrrr�_read~sr+cCsv|tg}t|gg�\}}}||krF||�}|s:|�|�nt�t|�t|kr|t�}|sf|�t�qt||�qdS)z�Parent copy loop. Copies pty master -> standard output (master_read) standard input -> pty master (stdin_read)N)r"r�removerr&r#r))r �master_read� stdin_readZfdsZrfdsZwfdsZxfdsr'rrr�_copy�sr/cCs�t|�td�kr|f}t�d|�t�\}}|tkrHtj|df|��zt�t �}t� t �d}Wntjk r~d}YnXzt|||�Wn(t k r�|r�t�t tj|�YnXt�|�t�|d�dS)zCreate a spawned process.�z pty.spawnrr)�type�sys�auditrrr�execlp�ttyZ tcgetattrr"Zsetraw�errorr/r Z tcsetattrZ TCSAFLUSHr�waitpid)�argvr-r.r%r �modeZrestorerrrr�s& )�__doc__rrr2r5�__all__r"r#r$rrrrrrr)r+r/rrrrr�<module>s$ (
/home/../lib64/td-agent-bit/../python3.8/collections/../__pycache__/pty.cpython-38.opt-1.pyc