python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_finalization.cpython-311.opt-2.pyc

e:	ddlZddlZddlZddlZ	ddlmZn#e$rdZYnwxYw	ddlmZn#e$rdZYnwxYwddlm	Z	GddZ
Gd	d
e
ZeGdde
ZeGd
de
Z
GddeZGddeZGddZGddeejZGddZGddeeZGddeeZGddeeZGdd eejZGd!d"ZGd#d$eeZGd%d&eeZGd'd(eeZGd)d*eejZGd+d,eZeGd-d.eZeGd/d0eZeGd1d2eeZ e	j!Gd3d4eejZ"e#d5krej$dSdS)6N)with_tp_delc,Gddt}|S)NceZdZdZdS)with_tp_del.<locals>.Cc td)Nzrequires _testcapi.with_tp_del	TypeErrorclsargskwargss   J/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_finalization.py__new__zwith_tp_del.<locals>.C.__new__s @AAAN__name__
__module____qualname__rrrCrs(
B
B
B
B
Brr)objectrrs  rrr
s;	B	B	B	B	B	B	B	Br)
without_gcc Gdd}|S)NceZdZdZdS)without_gc.<locals>.Cc td)Nzrequires _testcapi.without_gcrr
s   rrzwithout_gc.<locals>.C.__new__s ?@@@rNrrrrrrs(
A
A
A
A
Arrrrs  rrrs9	A	A	A	A	A	A	A	Ar)supportceZdZ	gZgZgZgZdZdZe	dZ
e	ejdZ
dZdZdZdS)	NonGCSimpleBaseFrc0|j|jtjtj|j|jdSN)	survivorsclearerrorsgcgarbagecollect	del_callstp_del_callsrs r_cleanupzNonGCSimpleBase._cleanup.sx






     rc#K	tj5|j|jdt
_	dV|jr
|jd	dt
_|n%#dt
_|wxYw	ddddS#1swxYwYdS)NFrT)	r
disable_gcr)r$r*r 	_cleaningr%r,r+s rtestzNonGCSimpleBase.test7s	

