← Back
Editing: cmdexec.cpython-311.pyc
� ��a � � � d dl Z d dlZd dlZd dlmZmZ d� Z G d� dej j � � Zee_ de_ de_ dS # eef$ r Y dS w xY w)� N)�Popen�PIPEc �� � t j | ddt j t j �� � }|� � � \ }}t j d dk rp t j � � }n## t $ r t j j pd}Y nw xY wt ||j j p|� � }t ||j j p|� � }|� � � }|rt ||| ||� � �|S )a� return unicode output of executing 'cmd' in a separate process. raise cmdexec.Error exeception if the command failed. the exception will provide an 'err' attribute containing the error-output from the command. if the subprocess module does not provide a proper encoding/unicode strings sys.getdefaultencoding() will be used, if that does not exist, 'UTF-8'. T)�shell�universal_newlines�stdout�stderrr � zUTF-8)� subprocessr r �communicate�sys�version_info�getdefaultencoding�AttributeErrorr �encoding�unicoder �poll�ExecutionFailed)�cmd�process�out�err�default_encoding�statuss �5/usr/lib/python3/dist-packages/py/_process/cmdexec.py�cmdexecr s � � ��s�$�#��?�:�?�<� <� <�G� �"�"�$�$�H�C�� ����Q��� >�"�5�7�7����� >� >� >�"�z�2�=�g���� >�����c�7�>�2�F�6F�G�G���c�7�>�2�F�6F�G�G�� �\�\�^�^�F� � =��f�f�c�3��<�<�<��Js �A0 �0B�Bc � � e Zd Zd� Zd� ZdS )r c � � t � | � � || _ || _ || _ || _ || _ d S )N)� Exception�__init__r �systemstatusr r r )�selfr r! r r r s r r zExecutionFailed.__init__ s>