Sindbad~EG File Manager
�
(Μg���h�dZddlZddlZddlZddlZddlmZddlmZddl m
Z
d d�ZGd�d�Zy)
z.
Helper to run a script in a pseudo-terminal.
�N)� ExitStack)�EIO)�
import_modulec�~�td�}t�}|j�\}}tjd|f}tj|||||��}tj|�t�5} | j|�d�}
| j|
|�| jtj|�| jtj��}|j|tjtj z�tj"|d� |j%�D]�\}}
|
tjzr7 tj&|d�}|s
|ccddd�S|j/|�|
tj zs�d |tj0||�d}|r��|j3|tj�����#t($r }|j*t,k7r�d}Yd}~��d}~wwxYw#t($r }|j*t,k7r�d}Yd}~�vd}~wwxYw#1swYyxYw)N�ptyz-c)�stdin�stdout�stderr�envc�D� |j�y#t$rYywxYw�N)� terminate�ProcessLookupError)�procs �4/usr/local/lib/python3.12/test/support/pty_helper.pyrzrun_pty.<locals>.terminates#��
���� ��%�
��
�s�� �Fi�)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�inputrr�output�master�slave�argsr�cleanupr�sel�_�events�chunk�errs r�run_ptyr6
s���
��
�C�
�[�F��k�k�m�O�V�U��N�N�D�&�)�D����D��e�E�s�S�D��H�H�U�O� ������d�#� � ����D�)�������6�*��#�#�I�$<�$<�$>�?�����V�Y�1�1�I�4I�4I�I�J�
�����&��"�z�z�|���F��I�0�0�0�$� "����� 8��!�%�
�;
��<�M�M�%�(��I�1�1�1�$� %�b�h�h�v�u�&=�&>� ?��!��
�
�6�9�+?�+?�@�+ ,���
#�$��9�9��+�!� #��� $��#�$��9�9��+�!� #��� $��E
��sm�5CH3�G�'H3�6$H3�H�5H3�8#H3� H�$G?�:H3�?H�H3� H0�H+�&H3�+H0�0H3�3H<c��eZdZdZd�Zd�Zy)� 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��||_yr
)�lines)�selfr:s r�__init__zFakeInput.__init__Js ����
rc�X�|jjd�}t|�|dzS)Nr�
)r:�pop�print)r;�lines r�readlinezFakeInput.readlineMs%���z�z�~�~�a� ��
�d���d�{�rN)�__name__�
__module__�__qualname__�__doc__r<rB�rrr8r8Cs����rr8)sdummy input
N)
rFrrrr�
contextlibrr&r�test.support.import_helperrr6r8rGrr�<module>rJs2���
���
� ��4�/A�l
�
r
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists