File: //lib/python3/dist-packages/twisted/test/__pycache__/stdio_test_lastwrite.cpython-310.pyc
o
�b� � @ s� d Z ddlZddlmZ ddlmZ ddlmZ G dd� de�Zdd � Z e
d
krAeejd ��� ddl
mZ e eejd
� dS dS )z�
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTests.test_lastWriteReceived}
to test that L{os.write} can be reliably used after
L{twisted.internet.stdio.StandardIO} has finished.
� N)�Protocol)�
StandardIO)�namedAnyc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�LastWriteChildc C s || _ || _d S �N)�reactor�magicString)�selfr r � r
�C/usr/lib/python3/dist-packages/twisted/test/stdio_test_lastwrite.py�__init__ s
zLastWriteChild.__init__c C s | j �| j� | j �� d S r )� transport�writer �loseConnection)r r
r
r �connectionMade s zLastWriteChild.connectionMadec C s | j �� d S r )r �stop)r �reasonr
r
r �connectionLost s zLastWriteChild.connectionLostN)�__name__�
__module__�__qualname__r r r r
r
r
r r s r c C s$ t | |�d��}t|� | �� d S )N�ascii)r �encoder �run)r r �pr
r
r �main! s r �__main__� )r � )�__doc__�sys�twisted.internet.protocolr �twisted.internet.stdior �twisted.python.reflectr r r r �argv�install�twisted.internetr r
r
r
r �<module> s
