
    Dg                         d dl Z d dlZd dlZd dlmZmZ d Z G d dej        j                  Zee_        	 de_	        de_
        dS # eef$ r Y dS w xY w)    N)PopenPIPEc                    t          j        | ddt           j        t           j                  }|                                \  }}t          j        d         dk     rp	 t	          j                    }n## t          $ r t          j        j	        pd}Y nw xY wt          ||j        j	        p|          }t          ||j        j	        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      zUTF-8)
subprocessr   r   communicatesysversion_infogetdefaultencodingAttributeErrorr   encodingunicoder	   pollExecutionFailed)cmdprocessouterrdefault_encodingstatuss         H/var/www/sysmax/venv/lib/python3.11/site-packages/py/_process/cmdexec.pycmdexecr      s    s$#?:?< < <G ""$$HC
Q	>"577 	> 	> 	>"z2=g	>c7>2F6FGGc7>2F6FGG\\^^F =ffc3<<<Js   A0 0BBc                       e Zd Zd Zd ZdS )r   c                     t                               |            || _        || _        || _        || _        || _        d S )N)	Exception__init__r   systemstatusr   r   r   )selfr   r!   r   r   r   s         r   r    zExecutionFailed.__init__    s>    4   (    c                 0    d| j         | j        | j        fz  S )NzExecutionFailed: %d  %s
%s)r   r   r   )r"   s    r   __str__zExecutionFailed.__str__(   s    ,t{DHdh.OOOr#   N)__name__
__module____qualname__r    r%    r#   r   r   r      s7          P P P P Pr#   r   zpy.process.cmdexecError)r   r   pyr   r   r   errorr*   r   r'   r&   r   	TypeErrorr)   r#   r   <module>r.      s    



     				 " " " " " " " "  2
P 
P 
P 
P 
Pbhn 
P 
P 
P  	!5O&O	" 	 	 	DD	s   A AA