shell bypass 403
o
`b�F � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
mZ ddlmZ ddlmZ ejdd� �Ze�eed�d �G d
d� dej��Ze�eed�d �G dd
� d
e��Ze�eed�d �G dd� de��Ze�eed�d �G dd� de��Ze�eed�d �e�eed�d�G dd� de���Ze�eed�d �G dd� de��ZG dd� de�Zedkr�e�� dS dS )a�
This test suite exercises some system calls subject to interruption with EINTR,
to check that it is actually handled transparently.
It is intended to be run by the main test suite within a child process, to
ensure there is no background thread running (so that signals are delivered to
the correct thread).
Signals are generated in-process using setitimer(ITIMER_REAL), which allows
sub-second periodicity (contrarily to signal()).
� N)�support)� os_helper)�
socket_helperc c sH � | � z| V W n | � � � W d � dS 1 sw Y dS )zGContext manager killing the subprocess if a Python exception is raised.N)�kill)�proc� r �9/usr/local/python-3.10/lib/python3.10/test/_test_eintr.py�
kill_on_error s �
�"�r � setitimerzrequires setitimer()c @ sH e Zd ZdZdZdZdZdd� Zdd� Ze dd � �Z
d
d� Zdd
� ZdS )�
EINTRBaseTestz Base class for EINTR tests. g�������?g�������?c C s | j d7 _ d S �N� )�signals)�self�signum�framer r r �
sighandler3 � zEINTRBaseTest.sighandlerc C sB d| _ t�tj| j�| _t�tj| j| j� t j
ddtjd� d S )Nr iX T)�exit�file)
r �signal�SIGALRMr �orig_handlerr
�ITIMER_REAL�signal_delay�
signal_period�faulthandlerZdump_traceback_later�sys�
__stderr__�r r r r �setUp6 s �
�zEINTRBaseTest.setUpc C s t �t jdd� d S �Nr )r r
r r r r r �
stop_alarmA s zEINTRBaseTest.stop_alarmc C s$ | � � t�tj| j� t�� d S �N)r"