https://t.me/RX1948
Server : LiteSpeed
System : Linux host 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User : idnco5810 ( 1093)
PHP Version : 8.2.29
Disable Function : NONE
Directory :  /usr/lib/python3/dist-packages/twisted/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib/python3/dist-packages/twisted/test/__pycache__/stdio_test_halfclose.cpython-310.pyc
o

�b��@s�dZddlZddlmZddlmZmZddlmZddl	m
Z
mZee�Gdd�dej��Z
ed	krbe�ejd
���e
�eejdd��dd
lmZe
�Ze�e�e��e�ej�dSdS)z�
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_readConnectionLost}
to test that IHalfCloseableProtocol.readConnectionLost works for process
transports.
�N)�implementer)�protocol�stdio)�IHalfCloseableProtocol)�log�reflectc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�HalfCloseProtocolz�
    A protocol to hook up to stdio and observe its transport being
    half-closed.  If all goes as expected, C{exitCode} will be set to C{0};
    otherwise it will be set to C{1} to indicate failure.
    NcCs|j�d�dS)z=
        Signal the parent process that we're ready.
        �xN)�	transport�write��self�r�C/usr/lib/python3/dist-packages/twisted/test/stdio_test_halfclose.py�connectionMade sz HalfCloseProtocol.connectionMadecCsd|_t��dS)zv
        This is the desired event.  Once it has happened, stop the reactor so
        the process will exit.
        rN)�exitCode�reactor�stoprrrr�readConnectionLost&sz$HalfCloseProtocol.readConnectionLostcCs(|jdurd|_t�|d�t��dS)z�
        This may only be invoked after C{readConnectionLost}.  If it happens
        otherwise, mark it as an error and shut down.
        N�z!Unexpected call to connectionLost)rr�errrr)r
�reasonrrr�connectionLost.s
z HalfCloseProtocol.connectionLostcCsdS)Nrrrrr�writeConnectionLost8sz%HalfCloseProtocol.writeConnectionLost)	�__name__�
__module__�__qualname__�__doc__rrrrrrrrrrs
r�__main__r��wb)r)r�sys�zope.interfacer�twisted.internetrr�twisted.internet.interfacesr�twisted.pythonrr�Protocolrr�namedAny�argv�install�startLogging�openr�halfCloseProtocol�
StandardIO�run�exitrrrrr�<module>s"&
�

https://t.me/RX1948 - 2025