python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_py_compile.cpython-311.pyc

e/ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZmZdZdZGddee
jZGdd	ZGd
dee
jed
ZGddee
jed
ZGdde
jZedkre
jdSdS)N)support)	os_helper
script_helpercFtjfd}|S)z+Runs function with SOURCE_DATE_EPOCH unset.ctj5}|d|i|cdddS#1swxYwYdS)NSOURCE_DATE_EPOCH)rEnvironmentVarGuardunsetargskwargsenvfxns   H/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_py_compile.pywrapperz*without_source_date_epoch.<locals>.wrappers

*
,
,	(II)***3'''	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(s?AA	functoolswrapsrrs` rwithout_source_date_epochr8_S(((((NcFtjfd}|S)z)Runs function with SOURCE_DATE_EPOCH set.cxtj5}d|d<|i|cdddS#1swxYwYdS)N	123456789r)rr	rs   rrz'with_source_date_epoch.<locals>.wrappers

*
,
,	('2C#$3'''	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(s
/33rrs` rwith_source_date_epochrrrceZdZfdZxZS)SourceDateEpochTestMetac"t||||}t|D]Y}|drBt	||}|rt|}nt
|}t|||Z|S)Ntest_)super__new__dir
startswithgetattrrrsetattr)
mclsnamebasesdctsource_date_epochclsattrmethr	__class__s
         rr"zSourceDateEpochTestMeta.__new__&sggoodD%55HH	,	,Dw''
,sD))$>4T::GG7==GT7+++
r)__name__
__module____qualname__r"
__classcell__)r/s@rrr%s8rrceZdZdZdZdZdZeje	j
e	jpe	j

e	jddZdZdZd	Zejeje	jd
kdejdZd
ZdZejejjdkddZdZdZdZdS)PyCompileTestsBasectjtj|_tj|jd|_|jdz|_tj
|j|_tj
tjd|_tj
|jd}|rtj|t!|jd5}|dddddS#1swxYwYdS)N)r#_test.pycrwx = 123
)tempfilemkdtemposgetcwd	directorypathjoinsource_pathpyc_path	importlibutilcache_from_source
cache_path
splitdrive	cwd_drivechdiropenwrite)selfdrivefiles   rsetUpzPyCompileTestsBase.setUp7s<!)bikk:::7<<
CC(3.
#.::4;KLL++BIKK88;
""4#344Q7	HUOOO
$"C
(
(	$DJJ{###	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$sEEEc|tj|j|jrt	j|jdSdSN)shutilrmtreer?rIr=rJrMs rtearDownzPyCompileTestsBase.tearDownGs@
dn%%%>	%HT^$$$$$	%	%rc tj|j|j|t
j|j|t
j|j	dSrR)

py_compilecompilerBrC
assertTruer=r@existsassertFalserGrUs rtest_absolute_pathz%PyCompileTestsBase.test_absolute_pathLsf4+T];;;t}556668899999rc	tj|jdz|jtj|jsJ|t5tj|j	|jddddS#1swxYwYdS#ttf$r|dYdSwxYw)Nz.actualz.need to be able to create a symlink for a file)
r=symlinkrCr@islinkassertRaisesFileExistsErrorrXrYrBNotImplementedErrorOSErrorskipTestrUs rtest_do_not_overwrite_symlinksz1PyCompileTestsBase.test_do_not_overwrite_symlinksQs'	DJt}y0$-@@@7>>$-00000""?33
D
D"4#3T]CCC
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D	$W-	L	L	LMMJKKKKKK	Ls#"B$ BBB&CCz7requires os.devnull and for it to be a non-regular filec|t5tj|jt
jddddS#1swxYwYdSrR)rarbrXrYrBr=devnullrUs r&test_do_not_overwrite_nonregular_filesz9PyCompileTestsBase.test_do_not_overwrite_nonregular_files]s



/
/	=	=t/<<<	=	=	=	=	=	=	=	=	=	=	=	=	=	=	=	=	=	=s%A

AActj|j|tj|jdSrR)rXrYrBrZr=r@r[rGrUs rtest_cache_pathz"PyCompileTestsBase.test_cache_pathes>4+,,,t7788888rctj|j5tjt
j|jt
j|j	dddn#1swxYwY|
t
j|j	|t
j|j
dSrR)r
change_cwdr?rXrYr=r@basenamerBrCrZr[r\rGrUs rtest_cwdzPyCompileTestsBase.test_cwdis

!$.
1
1	@	@rw//0@AA!w//
>>
@
@
@	@	@	@	@	@	@	@	@	@	@	@	@	@	@	@	
t}556668899999sABBBctjtj|jtj|j|tj|j|	tj|j
dSrR)rXrYr=r@relpathrBrCrZr[r\rGrUs rtest_relative_pathz%PyCompileTestsBase.test_relative_pathps27??4+;<<7??4=99	;	;	;t}556668899999rntz/cannot control directory permissions on Windowsctj|j}tj|jtj	|t5tj|j	|j
dddn#1swxYwYtj|j|jdS#tj|j|jwxYwrR)r=statr?chmodS_IREADraIOErrorrXrYrBrCst_mode)rMmodes  rtest_exceptions_propagatez,PyCompileTestsBase.test_exceptions_propagatevswt~&&
...	3""7++
D
D"4#3T]CCC
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
HT^T\22222BHT^T\2222s/B1 B9B1B		B1B	
B11!Cctjtjtdd}tj5|tj	|ddddn#1swxYwY|
tjtj
|dS)Ntokenizedatabad_coding2.pyF)doraise)r=r@rAdirname__file__rcaptured_stderrassertIsNonerXrYr\r[rDrErF)rM
bad_codings  rtest_bad_codingz"PyCompileTestsBase.test_bad_codingsW\\"'//(";";"0"244

$
&
&	M	Mj0UKKKLLL	M	M	M	M	M	M	M	M	M	M	M	M	M	M	MN,,Z88::	;	;	;	;	;s*B

BBcTtj|j|j|t
j|j|t
j|j	t|jd5}tj
|di}dddn#1swxYwYt
jdrd}nd}|||dS)Nrbtestrr)rXrYrBrCrZr=r@r[r\rGrKrD_bootstrap_external
_classify_pycreadenvirongetassertEqual)rMfpflagsexpected_flagss    rtest_source_date_epochz)PyCompileTestsBase.test_source_date_epochs,4+T];;;t}5566688999
$-
&
&	'"1??		62''E	'	'	'	'	'	'	'	'	'	'	'	'	'	'	':>>-..	"!NN!N/////s#4C##C'*C'rztest does not work with -Oc	ltj|jd}tj|}|dz}tj|\}}tj|}|	tj||tjdd
tjj
t|d5}|ddddn#1swxYwYt!j||tj||tj|dS)Nz
foo.bar.pyr8__pycache__zfoo.bar.{}.pycr9r:)r=r@rAr?rDrErFsplitrnrformatsysimplementation	cache_tagrKrLrXrYrZr[r\)rM
weird_pathrGrCheadtailpenultimate_tailrOs        rtest_double_dot_no_clobberz-PyCompileTestsBase.test_double_dot_no_clobbersW\\$.,??
^55jAA
#W]]:..
d7++D11GLL)400GLL ''(:(DEE
G
G	H	H	H
*c
"
"	$dJJ{###	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$:&&&z223331122222sD11D58D5cd|dtj|jddS)Nzopt-2)optimize)assertInrXrYrBrUs rtest_optimization_pathz)PyCompileTestsBase.test_optimization_paths/

gz1$2BQOOOPPPPPrctj|jtjjt|jd5}tj	|
di}dddn#1swxYwY||dtj|jtjjt|jd5}tj	|
di}dddn#1swxYwY||ddS)N)invalidation_moderrr)
rXrYrBPycInvalidationModeCHECKED_HASHrKrGrDrrrrUNCHECKED_HASH)rMrrs   rtest_invalidation_modez)PyCompileTestsBase.test_invalidation_modes(<I	
	
	
	
$/4
(
(	'B1??		62''E	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'	
%%%(<K	
	
	
	
$/4
(
(	'B1??		62''E	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'	
$$$$$s$4BBB 4D  D$'D$cxtjtjtdd}tj5}|tj	|dd|tj	|dd|
|d|tj
5tj	|dddddn#1swxYwYddddS#1swxYwYdS)	Nr}r~Fr)rquietTr)r=r@rArrrrrrXrYrgetvalueraPyCompileError)rMrstderrs   r
test_quietzPyCompileTestsBase.test_quietsW\\"'//(";";"0"244

$
&
&	F&j0URSTTTUUUj0TQRSSSTTTV__..333"":#<==
F
F":t1EEEE
F
F
F
F
F
F
F
F
F
F
F
F
F
F
F		F	F	F	F	F	F	F	F	F	F	F	F	F	F	F	F	F	Fs7BD/3DD/D	D/D	D//D36D3N) r0r1r2rPrVr]rfunittestskipIfr=r@r[rhisfilerirkrorrrskip_if_dac_overrider(skip_unless_working_chmodr{rrrrrrrrrrrr5r55s$$$ %%%
:::

D
D
DX_
333Qrw~~bj7Q7QNPP==PP=999::::::#X_RW_FHH(
3
3)(HH$#
3;;;000X_SY'!+-IJJ33KJ3&QQQ%%%$	F	F	F	F	Frr5ceZdZdS)PyCompileTestsWithSourceEpochNr0r1r2rrrrr	DrrT)	metaclassr+ceZdZdS) PyCompileTestsWithoutSourceEpochNrrrrrrrrrFcteZdZdZdZejdZdZdZ	dZ
dZdZd	Z
d
ZdS)PyCompileCLITestCasecbtj|_tj|jd|_tj	|j|_
t|jd5}|dddddS#1swxYwYdS)Nr7r9r:)
r;r<r?r=r@rArBrDrErFrGrKrL)rMrOs  rrPzPyCompileCLITestCase.setUps!)++7<<
CC#.::4;KLL
$"C
(
(	$DJJ{###	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$sB$$B(+B(c8tj|jdSrR)rrTr?rUs rrVzPyCompileCLITestCase.tearDowns(((((rc|rM|ddkrAd|vr=tjtjdddg|ddStjddg|Ri|S)Nr-input-mrXT)rcapture_output)
subprocessrunr
executableencoderassert_python_ok)rMrr
s   rpycompilecmdz!PyCompileCLITestCase.pycompilecmds
	7DGsNNw&'8'8>3>4s"K(.w(>(>(@(@15777
7-dLR4RRR6RRRrc(tjddg|RS)NrrX)rassert_python_failure)rMrs  rpycompilecmd_failurez)PyCompileCLITestCase.pycompilecmd_failures24MMMMMrcN|d|j}||jd||jd||jd|tj	|j
dS)Nr)rrr)rrBr
returncodestdoutrrZr=r@r[rG)rMresults  r
test_stdinzPyCompileCLITestCase.test_stdins""3d.>"??*A...,,,,,,t7788888rc@||j|j\}}}||d||d||d|tj|jdS)Nrr)rrBrrZr=r@r[rG)rMrcrrs    rtest_with_filesz$PyCompileCLITestCase.test_with_filess!..t/?AQRRFFQ%%%%%%t7788888rcBtjtjtdd}||\}}}||d||d|d|dS)Nr}badsyntax_3131.pyrrsSyntaxError)r=r@rArrrrrrM
bad_syntaxrrrs     rtest_bad_syntaxz$PyCompileCLITestCase.test_bad_syntax	sW\\"'//(";";"0"577
"66zBBFFQ%%%

nf-----rcDtjtjtdd}|d|\}}}||d||d||ddS)Nr}r-qrr)r=r@rArrrrrs     rtest_bad_syntax_with_quietz/PyCompileCLITestCase.test_bad_syntax_with_quietsW\\"'//(";";"0"577
"66tZHHFFQ%%%%%%%%rcptjtjtd}||j|\}}}||d||d|d|	dS)Nshould_not_exists.pyrrsno such file or directory)
r=r@rArrrrBrrlowerrMshould_not_existsrrrs     rtest_file_not_existsz)PyCompileCLITestCase.test_file_not_existssGLL)B)BDZ[[!66t7GIZ[[FFQ%%%

2FLLNNCCCCCrcNtjtjtd}|d|j|\}}}||d||d||ddS)Nrrrr)r=r@rArrrrBrrs     rtest_file_not_exists_with_quietz4PyCompileCLITestCase.test_file_not_exists_with_quiet"sGLL)B)BDZ[[!66tT=MO`aaFFQ%%%%%%%%rN)r0r1r2rPrVrrequires_subprocessrrrrrrrrrrrrrs$$$)))!W ""SS#"SNNN999999...&&&DDD&&&&&rr__main__)rimportlib.utilrDr=rXrSrurrr;rrrtest.supportrrrrtypeTestCaserr5rrrr0mainrrr<module>rs				







11111111




dd8#455


 [F[F[F[F[F[F[F[F|					$6$,$5.E6:									'9'/'81H9>				F&F&F&F&F&8,F&F&F&RzHMOOOOOr