Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/utils/__pycache__/_process_posix.cpython-39.pyc
Ðазад
a o�h�! � @ sl d Z ddlZddlZddlZddlZddlZddlmZm Z ddl mZ G dd� de�Z e � jZdd � 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 @ sN e Zd ZdZdZdZdZdZedd� �Z ddd�Z d d � Zdd� Zd d� Z dS )�ProcessHandlerz7Execute subprocesses under the control of pexpect. g�������?g�������?Nc C sB | j d u r<tj�dd�}t�|�| _ | j d u r<td�|���| j S )N�SHELL�shz"{}" shell not found)�_sh�os�environ�get�pexpect�which�OSError�format)�selfZ shell_name� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/utils/_process_posix.pyr 3 s zProcessHandler.shc C s@ |du rt jn|| _|du r"t jn|| _|du r6tjn|| _dS )z%Arguments are used for pexpect calls.N)r �read_timeout�terminate_timeout�sys�stdout�logfile)r r r r r r r �__init__= s � ���zProcessHandler.__init__c C sF zt j| jd|gd��dd�W S ty@ tdtjdd� Y n0 dS � 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 �cmdr r r r F s zProcessHandler.getoutputc C sF zt j| jd|gd��dd�W S ty@ tdtjdd� Y n0 dS r r"