Current File : //usr/lib/python3/dist-packages/twisted/internet/test/__pycache__/test_sigchld.cpython-312.pyc |
�
Ϫ�f
� � � d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z edk( rddl
mZmZ ddl
mZ nd Z G d
� de � Zy)zX
Tests for L{twisted.internet._sigchld}, an alternate, superior SIGCHLD
monitoring API.
� )�annotationsN)�platformType)�SynchronousTestCase�posix)�installHandler�isDefaultHandler)�setNonBlockingz,These tests can only run on POSIX platforms.c �H � e Zd ZdZd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Z dd�Z
y )�SetWakeupSIGCHLDTestszy
Tests for the L{signal.set_wakeup_fd} implementation of the
L{installHandler} and L{isDefaultHandler} APIs.
c �� � t j � \ }}| j t j |� | j t j |� t |� t |� ||fS )zk
Create a non-blocking pipe which will be closed after the currently
running test.
)�os�pipe�
addCleanup�closer ��self�read�writes �D/usr/lib/python3/dist-packages/twisted/internet/test/test_sigchld.pyr zSetWakeupSIGCHLDTests.pipe sQ � �
�g�g�i���e�������$�'�������%�(��t���u���U�{�� c �t � t j t j � | _ t d� | _ y)z�
Save the current SIGCHLD handler as reported by L{signal.signal} and
the current file descriptor registered with L{installHandler}.
���N)�signal� getsignal�SIGCHLD�signalModuleHandlerr �oldFD�r s r �setUpzSetWakeupSIGCHLDTests.setUp* s'