python (3.11.7)

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

e?-0ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
GddejZGddejZGd	d
ejZGddejZed
krejdSdS)N)support)threading_helper)assert_python_okcheZdZ	d
dZdZdZdZdZdZdZ	d	Z
d
Zej
dZdS)	ClearTestcddzdSNr)selfxkwargss   C/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_frame.pyinnerzClearTest.inners	!cV	|jdi|n#t$r}|}Yd}~nd}~wwxYw|S)Nr)rZeroDivisionError)r
reexcs    routerzClearTest.outersU	DJ       			CCCCCC	
s

&!&cT	|$|j|j}|"dSdSN)tb_framecleartb_next)r
tbs  rclear_traceback_framesz ClearTest.clear_traceback_framess8	nKBnnnnnrcGdd}|}tj|}||}~tj|d|||jtj|d|dS)NceZdZdS)&ClearTest.test_clear_locals.<locals>.CN__name__
__module____qualname__rrrCr!'Drr&c)	weakrefrefrr
gc_collectassertIsNotr
__traceback__assertIsr
r&r)wrrs     rtest_clear_localszClearTest.test_clear_locals&s								
ACC
[^^jj1joo
rrtt$$$##C$5666

dBBDD!!!!!rczGdd}|}||}~|jj}|||jd||jd||jd||jddS)NceZdZdS)7ClearTest.test_clear_does_not_clear_specials.<locals>.CNr"rrrr&r56r'rr&r()	rr.rrr-f_codef_locals
f_builtins	f_globals)r
r&r)rfs     r"test_clear_does_not_clear_specialsz,ClearTest.test_clear_does_not_clear_specials5s								
ACCjj1joo
&				4(((T***t,,,d+++++rcdfd}|}t||jdS)NFc3PK	dVddS#dwxYw)NT)r)endlyr
srgz)ClearTest.test_clear_generator.<locals>.gDs8


s!%)nextassertFalsegi_framer
assertTrue)r
r?genr>s`  @rtest_clear_generatorzClearTest.test_clear_generatorBs						accS			rc~	ddzn##t$r}|jj}Yd}~nd}~wwxYw|t5|dddn#1swxYwY|t5|jddddS#1swxYwYdSr
rr.rassertRaisesRuntimeErrorrf_back)r
rr:s   rtest_clear_executingzClearTest.test_clear_executingRsE	)
aCCC 	)	)	)(AAAAAA	)


|
,
,		
GGIII															


|
,
,		
HNN																		s4
(#(A&&A*-A*B22B69B6cdfd}|}t|}|dS)NFc3K	ddzn#t$r}|jj}t5|dddn#1swxYwYt5|jdddn#1swxYwY|VYd}~nd}~wwxYwddS#dwxYw)NrrTrG)rr:r>r
s  rr?z3ClearTest.test_clear_executing_generator.<locals>.g`s\

!$


O,&&|44GGIII&&|44%%HNN$$$%%%%%%%%%%%%%%%

srC
C&B;AB;A 	 B;#A 	$B;B'B;'B+	+B;.B+	/B;6C;CCC)r@rArrC)r
r?rDr:r>s`   @rtest_clear_executing_generatorz(ClearTest.test_clear_executing_generator]sx						accII				rcfdfd}gd}g|d||g|d||dS)Nc~tjd}|j|jjz
dS)Nr)sys	_getframeappendf_linenor6co_firstlineno)r:liness rrecord_linez7ClearTest.test_lineno_with_tracing.<locals>.record_lineus6
a  ALLAH$;;<<<<<rcz|rdtjd_dS)NTr)rQrRf_trace)tracerWs rtestz0ClearTest.test_lineno_with_tracing.<locals>.testysBKMMM
0+/
a  (KMMMKMMMMMr)rrFT)assertEqual)r
r[expected_linesrVrWs   @@rtest_lineno_with_tracingz"ClearTest.test_lineno_with_tracingts	=	=	=	=	=					#U///T


/////rctj5Gdd}|}tj|}||}~|d|||j|d|ddddS#1swxYwYdS)NceZdZdS))ClearTest.test_clear_refcycles.<locals>.CNr"rrrr&rbsrr&r()	r
disable_gcr*r+rr-rr.r/r0s     rtest_clear_refcycleszClearTest.test_clear_refcycless

!
!		&		&







AQB**q*//CT2244(((''(9:::MM$%%%		&		&		&		&		&		&		&		&		&		&		&		&		&		&		&		&		&		&sBB::B>B>N)r)r#r$r%rrrr2r;rErKrNr_rcpython_onlyrdrrrrrs
"
"
",,, 			.000(
&&&&&rrc,eZdZdZdZdZdZdZdS)FrameAttrsTestcd}	|nE#t$r8}|j}g}|r#||j|j}|#Yd}~nd}~wwxYw|S)Nc*dd}fd}|S)Nrc dz}ddzd}dSNrr	rztrs  rrz8FrameAttrsTest.make_frames.<locals>.outer.<locals>.innerE!rryrrs  @rrz)FrameAttrsTest.make_frames.<locals>.outer3AA




577Nr)rr.rSrr)r
rrrframess     rmake_frameszFrameAttrsTest.make_framess				 EGGGG 	 	 	 BF
 

bk***Z
 	 
s

A.A

Ac|\}}}|j}||dtj||ddd|j}||ddddS)Nrrrj)rrt)rrp)rwr7assertIsInstancepoptypesFunctionTyper])r
r:rrouter_localsinner_localss      rtest_localszFrameAttrsTest.test_localss**,,5%~l..w779KLLLQQ'7'7888~QQ'7'788888rc|\}}}||||ji||jidSr)rwrr]r7r
r:rrs    rr2z FrameAttrsTest.test_clear_localssi**,,5%







,,,,,,,,rc|\}}}|j|j||||ji||jidSr)rwr7rr]rs    rtest_locals_clear_localsz'FrameAttrsTest.test_locals_clear_localssw**,,5%









,,,,,,,,rc|\}}}|t5|`ddddS#1swxYwYdSr)rwrHAttributeErrorrT)r
r:_s   rtest_f_lineno_del_segfaultz)FrameAttrsTest.test_f_lineno_del_segfaults""$$1a


~
.
.		
																		sAA
AN)r#r$r%rwrr2rrrrrrgrgs_&999------rrgceZdZ	dZdS)ReprTestcJd}|jj}	||dnE#t$r8}|j}g}|r#||j|j}|#Yd}~nd}~wwxYw|\}}}tj	tt}	|t|d|	|dzfz|t|d|	|dzfz|t|d|	|dzfzdS)	Nc*dd}fd}|S)Nrrjc dz}ddzd}dSrlrros  rrz0ReprTest.test_repr.<locals>.outer.<locals>.innerrrrrrss  @rrz!ReprTest.test_repr.<locals>.outerrurzshould have raisedz=^<frame at 0x[0-9a-fA-F]+, file %s, line %d, code test_repr>$z9^<frame at 0x[0-9a-fA-F]+, file %s, line %d, code outer>$ryz9^<frame at 0x[0-9a-fA-F]+, file %s, line %d, code inner>$r)
__code__rUfailrr.rSrrreescaperepr__file__assertRegex)
r
roffsetrrrvf_thisf_outerf_inner	file_reprs
          r	test_reprzReprTest.test_reprsq			.		,EGGG
II*++++!	 	 	 BF
 

bk***Z
 	 $* Id8nn--	fY%v{34	5	5	5	
gU%vz23	4	4	4	
gU%vz23	4	4	4	4	4s
1
A3.A..A3N)r#r$r%rrrrrrs( 4 4 4 4 4rrc~eZdZdZejdZejejdZ	dS)TestIncompleteFrameAreInvisiblec`tjdtd}td|dS)Nz
            import gc

            gc.set_threshold(1,1,1)
            class GCHello:
                def __del__(self):
                    print("Destroyed from gc")

            def gen():
                yield

            fd = open(zy)
            l = [fd, GCHello()]
            l.append(l)
            del fd
            del l
            gen()
        z-c)textwrapdedentrr)r
codes  rtest_issue95818z/TestIncompleteFrameAreInvisible.test_issue95818sD     

$	t$$$$$rc|	d}	fdd}tj}tjdd}tj}t	j}	tj|}t|tjtj	dddt	j
|tjd	tjt||
|j	tj	||tjdd<t	j
||rtjdSdS#tj	||tjdd<t	j
||rtjwwxYw)NcdSrr)frameeventargs   rrZzGTestIncompleteFrameAreInvisible.test_sneaky_frame_object.<locals>.traces

rcx	tjjtjdSr)rQrRrJgc	callbacksremove)phaseinfocallbacksneaky_frame_objects  rrzJTestIncompleteFrameAreInvisible.test_sneaky_frame_object.<locals>.callbacks5
#&-//"8L)))))rc3K	dVrrrrrr:zCTestIncompleteFrameAreInvisible.test_sneaky_frame_object.<locals>.fs

rrr)r
get_thresholdr	isenabledrQgettracedisabler@collect
set_thresholdsettracerSenabler/rB)
r
rZr:
old_threshold
old_callbacksold_enabled	old_tracer?rrs
        @@rtest_sneaky_frame_objectz8TestIncompleteFrameAreInvisible.test_sneaky_frame_objects			
		*		*		*		*		*		*			(**
QQQ
lnnLNN	"	JLLLAGGG
JLLLQ1%%%
LL)))"&IKKKGGG
MM!*&9:::m,,+BLOL###
	


m,,+BLOL###
	
sCE00AF;cRGfddGfddtj}d|}|||0|j|jjj	.dSdS)NceZdZfdZdS)TTestIncompleteFrameAreInvisible.test_sneaky_frame_object_teardown.<locals>.SneakyDelc0	tjdSr)rQrR)r
rs r__del__z\TestIncompleteFrameAreInvisible.test_sneaky_frame_object_teardown.<locals>.SneakyDel.__del__Os'*moo###rN)r#r$r%r)rsr	SneakyDelrNs.	
6	
6	
6	
6	
6	
6	
6rrceZdZ	fdZdS)WTestIncompleteFrameAreInvisible.test_sneaky_frame_object_teardown.<locals>.SneakyThreadc	}dSrr)r
r+rs  rrunz[TestIncompleteFrameAreInvisible.test_sneaky_frame_object_teardown.<locals>.SneakyThread.runasDikkrN)r#r$r%r)rsrSneakyThreadrZs3

"
"
"
"
"
"
"rr)
	threadingThreadstartjoinassertIsNotNoner-r6rrrJ)r
rrqrrs   @@r!test_sneaky_frame_object_teardownzATestIncompleteFrameAreInvisible.test_sneaky_frame_object_teardownJs
	6
	6
	6
	6
	6
	6
	6
	6
	6
	6		"		"		"		"		"		"		"9+		"		"		"#LNN						
0111!-#*L,<,E


#6"<	"-----rN)
r#r$r%rrrerrrequires_working_threadingrrrrrrsy%%%,
<<<|
0022%=%=32%=%=%=rr__main__)rrrQrrr|unittestr*r[rtest.supportrtest.support.script_helperrTestCaserrgrrr#mainrrr<module>rst								



))))))777777E&E&E&E&E&!E&E&E&P22222X&222j%4%4%4%4%4x %4%4%4N~=~=~=~=~=h&7~=~=~=@zHMOOOOOr