Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.11/test/support/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.11/test/support/__pycache__/pty_helper.cpython-311.opt-1.pyc

�

SԚg���p�dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
d
d�ZGd�d	��ZdS)z.
Helper to run a script in a pseudo-terminal.
�N)�	ExitStack)�EIO)�
import_module�dummy input
c��td��}t��}|���\}}tjd|f}tj|||||���}tj|��t��5}	|	�
|��d�}
|	�|
|��|	�tj|��|	�
tj
����}|�|tjtjz��tj|d��	|���D]�\}}
|
tjzrh	tj|d��}n*#t($r}|jt,kr�d}Yd}~nd}~wwxYw|s|ccddd��S|�|��|
tjzrk	|tj||��d�}n*#t($r}|jt,kr�d}Yd}~nd}~wwxYw|s |�|tj������
#1swxYwYdS)	N�ptyz-c)�stdin�stdout�stderr�envc�R�	|���dS#t$rYdSwxYw�N)�	terminate�ProcessLookupError)�procs �4/usr/local/lib/python3.11/test/support/pty_helper.pyrzrun_pty.<locals>.terminates?��
���� � � � � ��%�
�
�
����
���s��
&�&FTi�)r�	bytearray�openpty�sys�
executable�
subprocess�Popen�os�closer�
enter_context�callback�	selectors�SelectSelector�register�
EVENT_READ�EVENT_WRITE�set_blocking�select�read�OSError�errnor�extend�write�modify)�script�inputrr�output�master�slave�argsr�cleanupr�sel�_�events�chunk�errs                r�run_ptyr7
s���
��
�
�C�
�[�[�F��k�k�m�m�O�V�U��N�D�&�)�D���D��e�E�s�S�S�S�D��H�U�O�O�O�	���(A�����d�#�#�#�	�	�	�	����D�)�)�)������6�*�*�*��#�#�I�$<�$>�$>�?�?�����V�Y�1�I�4I�I�J�J�J�
����&�&�&�	A�"�z�z�|�|�
A�
A���F��I�0�0�
)�$� "���� 8� 8����"�$�$�$��9��+�+�!� #�����������	$����
!�&�%�
�
�;(A�(A�(A�(A�(A�(A�(A�(A�<�M�M�%�(�(�(��I�1�1�	A�$� %�b�h�v�u�&=�&=�&>�&>� ?����"�$�$�$��9��+�+�!� #�����������	$����
!�A��
�
�6�9�+?�@�@�@��-	A�%(A�(A�(A�(A����(A�(A�(A�(A�(A�(Asm�?C I� E6�5I�6
F�F�I�F�I�2$I�G5�4I�5
H�?H�I�H�(I�I�Ic��eZdZdZd�Zd�ZdS)�	FakeInputa
    A fake input stream for pdb's interactive debugger.  Whenever a
    line is read, print it (to simulate the user typing it), and then
    return it.  The set of lines to return is specified in the
    constructor; they should not have trailing newlines.
    c��||_dSr)�lines)�selfr;s  r�__init__zFakeInput.__init__Js
����
�
�
rc�^�|j�d��}t|��|dzS)Nr�
)r;�pop�print)r<�lines  r�readlinezFakeInput.readlineMs*���z�~�~�a� � ��
�d�����d�{�rN)�__name__�
__module__�__qualname__�__doc__r=rC�rrr9r9Cs<���������������rr9)rN)
rGrrrr�
contextlibrr'r�test.support.import_helperrr7r9rHrr�<module>rKs�����
�	�	�	���������
�
�
�
� � � � � � �������4�4�4�4�4�4�/A�/A�/A�/A�l
�
�
�
�
�
�
�
�
�
r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists