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.145.71.171
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_gc.pyc
�
?��cc@s	ddlZddlmZmZmZmZddlZddlZddlZddl	Z	yddl
Z
Wnek
r�eZ
nXde
fd��YZde
fd��YZdejfd��YZd	ejfd
��YZd�Zedkre�ndS(
i����N(tverbosetrun_unittestt
start_threadstrequires_type_collectingtC1055820cBseZd�ZRS(cCs||_||_dS(N(titloop(tselfR((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt__init__s	(t__name__t
__module__R(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRstGC_DetectorcBseZd�ZRS(cs7t�_�fd�}tjtd�|��_dS(Ncs
t�_dS(N(tTruetgc_happened(tignored(R(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pytit_happened"si�(tFalseR
tweakreftrefRtwr(RR((Rs3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRs	(R	R
R(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRstGCTestscBs
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�ZRS(cCs:g}|j|�tj�~|jtj�d�dS(Ni(tappendtgctcollecttassertEqual(Rtl((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt	test_list.s


cCs7i}||d<tj�~|jtj�d�dS(Ni(RRR(Rtd((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt	test_dict5s


cCsFg}|f}|j|�tj�~~|jtj�d�dS(Ni(RRRR(RRtt((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt
test_tuple<s	

cCsCddd��Y}||_tj�~|jtj�d�dS(NtAcBseZRS((R	R
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRGsi((taRRtassertNotEqual(RR((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt
test_classFs
	
cCs=dtfd��Y}tj�~|jtj�d�dS(NRcBseZRS((R	R
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyROsi(tobjectRRR!(RR((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_newstyleclassNs
cCsLddd��Y}|�}||_tj�~|jtj�d�dS(NRcBseZRS((R	R
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRVsi((R RRR!(RRR ((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt
test_instanceUs		
cCs
dtfd��Y}|�}||_tj�~|jtj�d�dtfd��Y}d||fd��Y}|�}||_tj�~|jtj�d�~~|jtj�d�|�|_~|jtj�d�|jtj�d�dS(NRcBseZRS((R	R
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR`sitBcBseZRS((R	R
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR&gstCcBseZRS((R	R
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR'is(R#R RRR!tlistR(RRR R&R'((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_newinstance^s&		
		
cCsCddd��Y}|�}tj�~|jtj�d�dS(NRcBseZd�ZRS(cSs|j|_dS(N(Rtinit(R((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRzs(R	R
R(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRysi((RRR!(RRR ((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_methodws
	
cCs�ddd��Y}ddd��Y}|�}||_t|�}|�}||_tj�~~|jtj�d�x:tjD]"}t|�|kr�|`Pq�q�W|jd�tjj|�dS(	NRcBseZd�ZRS(cSsdS(N((R((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt__del__�t(R	R
R,(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR�sR&cBseZRS((R	R
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR&�sis&didn't find obj in garbage (finalizer)(((	R tidtbRRR!tgarbagetfailtremove(RRR&R tid_aR/tobj((s3/usr/local/python-2.7/lib/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(NRcBseZd�ZRS(cSsdS(N((R((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR,�R-(R	R
R,(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR�sR&cBseZRS((R	R
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR&�sis&didn't find obj in garbage (finalizer)(
R#R R.R/RRR!R0R1R2(RRR&R R3R/R4((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_finalizer_newclass�s"				

cBs5i}d|Uej�~|jej�d�dS(Nsdef f(): pass
i(RRR(RR((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt
test_function�s

cCs4d�}tj�|�|jtj�d�dS(NcSstj�}dS(N(tsyst	_getframe(tframe((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pytf�si(RRR(RR;((s3/usr/local/python-2.7/lib/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(RRRR0RR.t	get_debugt	set_debugt
DEBUG_SAVEALLtlentpop(RtLtid_LtdebugR4((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_saveall�s



cCs]tj�}tj�tjd�ddd��Y}|�}~tj�tj|�dS(NiRcBseZd�ZRS(cSst|�dS(N(tdir(R((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR,�s(R	R
R,(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR�s((Rt
get_thresholdtenablet
set_thresholdtdisable(Rt
thresholdsRR ((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_del�s

	
cCs`tj�}tj�tjd�dtfd��Y}|�}~tj�tj|�dS(NiRcBseZd�ZRS(cSst|�dS(N(RF(R((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR,�s(R	R
R,(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR�s(RRGRHRIR#RJ(RRKRR ((s3/usr/local/python-2.7/lib/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 ((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_get_count�s
	
	cCs�|j}tj�t�}tjd�|tj�d�tjd�|tj�d�tjd�|tj�d�dS(Niii(iii(iii(iii(RRRRPRO(RRR ((s3/usr/local/python-2.7/lib/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(RS(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR,s(R	R
RTR,((RS(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRSsi�ii((RRHtrangeRJ(RtNtcountRRtutv((RSs3/usr/local/python-2.7/lib/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(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pytsleeper_gen<s	R'cs5eZgZgZ�fd�Z��fd�ZRS(cs||(�jjd�dS(N(tinitsRtNone(Rtalist(R'(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRGscs'�jjd���}t|�dS(N(tdelsRR_tnext(Rtg(R'R](s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR,Js	(R	R
R^RaRR,((R'R](s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR'Cscs<�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(RU(txR(R'tNESTING(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pytmake_nestedUscsx�s��qWdS(s!Exercise make_nested() in a loop.N(((texitRf(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt
run_thread]s	ittargetcs
�jd�S(Ni(R((Rg(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt<lambda>jR-g�?(R(R8tgetcheckintervaltsetcheckintervalRUt	threadingtThreadRRR[R\RRRR@R^Ra(Rt	N_THREADSRhtold_checkintervaltthreadsRR((R'ReRgRfR]s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_trashcan_threads6s&	

cCs�ddd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(NtBoomcBseZd�ZRS(cSs|`t�dS(N(tattrtAttributeError(Rt
someattribute((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt__getattr__ss(R	R
Rw(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRsrsi((RtRRR@R0R(RRsR R/t
garbagelen((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt	test_boomqs				
cCs�ddd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(NtBoom2cBseZd�Zd�ZRS(cSs
d|_dS(Ni(Rd(R((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR�scSs1|jd7_|jdkr'|`nt�dS(Ni(RdRtRu(RRv((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRw�s	(R	R
RRw(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRz�s	i((RtRRR@R0R(RRzR R/Rx((s3/usr/local/python-2.7/lib/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(RtRu(RRv((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRw�s(R	R
Rw(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR|�si(R#RtRRR@R0R(RR|R R/Rx((s3/usr/local/python-2.7/lib/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(Rd(R((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR�scSs1|jd7_|jdkr'|`nt�dS(Ni(RdRtRu(RRv((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyRw�s	(R	R
RRw(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR~�s	i(R#RtRRR@R0R(RR~R R/Rx((s3/usr/local/python-2.7/lib/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_referentstsortRttupleRU(RR`tgottatupletadicttexpected((s3/usr/local/python-2.7/lib/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
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR��stNewStylecBseZRS((R	R
(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR��sy�?@((tassertFalseRt
is_trackedR_RRt	bytearrayttypetintR#t
assertTruetset(RR�R�((s3/usr/local/python-2.7/lib/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(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pytcallbacksii(	RURRRR_RRRR@(RR�RtCstcRd((R�R�s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_bug1055820bs%%


( R	R
RRRR"R$R%RR)R+R5R6R7R<RERLRMRQRRRZtunittestt
skipUnlessRmRrRyR{R}RR�R�R�(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR-s4			
					
									
		#;						tGCTogglingTestscBs,eZd�Zd�Zd�Zd�ZRS(cCstj�dS(N(RRH(R((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pytsetUpscCstj�dS(N(RRJ(R((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttearDown sc
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�(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR�3si's'gc didn't happen after 10000 iterations(RRRt
keep_c0_aliveRRRR_RR
R1RR@R(
Rtc0tc1tc2R�tc0wrtjunkRtdetectorRd((R�R�s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_bug1055820c#s.
	 	

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�(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR,ps(R	R
R,((R�R�(s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR�osiiii's'gc didn't happen after 10000 iterations(RRRt
keep_d0_aliveRRRR_RR
R1RR@R(	RR�td0R�R�R�R�RRd((R�R�s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyttest_bug1055820dis,
		

(R	R
R�R�R�R�(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyR�s			FcCs�tj�}tj�tj�s)t�tj�}tj|tj@�ztj�tt	t
�Wdtj|�tr�dGHntj�tj�s�t�|s�tj�nXdS(Nsrestoring automatic collection(
Rt	isenabledRJtAssertionErrorR=R>t
DEBUG_LEAKRRRR�RRH(tenabledRD((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt	test_main�s



t__main__(R�ttest.supportRRRRR8R[RRRmtImportErrorR_R#RRtTestCaseRR�R�R	(((s3/usr/local/python-2.7/lib/python2.7/test/test_gc.pyt<module>s""


���	
© 2025 GrazzMean