HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/internet/__pycache__/_baseprocess.cpython-310.pyc
o

�b��@sVdZddlmZddlmZddlmZddlmZddl	m
Z
dZGdd	�d	�Zd
S)zd
Cross-platform process-related functionality used by different
L{IReactorProcess} implementations.
�)�Optional)�getWarningMethod)�Failure)�err)�qualzUSince Twisted 8.2, IProcessProtocol.processExited is required.  %s must implement it.c@sVeZdZUdZeeed<dZeeed<dZdZ	dd�Z
dd�Zd	d
�Zdd�Z
dS)
�BaseProcessN�pid�statusrcCs
||_dS)N)�proto)�self�protocol�r
�?/usr/lib/python3/dist-packages/twisted/internet/_baseprocess.py�__init__s
zBaseProcess.__init__cCspt�}t|jd|�}||urt�tt|jj�ftdd�dSz	|t|��WdSt	y7t
dd�YdSw)N�
processExitedr)�
stacklevelz!unexpected error in processExited)�object�getattrr
r�_missingProcessExitedr�	__class__�DeprecationWarningr�
BaseExceptionr)r�reason�defaultrr
r
r�_callProcessExited s
��zBaseProcess._callProcessExitedcCs6||_|jd7_d|_|�|�|��|��dS)z;
        This is called when the child terminates.
        �N)r	�lostProcessrr�
_getReason�maybeCallProcessEnded)rr	r
r
r�processEnded/s
zBaseProcess.processEndedcCsZ|jdur+|�|j�}|j}d|_z
|�t|��WdSty*tdd�YdSwdS)zD
        Call processEnded on protocol after final cleanup.
        Nz unexpected error in processEnded)r
rr	rrrr)rrr
r
r
rr9s
��z!BaseProcess.maybeCallProcessEnded)�__name__�
__module__�__qualname__rr�int�__annotations__r	rr
rrrrr
r
r
rrs

rN)
�__doc__�typingr�twisted.python.deprecater�twisted.python.failurer�twisted.python.logr�twisted.python.reflectrrrr
r
r
r�<module>s