!
!
	
	M!!!""$$$(-O%
:(*Q-'(-1)-1)
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	s)?CB0!C"B33CCCcdSr"rselfs rcheck_sanityzNonGCSimpleBase.check_sanityI		rc		|jsQ|jt|||dSdS#t$r%}|j|Yd}~dSd}~wwxYwr")r/r)appendidr4side_effect	Exceptionr%r3es  r__del__zNonGCSimpleBase.__del__Ns		">
#%%bhh///!!###  """""
#
#	"	"	"Kq!!!!!!!!!	"AA
B'BBcdSr"rr2s rr9zNonGCSimpleBase.side_effect[r5rN)rrrr#r)r*r%r/	__slots__classmethodr,
contextlibcontextmanagerr0r4r=r9rrrr r s
IIL
FII!![![ 
"""rr ceZdZdZdZdS)
SimpleBasec.t||_dSr")r8id_r2s r__init__zSimpleBase.__init__csd88rcdSr"rr2s rr4zSimpleBase.check_sanityfsrN)rrrrHr4rrrrErEas2$$$$$rrEceZdZdZdS)NonGCrN)rrrr@rrrrKrKjsIIIrrKceZdZdZdZdS)NonGCResurrectorrc<	|j|dSr"r#r7r2s rr9zNonGCResurrector.side_effectr%		
d#####rN)rrrr@r9rrrrMrMns(I$$$$$rrMceZdZdS)SimpleNrrrrrrrRrRxDrrRceZdZdZdS)SimpleResurrectorc<	|j|dSr"rOr2s rr9zSimpleResurrector.side_effect~rPrNrrrr9rrrrVrV|s#$$$$$rrVc8eZdZdZdZdZdZdZdZdZ	dS)	TestBasecZtjdd|_gtjdd<dSr")r&r'old_garbager2s rsetUpzTestBase.setUps':aaa=
111


rc	|tjg|`tjdS#|`tjwxYwr")assertEqualr&r'r\r(r2s rtearDownzTestBase.tearDownsM	RZ,,, JLLLLL JLLLLs	 9Acz|ttjt|dSr")r_sortedrEr)r3idss  rassert_del_callszTestBase.assert_del_callss/
 455vc{{CCCCCrcz|ttjt|dSr")r_rbrEr*rcs  rassert_tp_del_callszTestBase.assert_tp_del_callss/
 788&++FFFFFrc|tdtjDt|dS)Nc34K|]}t|VdSr"r8.0xs  r	<genexpr>z,TestBase.assert_survivors.<locals>.<genexpr>s(DD!1DDDDDDr)r_rbrEr#rcs  rassert_survivorszTestBase.assert_survivorss>DDz/CDDDDDfSkkRRRRRrc|tdtjDt|dS)Nc34K|]}t|VdSr"rjrks  rrnz*TestBase.assert_garbage.<locals>.<genexpr>s(::!1::::::r)r_rbr&r'rcs  rassert_garbagezTestBase.assert_garbages=::rz:::::F3KKHHHHHrcBtjdSr")rEr#r$r2s rclear_survivorszTestBase.clear_survivorss""$$$$$rN)
rrrr]r`rergrorrrtrrrrZrZsDDDGGGSSSIII%%%%%rrZc\eZdZ	dZdZejdZejdZdS)SimpleFinalizationTestct5t}t|g}t	j|}~t
j|||	g|
|dt
j|||	gddddS#1swxYwYdSr")rEr0rRr8weakrefrefr&r(reroassertIsr3srdwrs    rtest_simplez"SimpleFinalizationTest.test_simples
__

	&	&Aa55'CQBJLLL!!#&&&!!"%%%MM""$$%%%JLLL!!#&&&!!"%%%	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&CC33C7:C7cbt5t}t|g}t	j|}~t
j|||	||
|d|t
j|||	gdddn#1swxYwY||ddSr")
rEr0rVr8rxryr&r(reroassertIsNotrtrzr{s    rtest_simple_resurrectz,SimpleFinalizationTest.test_simple_resurrectsE
__

	&	&!##Aa55'CQBJLLL!!#&&&!!#&&&RRTT4(((  """JLLL!!#&&&!!"%%%	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	


bbddD!!!!!sC DD

D
ct5t}|t	j|t
|g}~t	j|||	gt	j|||	gddddS#1swxYwYdSr")
rEr0rKassertFalser&
is_trackedr8r(reror3r|rds   rtest_non_gcz"SimpleFinalizationTest.test_non_gcs
__


	&
	&AR]1--...a55'CJLLL!!#&&&!!"%%%JLLL!!#&&&!!"%%%
	&
	&
	&
	&
	&
	&
	&
	&
	&
	&
	&
	&
	&
	&
	&
	&
	&
	&sCC((C,/C,ct5t}|t	j|t
|g}~t	j|||	||
t	j||dz|	|ddddS#1swxYwYdSN)rEr0rMrr&rr8r(rerortrs   rtest_non_gc_resurrectz,SimpleFinalizationTest.test_non_gc_resurrects+
__

	'	' ""AR]1--...a55'CJLLL!!#&&&!!#&&&  """JLLL!!#'***!!#&&&	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'sCC??DDN)	rrrr~rrcpython_onlyrrrrrrvrvsu&&&""" 
