
    Vh/                        d Z ddlZddlmZmZ ddlmZ ddlmZm	Z	  G d dej                        Zedk(  r e	j                  ej                  d	         j                           ej                    eej                  d
   d             ddlmZ  e       Z ej(                  e        ej*                           ej,                  ej.                         yy)z
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_loseConnection} to
test that ITransport.loseConnection() works for process transports.
    N)protocolstdio)ConnectionDone)logreflectc                       e Zd ZdZd Zd Zy)LoseConnChildr   c                 8    | j                   j                          y )N)	transportloseConnection)selfs    P/home/dcms/DCMS/lib/python3.12/site-packages/twisted/test/stdio_test_loseconn.pyconnectionMadezLoseConnChild.connectionMade   s    %%'    c                     	 	 |j                  t               t        j                          y# t        $ r  t        j                  dd       d| _        Y =w xY w# t        j                          w xY w)a  
        Check that C{reason} is a L{Failure} wrapping a L{ConnectionDone}
        instance and stop the reactor.  If C{reason} is wrong for some reason,
        log something about that in C{self.errorLogFile} and make sure the
        process exits with a non-zero status.
        Nz,Problem with reason passed to connectionLost   )trapr   BaseExceptionr   errexitCodereactorstop)r   reasons     r   connectionLostzLoseConnChild.connectionLost   sV    	"N+
 LLN	 ! "LM !" LLNs!   - &AA AA A/N)__name__
__module____qualname__r   r   r    r   r   r	   r	      s    H(r   r	   __main__r      wb)r   )__doc__systwisted.internetr   r   twisted.internet.errorr   twisted.pythonr   r   Protocolr	   r   namedAnyargvinstallstartLoggingopenr   protocolLoseConnChild
StandardIOrunexitr   r   r   r   <module>r1      s   
  , 1 'H%% . zGSXXa[!))+CT#((1+t,-()OE*+GKKMCHH"++, r   