o
    >h                     @   s\   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 e ZdZG dd	 d	Zd
S )zd
Cross-platform process-related functionality used by different
L{IReactorProcess} implementations.
    )Optional)Logger)getWarningMethod)Failure)qualzUSince Twisted 8.2, IProcessProtocol.processExited is required.  %s must implement it.c                   @   sV   e Zd ZU dZee ed< dZee ed< dZdZ	dd Z
dd Zd	d
 Zdd ZdS )BaseProcessNpidstatusr   c                 C   s
   || _ d S )N)proto)selfprotocol r   }/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/twisted/internet/_baseprocess.py__init__   s   
zBaseProcess.__init__c                 C   sz   t  }t| jd|}||u rt tt| jjf tdd d S t	d |t
| W d    d S 1 s6w   Y  d S )NprocessExitedr   )
stacklevelzwhile calling processExited:)objectgetattrr
   r   _missingProcessExitedr   	__class__DeprecationWarning_logfailuresHandledr   )r   reasondefaultr   r   r   r   _callProcessExited"   s   
"zBaseProcess._callProcessExitedc                 C   s6   || _ |  jd7  _d| _| | | |   dS )z;
        This is called when the child terminates.
           N)r	   lostProcessr   r   
_getReasonmaybeCallProcessEnded)r   r	   r   r   r   processEnded/   s
   zBaseProcess.processEndedc                 C   sd   | j dur0| | j}| j }d| _ td |t| W d   dS 1 s)w   Y  dS dS )zD
        Call processEnded on protocol after final cleanup.
        Nzwhile calling processEnded:)r
   r   r	   r   r   r    r   )r   r   r
   r   r   r   r   9   s   
"z!BaseProcess.maybeCallProcessEnded)__name__
__module____qualname__r   r   int__annotations__r	   r   r
   r   r   r    r   r   r   r   r   r      s   
 
r   N)__doc__typingr   twisted.loggerr   twisted.python.deprecater   twisted.python.failurer   twisted.python.reflectr   r   r   r   r   r   r   r   <module>   s   