&&&
'''''rrvc(eZdZfdZfdZxZS)
SelfCycleBasecVt||_dSr")superrHryr3	__class__s rrHzSelfCycleBase.__init__s$
rcHtdSr")rr4rs rr4zSelfCycleBase.check_sanitys
r)rrrrHr4
__classcell__rs@rrrsQ         rrceZdZdS)SimpleSelfCycleNrSrrrrrrTrrceZdZdS)SelfCycleResurrectorNrSrrrrrrTrrceZdZdZdS)SuicidalSelfCyclec	d|_dSr")ryr2s rr9zSuicidalSelfCycle.side_effects	rNrXrrrrrs#rrc"eZdZ	dZdZdZdS)SelfCycleFinalizationTestct5t}t|g}t	j|}~t
j|||	g|
|dt
j|||	gddddS#1swxYwYdSr")rEr0rr8rxryr&r(rerorzr{s    rr~z%SelfCycleFinalizationTest.test_simples
__

	&	&!!Aa55'CQBJLLL!!#&&&!!"%%%MM""$$%%%JLLL!!#&&&!!"%%%	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&rcdt5t}t|g}t	j|}~t
j|||	||
|d|t
j|||	g|
|dddddS#1swxYwYdSr")rEr0rr8rxryr&r(rerorzrtr{s    rrz/SelfCycleFinalizationTest.test_simple_resurrectsL
__

	&	&$&&Aa55'CQBJLLL!!#&&&!!#&&&MM""$$%%%
  """JLLL!!#&&&!!"%%%MM""$$%%%!	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&sC>D%%D),D)c<t5t}t|g}t	j|}~t
j|||	g|
|dt
j|||	g|
|dddddS#1swxYwYdSr")rEr0rr8rxryr&r(rerorzr{s    rtest_simple_suicidez-SelfCycleFinalizationTest.test_simple_suicide%s:__

	&	&!##Aa55'CQBJLLL!!#&&&!!"%%%MM""$$%%%JLLL!!#&&&!!"%%%MM""$$%%%	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&sC*DDDN)rrrr~rrrrrrrsF
&&&&&&(&&&&&rrc$eZdZdZfdZxZS)ChainedBasec0d|_||_||_dS)NFsuicidedleftright)r3rs  rchainzChainedBase.chain9s
	


rct|jrdS|j}|jr	|j}|jrdSdSr")rr4rrr)r3rrrs   rr4zChainedBase.check_sanity>sl
=
	*
	*
	*9D}
*
*JE~
*
*
*
*
*r)rrrrr4rrs@rrr7sG
*********rrceZdZdS)
SimpleChainedNrSrrrrrOrTrrceZdZdS)ChainedResurrectorNrSrrrrrRrTrrceZdZdZdS)SuicidalChainedc2	d|_d|_d|_dS)NTrr2s rr9zSuicidalChained.side_effectWs"	
	


rNrXrrrrrUs#rrcReZdZ	dZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dS)
CycleChainFinalizationTestcd|D}tt|D]&}||||dz
'|S)Nc"g|]}|
Srr)rlrs  r
<listcomp>z:CycleChainFinalizationTest.build_chain.<locals>.<listcomp>hs***3***r)rangelenr)r3classesnodesis    rbuild_chainz&CycleChainFinalizationTest.build_chaingsX**'***s5zz""	'	'A!HNN51:&&&&rct|}t5||}d|D}d|D}~t	j|||g|d|Ddg|zt	j||ddddS#1swxYwYdS)Nc,g|]}t|Srrjrlr|s  rrzKCycleChainFinalizationTest.check_non_resurrecting_chain.<locals>.<listcomp>q(((Q2a55(((rc6g|]}tj|Srrxryrs  rrzKCycleChainFinalizationTest.check_non_resurrecting_chain.<locals>.<listcomp>r 111a7;q>>111rc"g|]}|
Srrrlr}s  rrzKCycleChainFinalizationTest.check_non_resurrecting_chain.<locals>.<listcomp>w111rbbdd111r)	rrEr0rr&r(reror_)r3rNrrdwrss      rcheck_non_resurrecting_chainz7CycleChainFinalizationTest.check_non_resurrecting_chainms:LL
__


	'
	'$$W--E((%(((C115111CJLLL!!#&&&!!"%%%11S111D6A:>>>JLLL!!#&&&
	'
	'
	'
	'
	'
	'
	'
	'
	'
	'
	'
	'
	'
	'
	'
	'
	'
	'sB8C..C25C2c~t|}t5||}t|}d|D}d|D}d|D}~t	j|||||d|Ddg|z|	t	j|||gddddS#1swxYwYdS)Nc,g|]}t|Srrjrs  rrzGCycleChainFinalizationTest.check_resurrecting_chain.<locals>.<listcomp>rrcVg|]&}t|tt|'Sr)
isinstancerVr8rs  rrzGCycleChainFinalizationTest.check_resurrecting_chain.<locals>.<listcomp>s.UUUaJqBS4T4TUBqEEUUUrc6g|]}tj|Srrrs  rrzGCycleChainFinalizationTest.check_resurrecting_chain.<locals>.<listcomp>rrc"g|]}|
Srrrs  rrzGCycleChainFinalizationTest.check_resurrecting_chain.<locals>.<listcomp>rr)
rrEr0rr&r(reror_rt)r3rrrrdsurvivor_idsrs       rcheck_resurrecting_chainz3CycleChainFinalizationTest.check_resurrecting_chain{s~LL
__

	&	&$$W--EE

A((%(((CUU5UUUL115111CJLLL!!#&&&!!,///11S111D6A:>>>  """JLLL!!#&&&!!"%%%	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&	&sC<D22D69D6cB|tgdzdSN)rrr2s rtest_homogenousz*CycleChainFinalizationTest.test_homogenouss#))=/A*=>>>>>rcB|tgdzdSr)rrr2s rtest_homogenous_resurrectz4CycleChainFinalizationTest.test_homogenous_resurrects%%%'9&:Q&>?????rcB|tgdzdSr)rrr2s rtest_homogenous_suicidalz3CycleChainFinalizationTest.test_homogenous_suicidals$))?*;a*?@@@@@rcN|ttgdzdSrrrrr2s rtest_heterogenous_suicidal_onez9CycleChainFinalizationTest.test_heterogenous_suicidal_ones&))?M*JQ*NOOOOOrcZ|tgdztgdzzdSrrr2s rtest_heterogenous_suicidal_twoz9CycleChainFinalizationTest.test_heterogenous_suicidal_twos;))
!]Oa$77	9	9	9	9	9rcN|ttgdzdSr)rrrr2s rtest_heterogenous_resurrect_onez:CycleChainFinalizationTest.test_heterogenous_resurrect_ones'%%'9=&IA&MNNNNNrcZ|tttgdzdSrrrrrr2s rtest_heterogenous_resurrect_twoz:CycleChainFinalizationTest.test_heterogenous_resurrect_twos8%%
@1D	F	F	F	F	Frcr|tgdztgdzztgdzzdSrrr2s r!test_heterogenous_resurrect_threez<CycleChainFinalizationTest.test_heterogenous_resurrect_threesN%%
 1$
'::o=NQR=RR	T	T	T	T	TrN)rrrrrrrrrrrrrrrrrrr`s'''&&&&???@@@AAAPPP999OOOFFFTTTTTrrceZdZdZdZdS)
LegacyBasec	|js=|jt||dSdS#t
$r%}|j|Yd}~dSd}~wwxYwr")r/r)r7r8r4r:r%r;s  rr=zLegacyBase.__del__s	">
$%%bhh///!!#####
$
$	"	"	"Kq!!!!!!!!!	"sAA
A7A22A7c		|jsQ|jt|||dSdS#t$r%}|j|Yd}~dSd}~wwxYwr")r/r*r7r8r4r9r:r%r;s  r
__tp_del__zLegacyBase.__tp_del__s		">
#!((D222!!###  """""
#
#	"	"	"Kq!!!!!!!!!	"r>N)rrrr=rrrrrrs2"""
"
"
"
"
"rrceZdZdS)LegacyNrSrrrrrDrrceZdZdZdS)LegacyResurrectorc<	|j|dSr"rOr2s rr9zLegacyResurrector.side_effectrPrNrXrrrrrs#$$$$$rrceZdZdS)LegacySelfCycleNrSrrrrrrrrc2eZdZ	fdZdZdZdZxZS)LegacyFinalizationTestctjtjt	dSr")r&r'r$r(rr`rs rr`zLegacyFinalizationTest.tearDowns@	



