| Server IP : 217.160.0.135 / Your IP : 216.73.217.25 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/IPython/utils/__pycache__/ |
Upload File : |
�
�@�c�! � � � d Z ddlZddlZddlZddlZddlZddlmZm Z ddl
mZ G d� de� � Z
e
� � j Zd� ZdS ) z}Posix-specific implementation of process utilities.
This file is only meant to be imported by process.py, not by end-users.
� N� )� getoutput� arg_split)�DEFAULT_ENCODINGc �R � e Zd ZdZdZdZdZdZed� � � Z d
d�Z
d� Zd� Zd � Z
dS )�ProcessHandlerz7Execute subprocesses under the control of pexpect.
g�������?g�������?Nc �� � | j �bt j � dd� � }t j |� � | _ | j �"t
d� |� � � � �| j S )N�SHELL�shz"{}" shell not found)�_sh�os�environ�get�pexpect�which�OSError�format)�self�
shell_names �>/usr/lib/python3/dist-packages/IPython/utils/_process_posix.pyr zProcessHandler.sh3 s\ � ��8��������6�6�J��}�Z�0�0�D�H��x���4�;�;�J�G�G�H�H�H��x�� c � � | �t j n|| _ |�t j n|| _ |�t j n|| _ dS )z%Arguments are used for pexpect calls.N)r �read_timeout�terminate_timeout�sys�stdout�logfile)r r r r s r �__init__zProcessHandler.__init__= sU � �<H�!�="�^�8�8�'3�
�� #4�";� #1�"B�"B�"3�
�� &-�_�s�z�z�'����r c � � t j | j d|g�� � � dd� � S # t $ r t dt j d�� � Y dS w xY w� a" Run a command and return its stdout/stderr as a string.
Parameters
----------
cmd : str
A command to be executed in the system shell.
Returns
-------
output : str
A string containing the combination of stdout and stderr from the
subprocess, in whatever order the subprocess originally wrote to its
file descriptors (so the order of the information in this string is the
correct order as would be seen if running the command in a terminal).
�-c��argsz
�
z^C� )�file�endN�r �runr �replace�KeyboardInterrupt�printr �stderr�r �cmds r r zProcessHandler.getoutputF �m � � 1��;�t�w�d�C�[�9�9�9�A�A�&�$�O�O�O�� � 1� 1� 1��$�S�Z�R�0�0�0�0�0�0�0� 1���� �03 �&A�Ac � � t j | j d|g�� � � dd� � S # t $ r t dt j d�� � Y dS w xY wr r( r. s r �getoutput_pexpectz ProcessHandler.getoutput_pexpect[ r0 r1 c � � t }t j t j g}|� t j � � }d} t t d� � rt j | j d|g�� � }nt j | j d|g�� � }t j
j } |� || j
� � }t |j |d� � |d� � d� � � |� � ||k rnt# |j � � }�sn�# t$ $ r� |� t) d
� � � � t# |j � � }|� || j � � t |j |d� � |d� � d� � � t j
� � � n# t$ $ r Y nw xY w|� d�� � n# |� d�� � w xY wY nw xY w|� � � |j �|j �dS |j S |j dk r|j dz
S |j S )
z�Execute a command in a subshell.
Parameters
----------
cmd : str
A command to be executed in the system shell.
Returns
-------
int : child's exitstatus
r �spawnbr! r"