← Back
Editing: stdio_test_loseconn.cpython-38.pyc
U ��W[ � @ s� d Z ddlmZmZ ddlZddlmZ ddlmZm Z ddl mZmZ G dd� de j �Zed kr�e�ejd ��� e�eejd d�� dd lmZ e� Z e�e � e�� e�e j� dS )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. � )�absolute_import�divisionN)�ConnectionDone)�stdio�protocol)�reflect�logc @ s e Zd ZdZdd� Zdd� ZdS )� LoseConnChildr c C s | j �� d S )N)Z transportZloseConnection)�self� r �B/usr/lib/python3/dist-packages/twisted/test/stdio_test_loseconn.py�connectionMade s zLoseConnChild.connectionMadec C sB z2z|�t� W n t�dd� d| _Y nX W 5 t �� X dS )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� )�reactor�stopZtrapr r �err�exitCode)r �reasonr r r �connectionLost s zLoseConnChild.connectionLostN)�__name__� __module__�__qualname__r r r r r r r r s r �__main__r � �wb)r )�__doc__Z __future__r r �sysZtwisted.internet.errorr Ztwisted.internetr r Ztwisted.pythonr r ZProtocolr r ZnamedAny�argv�installZstartLogging�openr Z StandardIO�run�exitr r r r r �<module> s
Save File
Cancel