Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.144.248.248
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_signal.pyc
�
?��cc@shddlZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZejdkr�ejdej��ndefd��YZd	�Zd
�Zejejdkd�d
ejfd��Y�Zejejdkd�dejfd��Y�Zejejdkd�dejfd��Y�Zdejfd��YZejejdkd�dejfd��Y�Zejejdkd�dejfd��Y�Zejejdkd�dejfd��Y�Zd�Ze dkrde�ndS(i����N(ttest_support(tclosingtos2triscossCan't test signal on %stHandlerBCalledcBseZRS((t__name__t
__module__(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyRscCstjd�dS(s�Use os._exit(0) to exit the current subprocess.

    Otherwise, the test catches the SystemExit and continues executing
    in parallel with the original test, so you wind up with an
    exponential number of tests running concurrently.
    iN(tost_exit(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pytexit_subprocessscOsDy|||�SWn,tk
r?}|jtjkr;�ndSXdS(N(tEnvironmentErrorterrnotEINTRtNone(t__functargstkwargste((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pytignoring_eintrstwin32sNot valid on WindowstInterProcessSignalTestscBsteZdZd�Zd�Zdd�Zd�Zd�Zd�Z	d�Z
eje
jdkd	�d
��ZRS(icCstj�|_tj�dS(N(tgct	isenabledtusing_gctdisable(tself((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pytsetUp+scCs|jrtj�ndS(N(RRtenable(R((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttearDown/s	cCsdjtj|d|��S(Nttlimit(tjoint	tracebacktformat_stack(RtframeR((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pytformat_frame3scCs7t|_tjr3d||j|dd�fGHndS(Ns&handlerA invoked from signal %s at:
%sRi(tTrueta_calledRtverboseR#(RtsignumR"((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pythandlerA6s		cCsOt|_tjr3d||j|dd�fGHnt||j|���dS(Ns&handlerB invoked from signal %s at:
%sRi(R$tb_calledRR&R#R(RR'R"((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pythandlerB<s
		cCsQxJtrLy|j�dSWqtk
rH}|jtjkrI�qIqXqWdS(s)Wait for child to finish, ignoring EINTR.N(R$twaittOSErrorRR(RtchildR((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR+Cs	
cCs\tjtj|j�tjtj|j�tjtjtj�tjtjtj�t	|_
t	|_tj
�}tjr�dG|GHnttjddt|�g�}|r�|j|�|j
s�tjd�q�n|j|j
�|j|j�t	|_
~yItjddt|�g�}|j|�tjd�|jd�WnBtk
r�|j|j�|j|j
�tjr�dGHq�nXttjddt|�g�}|r�|j|�nz{y(tjd�tj�tjd�Wn?tk
rtjrFd	GHqFn+|jd
tj��nX|jd�Wdtjd�XdS(
Nstest runner's pid istkills-HUPis-USR1s#HandlerBCalled exception not raisedsHandlerBCalled exception caughts-USR2s(KeyboardInterrupt (the alarm() went off)s+Some other exception woke us from pause: %ssTpause returned of its own accord, and the signal didn't arrive after another second.i( tsignaltSIGHUPR(tSIGUSR1R*tSIGUSR2tSIG_IGNtSIGALRMtdefault_int_handlertFalseR%R)RtgetpidRR&Rt
subprocesstPopentstrR+ttimetsleept
assertTruetassertFalsetfailRtalarmtpausetKeyboardInterruptR t
format_exc(RtpidR-((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pytrun_testMsX			!
		


	!


		tfreebsd6sOinter process signals not reliable (do not mix well with threading) on freebsd6c
Cs�tj�\}}ttj|���f}ttj|d���E}tj�}|dkr�z|y_|j�t|��Cy|j�Wntjt	j
�|�nXtjd|�WdQXWndGHt	j�nXWdt
�Xn|j�tj|ggg|j�\}}}||krLtj|�}	|	rs|j|	�qsn'tj|tj�|jd|j�tj|d�WdQXWdQXdS(NtwisUh oh, raised from pickle.s!Test deadlocked after %d seconds.(RtpipeRtfdopentforktcloseREtpickletdumpR RCR
t	print_excR	tselecttMAX_DURATIONtloadR?R.R/tSIGKILLtwaitpid(
Rt	os_done_rt	os_done_wtdone_rtdone_wR-trRGtxttb((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyt	test_main�s8	


'	N(RRRPRRR
R#R(R*R+REtunittesttskipIftsystplatformR[(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR's					
	DtBasicSignalTestscBs,eZd�Zd�Zd�Zd�ZRS(cGsdS(N((RR((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttrivial_signal_handler�scCs6|jttjd�|jttjd|j�dS(Ni�(tassertRaisest
ValueErrorR/t	getsignalRa(R((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyt,test_out_of_range_signal_number_raises_error�scCs |jttjtjd�dS(N(Rbt	TypeErrorR/R1R
(R((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyt0test_setting_signal_handler_to_none_raises_error�scCsjtjtj|j�}|jtjtj�|j�tjtj|�|jtjtj�|�dS(N(R/R0RatassertEqualRd(Rthup((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_getsignal�s

(RRRaReRgRj(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR`�s			sWindows specifictWindowsSignalTestscBseZd�ZRS(cCs�d�}xTtjtjtjtjtjtjtjfD]"}tj|tj||��q:W|jt	��tjd|�WdQX|jt	��tjd|�WdQXdS(NcSsdS(N(R
(RYty((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyt<lambda>�Ri����i(
R/tSIGABRTtSIGBREAKtSIGFPEtSIGILLtSIGINTtSIGSEGVtSIGTERMRbRc(Rthandlertsig((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_issue9324�s	 (RRRw(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyRk�st
WakeupFDTestscBseZd�ZRS(cCs&tj�}|jttj|�dS(N(Rtmake_bad_fdRbRcR/t
set_wakeup_fd(Rtfd((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_invalid_fd�s(RRR|(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyRx�stWakeupSignalTestscBs8eZdZdZd�Zd�Zd�Zd�ZRS(i
icCs�ddl}tjd�z,tj�}tj|j�tj�}Wdtjd�X|j|||jk�|j|jggg|j�tj�}|j|||jk�dS(Ni����ii(	ROR/R@R;R<tTIMEOUT_FULLR=tTIMEOUT_HALFtread(RROtbefore_timetmid_timet
after_time((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_wakeup_fd_early�s
cCs�ddl}tjd�zGtj�}|j|j|j|jggg|j�tj�}Wdtjd�X|j|||j	k�dS(Ni����ii(
ROR/R@R;RbterrorR�R~R=R(RROR�R�((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_wakeup_fd_during	s
cCs�ddl}tjtjd��|_tj�\|_|_|j|j|jd�}|tj	B}|j|j|j
|�tj|j�|_dS(Ni����cSsdS(N(R
(RYRl((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyRmRi(
tfcntlR/R4talrmRRHR�twritetF_GETFLt
O_NONBLOCKtF_SETFLRzt
old_wakeup(RR�tflags((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyRs
cCsJtj|j�tj|j�tj|j�tjtj|j�dS(N(	R/RzR�RRKR�R�R4R�(R((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR"s(RRR~RR�R�RR(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR}�s			
tSiginterruptTestcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCsAtj|_tj|jd��}|jtj|j|�dS(s�Install a no-op signal handler that can be set to allow
        interrupts or not, and arrange for the original signal handler to be
        re-installed when the test is finished.
        cSsdS(N(R
(RYRl((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyRm1RN(R/R1R't
addCleanup(Rt
oldhandler((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR+scCs�tj�\}}|jtj|�tj�}tj�}|dkr�z1tjd�tj||j	�tjd�Wdt
�Xnl|jtj|d�tj|�ytj|d�}t
SWn,tk
r�}|jtjkr��ntSXdS(s�Perform a read during which a signal will arrive.  Return True if the
        read is interrupted by the signal and raises an exception.  Return False
        if it returns normally.
        ig�������?Ni(RRHR�RKR7RJR;R<R.R'R	RSR�R6R,RRR$(RRXRGtppidRDtdterr((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pytreadpipe_interrupted4s&

cCs6|j�}|j|�|j�}|j|�dS(s�If a signal handler is installed and siginterrupt is not called
        at all, when that signal arrives, it interrupts a syscall that's in
        progress.
        N(R�R=(Rti((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_without_siginterruptjs
cCsItj|jd�|j�}|j|�|j�}|j|�dS(s�If a signal handler is installed and siginterrupt is called with
        a true value for the second argument, when that signal arrives, it
        interrupts a syscall that's in progress.
        iN(R/tsiginterruptR'R�R=(RR�((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_siginterrupt_onus

cCsItj|jd�|j�}|j|�|j�}|j|�dS(s�If a signal handler is installed and siginterrupt is called with
        a false value for the second argument, when that signal arrives, it
        does not interrupt a syscall that's in progress.
        iN(R/R�R'R�R>(RR�((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_siginterrupt_off�s

(RRRR�R�R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR�(s
			6		t
ItimerTestcBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Ze	j
ejdkd	�d
��Z
e	j
ejdkd�d��Zd
�ZRS(cCs:t|_d|_d|_tjtj|j�|_dS(Ni(	R6thndl_calledt
hndl_countR
titimerR/R4tsig_alrmt	old_alarm(R((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR�s			cCs?tjtj|j�|jdk	r;tj|jd�ndS(Ni(R/R4R�R�R
t	setitimer(R((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR�scGs$t|_tjr d|fGHndS(NsSIGALRM handler invoked(R$R�RR&(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR��s		cGs�t|_|jdkr*tjd��n6|jdkr`tjtjd�tjr`dGHq`n|jd7_tjr�d|fGHndS(Nis.setitimer didn't disable ITIMER_VIRTUAL timer.islast SIGVTALRM handler callisSIGVTALRM handler invoked(	R$R�R�R/tItimerErrorR�tITIMER_VIRTUALRR&(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyt
sig_vtalrm�s			cGs7t|_tjtjd�tjr3d|fGHndS(NisSIGPROF handler invoked(R$R�R/R�tITIMER_PROFRR&(RR((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pytsig_prof�s		cCs |jtjtjdd�dS(Ni����i(RbR/R�R�(R((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_itimer_exc�scCsQtj|_tj|jd�tjr0dGHntj�|j|jt	�dS(Ng�?s
call pause()...(
R/tITIMER_REALR�R�RR&RARhR�R$(R((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_itimer_real�s	
RFtnetbsd5sDitimer not reliable (does not mix well with threading) on some BSDs.cCs�tj|_tjtj|j�tj|jdd�tj�}xUtj�|dkr�tddd�}tj|j�d	krGPqGqGW|j	d�|j
tj|j�d
�|j
|jt�dS(Ng333333�?g�������?gN@i90i2	i���gs8timeout: likely cause: machine too slow or load too high(gg(gg(
R/R�R�t	SIGVTALRMR�R�R;tpowt	getitimertskipTestRhR�R$(Rt
start_timet_((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_itimer_virtual�s
sBitimer not reliable (does not mix well with threading) on freebsd6cCs�tj|_tjtj|j�tj|jdd�tj�}xUtj�|dkr�tddd�}tj|j�dkrGPqGqGW|j	d�|j
tj|j�d	�|j
|jt�dS(
Ng�������?gN@i90i2	i���gs8timeout: likely cause: machine too slow or load too high(gg(gg(
R/R�R�tSIGPROFR�R�R;R�R�R�RhR�R$(RR�R�((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_itimer_prof�s
cCsCtj|_tj|jd�tjd�|j|jt�dS(Ng���ư>i(	R/R�R�R�R;R<RhR�R$(R((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyttest_setitimer_tiny�s
(RFR�(RRRRR�R�R�R�R�R\R]R^R_R�R�R�(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR��s								
cCs#tjttttttt�dS(N(	Rtrun_unittestR`RRxR}R�R�Rk(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyR[st__main__(RR(!R\ttestRt
contextlibRRRLROR/R8R R^RR;RR_tSkipTestt	ExceptionRR	RR]tTestCaseRR`t
skipUnlessRkRxR}R�R�R[R(((s7/usr/local/python-2.7/lib/python2.7/test/test_signal.pyt<module>s<0	
		�5eu	
© 2025 GrazzMean