403Webshell
Server IP : 118.27.122.248  /  Your IP : 216.73.216.63
Web Server : Apache
System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
User : c9415830 ( 11735)
PHP Version : 8.4.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python27/lib64/python2.7/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python27/lib64/python2.7/test/test_gc.pyo
�
�q2_c@s1ddlZddlmZmZmZmZmZddlZddlZddl	Z	ddl
Z
ddlZyddlZWne
k
r�eZnXdefd��YZdefd��YZdej�dkZd	ejfd
��YZdejfd��YZd
�Zedkr-e�ndS(i����N(tverbosetrun_unittestt
start_threadst
import_moduletrequires_type_collectingtC1055820cBseZd�ZRS(cCs||_||_dS(N(titloop(tselfR((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt__init__s	(t__name__t
__module__R	(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyRstGC_DetectorcBseZd�ZRS(cs7t�_�fd�}tjtd�|��_dS(Ncs
t�_dS(N(tTruetgc_happened(tignored(R(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pytit_happened#si�(tFalseRtweakreftrefRtwr(RR((Rs1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR	 s	(R
RR	(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyRss-DNDEBUGt	PY_CFLAGStGCTestscBs%eZd�Zd�Zd�Zd�Zd�Zd�Zed��Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zejed�d��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zej e!d�d��Z"RS(cCs:g}|j|�tj�~|jtj�d�dS(Ni(tappendtgctcollecttassertEqual(Rtl((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt	test_list0s


cCs7i}||d<tj�~|jtj�d�dS(Ni(RRR(Rtd((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt	test_dict7s


cCsFg}|f}|j|�tj�~~|jtj�d�dS(Ni(RRRR(RRtt((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt
test_tuple>s	

cCsCddd��Y}||_tj�~|jtj�d�dS(NtAcBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR!Isi((taRRtassertNotEqual(RR!((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt
test_classHs
	
cCs=dtfd��Y}tj�~|jtj�d�dS(NR!cBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR!Qsi(tobjectRRR#(RR!((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_newstyleclassPs
cCsLddd��Y}|�}||_tj�~|jtj�d�dS(NR!cBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR!Xsi((R"RRR#(RR!R"((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt
test_instanceWs		
cCsZdtfd��Y}|�}||_tj�~|jtj�d�dtfd��Y}d||fd��Y}|�}||_tj�~|jtj�d�~~ttd�r�|jtj�d�n|jtj�d�|�|_~ttd�r*|jtj�d�n,|jtj�d�|jtj�d�dS(	NR!cBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR!bsitBcBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR(istCcBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR)kst	getcounts(	R%R"RRR#tlistthasattrtsysR(RR!R"R(R)((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_newinstance`s.		
		
cCsCddd��Y}|�}tj�~|jtj�d�dS(NR!cBseZd�ZRS(cSs|j|_dS(N(R	tinit(R((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR	�s(R
RR	(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR!�si((RRR#(RR!R"((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_methods
	
cCs�ddd��Y}ddd��Y}|�}||_t|�}|�}||_tj�~~|jtj�d�x:tjD]"}t|�|kr�|`Pq�q�W|jd�tjj|�dS(	NR!cBseZd�ZRS(cSsdS(N((R((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt__del__�t(R
RR1(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR!�sR(cBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR(�sis&didn't find obj in garbage (finalizer)(((	R"tidtbRRR#tgarbagetfailtremove(RR!R(R"tid_aR4tobj((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_finalizer�s"				

cCs�dtfd��Y}dtfd��Y}|�}||_t|�}|�}||_tj�~~|jtj�d�x:tjD]"}t|�|kr�|`Pq�q�W|jd�tjj	|�dS(NR!cBseZd�ZRS(cSsdS(N((R((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR1�R2(R
RR1(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR!�sR(cBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR(�sis&didn't find obj in garbage (finalizer)(
R%R"R3R4RRR#R5R6R7(RR!R(R"R8R4R9((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_finalizer_newclass�s"				

cBs5i}d|Uej�~|jej�d�dS(Nsdef f(): pass
i(RRR(RR((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt
test_function�s

cCs4d�}tj�|�|jtj�d�dS(NcSstj�}dS(N(R-t	_getframe(tframe((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pytf�si(RRR(RR?((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt
test_frame�s	
cCs�tj�|jtjg�g}|j|�t|�}tj�}tj|tjB�~tj�tj|�|jt	tj�d�tjj
�}|jt|�|�dS(Ni(RRRR5RR3t	get_debugt	set_debugt
DEBUG_SAVEALLtlentpop(RtLtid_LtdebugR9((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_saveall�s



cCs]tj�}tj�tjd�ddd��Y}|�}~tj�tj|�dS(NiR!cBseZd�ZRS(cSst|�dS(N(tdir(R((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR1�s(R
RR1(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR!�s((Rt
get_thresholdtenablet
set_thresholdtdisable(Rt
thresholdsR!R"((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_del�s

	
cCs`tj�}tj�tjd�dtfd��Y}|�}~tj�tj|�dS(NiR!cBseZd�ZRS(cSst|�dS(N(RJ(R((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR1�s(R
RR1(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR!�s(RRKRLRMR%RN(RROR!R"((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_del_newclass�s

	
cCsF|j}tj�|tj�d�t�}|tj�d�dS(Nii(iii(iii(t_baseAssertEqualRRt	get_counttdict(RRR"((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_get_counts
	
	cCs�|j}tj�t�}tjd�|tj�d�tjd�|tj�d�tjd�|tj�d�dS(Niii(iii(iii(iii(RRRRTRS(RRR"((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_collect_generationss	
	


cs�dd�fd��Y�tj�d}x�td�D]�}g}x#t|�D]}|��g}qOWg}x#t|�D]}|��g}q{Wi}x+t|�D]}i|d6��d6}q�Wq6Wtj�dS(NtOuchcseZdZ�fd�ZRS(ics4�jd�_�jddkr0tj�ndS(Niii(tnRR(R(RW(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR1s(R
RRXR1((RW(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyRWsi�ii((RRLtrangeRN(RtNtcountRRtutv((RWs1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt
test_trashcans
s*test meaningless on builds without threadscs$d�d}d��dtf��fd��Y���fd����fd�}tj�}tjd�zrg�g}x3t|�D]%}tjd	|�}|j|�q�Wt|�fd
���t	j
d�WdQXWdtj|�Xtj�|j
t�j�t�j��dS(Ni<icssz	dVWdtjd�XdS(s<A generator that releases the GIL when closed or dealloc'ed.Ng���ư>(ttimetsleep(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pytsleeper_genDs	R)cs5eZgZgZ�fd�Z��fd�ZRS(cs||(�jjd�dS(N(tinitsRtNone(Rtalist(R)(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR	Oscs'�jjd���}t|�dS(N(tdelsRRctnext(Rtg(R)Ra(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR1Rs	(R
RRbReR	R1((R)Ra(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR)Kscs<�g�}x&t��D]}�|g�g}qW~dS(syCreate a sufficiently nested container object so that the
            trashcan mechanism is invoked when deallocating it.N(RY(txR(R)tNESTING(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pytmake_nested]scsx�s��qWdS(s!Exercise make_nested() in a loop.N(((texitRj(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt
run_threades	ittargetcs
�jd�S(Ni(R((Rk(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt<lambda>rR2g�?(R+R-tgetcheckintervaltsetcheckintervalRYt	threadingtThreadRRR_R`RRRRDRbRe(Rt	N_THREADSRltold_checkintervaltthreadsRR((R)RiRkRjRas1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_trashcan_threads>s&	

cCs�ddd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(NtBoomcBseZd�ZRS(cSs|`t�dS(N(tattrtAttributeError(Rt
someattribute((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt__getattr__{s(R
RR{(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyRwzsi((RxRRRDR5R(RRwR"R4t
garbagelen((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt	test_boomys				
cCs�ddd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(NtBoom2cBseZd�Zd�ZRS(cSs
d|_dS(Ni(Rh(R((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR	�scSs1|jd7_|jdkr'|`nt�dS(Ni(RhRxRy(RRz((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR{�s	(R
RR	R{(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR~�s	i((RxRRRDR5R(RR~R"R4R|((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt
test_boom2�s
				
cCs�dtfd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(NtBoom_NewcBseZd�ZRS(cSs|`t�dS(N(RxRy(RRz((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR{�s(R
RR{(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR��si(R%RxRRRDR5R(RR�R"R4R|((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt
test_boom_new�s				
cCs�dtfd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(Nt	Boom2_NewcBseZd�Zd�ZRS(cSs
d|_dS(Ni(Rh(R((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR	�scSs1|jd7_|jdkr'|`nt�dS(Ni(RhRxRy(RRz((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR{�s	(R
RR	R{(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR��s	i(R%RxRRRDR5R(RR�R"R4R|((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_boom2_new�s
				
cCs+dddg}tj|�}|j�|j||�t|�}tj|�}|j�|j||�idd6dd6}ddddg}tj|�}|j�|j||�tjddgidd6d
�}|j�|j|ddgtd��|jtjddd	�g�dS(NiiiiiiiR"y@(iii(Rt
get_referentstsortRttupleRY(RRdtgottatupletadicttexpected((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_get_referents�s"


"
 cCs�|jtjd��|jtjd��|jtjd��|jtjd
��|jtjt��|jtjt��|jtjd��|jtjd��|jtjtd���|jtjt��|jtjt��|jtjt	��|jtjt	���ddd��Y}dt	fd	��Y}|j
tjt��|j
tj|��|j
tj|���|j
tj|��|j
tj|���|j
tjg��|j
tjt���dS(Nig�?y@R"uatOldStylecBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR�stNewStylecBseZRS((R
R(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR�sy�?@((tassertFalseRt
is_trackedRcR
Rt	bytearrayttypetintR%t
assertTruetset(RR�R�((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_is_tracked�s,cs�g���fd�}gtd�D]}t|�^q%}g|D]}tj||�^qD�d}tj�|jt��d�d}tj�|jt��d�x�D]}|j|d�q�WdS(Ncs!g�D]}|�^q�(dS(N((RR(tWRstouch(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pytcallbacksii(	RYRRRRcRRRRD(RR�RtCstcRh((R�R�s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_bug1055820bs%%


sbuilt with -NDEBUGcCs�td�ddl}d}|jtjd|gd|jd|j�}|j�\}}|jj�|j	j�|j
|d�|j
|d�|j
|d	�|j
|d
�|j
|d�|j
|d�dS(
Ntctypesi����s�if 1:
        a = []
        b = [a]

        # Simulate the refcount of "a" being too low (compared to the
        # references held on it by live data), but keeping it above zero
        # (to avoid deallocating it):
        import ctypes
        ctypes.pythonapi.Py_DecRef(ctypes.py_object(a))

        # The garbage collector should now have a fatal error when it reaches
        # the broken object:
        import gc
        gc.collect()
        s-ctstdouttstderrsPModules/gcmodule.c:[0-9]+: visit_decref: Assertion "gc->gc.gc_refs != 0" failed.srefcount was too smallsobject  : \[\]stype    : listsrefcount: 1saddress : 0x[0-9a-f]+(Rt
subprocesstPopenR-t
executabletPIPEtcommunicateR�tcloseR�tassertRegexpMatches(RR�tcodetpR�R�((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_refcount_errors$s*
	

						(#R
RRRR R$R&R'RR.R0R:R;R<R@RIRPRQRURVR^tunittestt
skipUnlessRqRvR}RR�R�R�R�R�tskipIftBUILT_WITH_NDEBUGR�(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR/s8			
					
									
		#;								tGCTogglingTestscBs,eZd�Zd�Zd�Zd�ZRS(cCstj�dS(N(RRL(R((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pytsetUpPscCstj�dS(N(RRN(R((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttearDownSsc
s-td�}tj�td�}||_|`td�}tj|��g���fd�}tj||�}d}}}g}d}t�}xV|j	s�|d7}|dkr�|j
d�n|jt��d�|j
g�q�W|jt��d�x�D]}	|j|	d�qWdS(Niiics��g�(dS(N((R(tc2wrR�(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR�fsi's'gc didn't happen after 10000 iterations(RRRt
keep_c0_aliveRRRRcRRR6RRDR(
Rtc0tc1tc2R�tc0wrtjunkRtdetectorRh((R�R�s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_bug1055820cVs.
	 	

c	s(g�dtf��fd��Y}|d�}tj�td�}||_|`td�}tj|��d}}}t�}g}d}xV|j	s�|d7}|dkr�|j
d�n|jt��d�|j
g�q�W|jt��d�x�D]}|j|d�q
WdS(NtDcseZ��fd�ZRS(cs��g�(dS(N((R(R�R�(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR1�s(R
RR1((R�R�(s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR��siiii's'gc didn't happen after 10000 iterations(RRRt
keep_d0_aliveRRRRcRRR6RRDR(	RR�td0R�R�R�R�RRh((R�R�s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyttest_bug1055820d�s,
		

(R
RR�R�R�R�(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyR�Os			FcCs�tj�}tj�tj�}tj|tj@�ztj�ttt	�Wdtj|�t
rpdGHntj�|s�tj�nXdS(Nsrestoring automatic collection(Rt	isenabledRNRARBt
DEBUG_LEAKRRRR�RRL(tenabledRH((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt	test_main�s



t__main__(R�ttest.test_supportRRRRRR-t	sysconfigR_RRRqtImportErrorRcR%RRtget_config_varsR�tTestCaseRR�R�R
(((s1/opt/alt/python27/lib64/python2.7/test/test_gc.pyt<module>s((


��"�	

Youez - 2016 - github.com/yon3zu
LinuXploit