Your IP : 216.73.216.213
B
���]G � @ sx d dl Z d dlZd dlZd dlmZmZ dd� ZG dd� dejj�Zee_yde_ de_
W n eefk
rr Y nX dS ) � N)�Popen�PIPEc C s� t j| ddt jt jd�}|�� \}}tjd dk r�yt�� }W n tk
r^ tjj pXd}Y nX t
||jj pn|�}t
||jj p�|�}|�� }|r�t
||| ||��|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�errZdefault_encoding�status� r �D/opt/alt/python37/lib/python3.7/site-packages/py/_process/cmdexec.py�cmdexec s r c @ s e Zd Zdd� Zdd� ZdS )r c C s, t �| � || _|| _|| _|| _|| _d S )N)� Exception�__init__r �systemstatusr r r )�selfr r r r r r r r r s
zExecutionFailed.__init__c C s d| j | j| jf S )NzExecutionFailed: %d %s
%s)r r r )r r r r �__str__( s zExecutionFailed.__str__N)�__name__�
__module__�__qualname__r r r r r r r s r zpy.process.cmdexec�Error)
r r �pyr r r �errorr# r r! r r � TypeErrorr r r r �<module> s