rc*t5t}t|g}t	j|}~t
j|||	||
g||dt
j|||	|ddddS#1swxYwYdSr")rEr0rr8rxryr&r(rergrorzr{s    rtest_legacyz"LegacyFinalizationTest.test_legacys0
__

	*	*Aa55'CQBJLLL!!#&&&$$S)))!!"%%%MM""$$%%%JLLL!!#&&&$$S)))	*	*	*	*	*	*	*	*	*	*	*	*	*	*	*	*	*	*sC!DDDct5t}t|g}t	j|}~t
j|||	||
|||d|t
j|||	|dz|
|dddn#1swxYwY||ddSr)
rEr0rr8rxryr&r(rergrorzrtr{s    rtest_legacy_resurrectz,LegacyFinalizationTest.test_legacy_resurrectso
__

	'	'!##Aa55'CQBJLLL!!#&&&$$S)))!!#&&&MM""$$%%%  """JLLL!!#&&&$$S1W---!!#&&&	'	'	'	'	'	'	'	'	'	'	'	'	'	'	' 	


bbddD!!!!!sD
D33D7:D7clt5t}t|g}t	j|}~t
j|g|	g|
g||||ddtj
d_dddn#1swxYwY|g||ddS)Nr)rEr0rr8rxryr&r(rergrorrrr'rzr{s    rtest_legacy_self_cyclez-LegacyFinalizationTest.test_legacy_self_cyclesJ
__

	%	%!!Aa55'CQBJLLL!!"%%%$$R(((!!"%%%$$$RRTT4((( $BJqM	%	%	%	%	%	%	%	%	%	%	%	%	%	%	%	
B

bbddD!!!!!sCC66C:=C:)rrrr`rrrrrs@rrrsj
*
*
*"""&"""""""rr__main__)%rBr&unittestrx	_testcapirImportErrorrr0rr rErKrMrRrVrZTestCaservrrrrrrrrrrrrrrrrrmainrrr<module>rsL				%%%%%%%$$$$$$$????????D$$$$$$$$O$$$$$$$$					Z			$$$$$
$$$%%%%%%%%<>'>'>'>'>'Xx'8>'>'>'B        					mV								=*;			
v7&7&7&7&7&(*;7&7&7&t********0					K								&7			k6GTGTGTGTGT8+<GTGTGTZ""""""""0
					Z		
	
$$$$$
$$
$
					mZ		
		>">">">">"Xx'8>">">"BzHMOOOOOs%%0;;