File: //lib/python3/dist-packages/twisted/test/__pycache__/stdio_test_loseconn.cpython-312.pyc
�
Ϫ�f/ � � � d Z ddlZddlmZmZ ddlmZ ddlmZm Z G d� dej � Zedk( r� e j ej d � j � ej eej d
d� � ddlmZ e� Z ej( e� ej* � ej, ej. � yy)
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 Zd ZdZd� Zd� Zy)�
LoseConnChildr c �8 � | j j � y )N)� transport�loseConnection)�selfs �B/usr/lib/python3/dist-packages/twisted/test/stdio_test_loseconn.py�connectionMadezLoseConnChild.connectionMade s � ����%�%�'� c �� � |j t � t
j � y# t $ r t j dd� d| _ Y �=w xY w# t
j � w xY 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 �connectionLostzLoseConnChild.connectionLost sV � � �
"����N�+�
�L�L�N�� !�
"�����L�M� !��
�
"��
�L�L�N�s! �- �&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���S�X�X�a�[�!�)�)�+��C���T�#�(�(�1�+�t�,�-�(�)�O���E���*�+��G�K�K�M��C�H�H�
"�
+�
+�,� r