python (3.11.7)

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

e/ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZmZdZdZGddee
jZGdd	ZGd
dee
jed
ZGddee
jed
ZGdde
jZedkre
jdSdS)N)support)	os_helper
script_helpercH	tjfd}|S)Nctj5}|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_epochrs;5_S(((((NcH	tjfd}|S)Ncxtj5}d|d<|i|cdddS#1swxYwYdS)N	123456789r)rr	rs   rrz'with_source_date_epoch.<locals>.wrappers

*
,
,	('2C#$3'''	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(s
/33rrs` rwith_source_date_epochrs;3_S(((((NrceZdZfdZxZS)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>rHr<rIrLs rtearDownzPyCompileTestsBase.tearDownGs@
dn%%%>	%HT^$$$$$	%	%rc tj|j|j|t
j|j|t
j|j	dSrQ)

py_compilecompilerArB
assertTruer<r?existsassertFalserFrTs rtest_absolute_pathz%PyCompileTestsBase.test_absolute_pathLsf4+T];;;t}556668899999rcJ	tj|jdz|j|t5tj|j|jddddS#1swxYwYdS#ttf$r|
dYdSwxYw)Nz.actualz.need to be able to create a symlink for a file)r<symlinkrBassertRaisesFileExistsErrorrWrXrANotImplementedErrorOSErrorskipTestrTs rtest_do_not_overwrite_symlinksz1PyCompileTestsBase.test_do_not_overwrite_symlinksQs	DJt}y0$-@@@
""?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""A8 A++A/2A/8&B"!B"z7requires os.devnull and for it to be a non-regular filec|t5tj|jt
jddddS#1swxYwYdSrQ)r_r`rWrXrAr<devnullrTs r&test_do_not_overwrite_nonregular_filesz9PyCompileTestsBase.test_do_not_overwrite_nonregular_files]s



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

AActj|j|tj|jdSrQ)rWrXrArYr<r?rZrFrTs rtest_cache_pathz"PyCompileTestsBase.test_cache_pathes>4+,,,t7788888rctj|j5tjt
j|jt
j|j	dddn#1swxYwY|
t
j|j	|t
j|j
dSrQ)r
change_cwdr>rWrXr<r?basenamerArBrYrZr[rFrTs rtest_cwdzPyCompileTestsBase.test_cwdis

!$.
1
1	@	@rw//0@AA!w//
>>
@
@
@	@	@	@	@	@	@	@	@	@	@	@	@	@	@	@	
t}556668899999sABBBctjtj|jtj|j|tj|j|	tj|j
dSrQ)rWrXr<r?relpathrArBrYrZr[rFrTs 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|jwxYwrQ)r<statr>chmodS_IREADr_IOErrorrWrXrArBst_mode)rLmodes  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?r@dirname__file__rcaptured_stderrassertIsNonerWrXr[rZrCrDrE)rL
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)rWrXrArBrYr<r?rZr[rFrJrC_bootstrap_external
_classify_pycreadenvirongetassertEqual)rLfpflagsexpected_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.pyr7__pycache__zfoo.bar.{}.pycr8r9)r<r?r@r>rCrDrEsplitrlrformatsysimplementation	cache_tagrJrKrWrXrYrZr[)rL
weird_pathrFrBheadtailpenultimate_tailrNs        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)assertInrWrXrArTs 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)
rWrXrAPycInvalidationModeCHECKED_HASHrJrFrCrrrrUNCHECKED_HASH)rLrrs   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)r}quietTr)r<r?r@r~rrrrrWrXrgetvaluer_PyCompileError)rLrstderrs   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) r/r0r1rOrUr\rdunittestskipIfr<r?rZrfisfilergrirmrprskip_if_dac_overrider'skip_unless_working_chmodryrrrrrrrrrrrr4r45s$$$ %%%
:::

D
D
DX_
333Qrw~~bj7Q7QNPP==PP=999::::::#X_RW_FHH(
3
3)(HH$#
3;;;000X_SY'!+-IJJ33KJ3&QQQ%%%$	F	F	F	F	Frr4ceZdZdS)PyCompileTestsWithSourceEpochNr/r0r1rrrrr	DrrT)	metaclassr*ceZdZdS) PyCompileTestsWithoutSourceEpochNrrrrrrrrrFcteZdZdZdZejdZdZdZ	dZ
dZdZd	Z
d
ZdS)PyCompileCLITestCasecbtj|_tj|jd|_tj	|j|_
t|jd5}|dddddS#1swxYwYdS)Nr6r8r9)
r:r;r>r<r?r@rArCrDrErFrJrK)rLrNs  rrOzPyCompileCLITestCase.setUps!)++7<<
CC#.::4;KLL
$"C
(
(	$DJJ{###	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$sB$$B(+B(c8tj|jdSrQ)rrSr>rTs rrUzPyCompileCLITestCase.tearDowns(((((rc|rM|ddkrAd|vr=tjtjdddg|ddStjddg|Ri|S)Nr-input-mrWT)rcapture_output)
subprocessrunr
executableencoderassert_python_ok)rLrr
s   rpycompilecmdz!PyCompileCLITestCase.pycompilecmds
	7DGsNNw&'8'8>3>4s"K(.w(>(>(@(@15777
7-dLR4RRR6RRRrc(tjddg|RS)NrrW)rassert_python_failure)rLrs  rpycompilecmd_failurez)PyCompileCLITestCase.pycompilecmd_failures24MMMMMrcN|d|j}||jd||jd||jd|tj	|j
dS)Nr)rrr)rrAr
returncodestdoutrrYr<r?rZrF)rLresults  r
test_stdinzPyCompileCLITestCase.test_stdins""3d.>"??*A...,,,,,,t7788888rc@||j|j\}}}||d||d||d|tj|jdS)Nrr)rrArrYr<r?rZrF)rLrcrrs    rtest_with_filesz$PyCompileCLITestCase.test_with_filess!..t/?AQRRFFQ%%%%%%t7788888rcBtjtjtdd}||\}}}||d||d|d|dS)Nr{badsyntax_3131.pyrrsSyntaxError)r<r?r@r~rrrrrL
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?r@r~rrrrs     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?r@r~rrrArrlowerrLshould_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?r@r~rrrArrs     rtest_file_not_exists_with_quietz4PyCompileCLITestCase.test_file_not_exists_with_quiet"sGLL)B)BDZ[[!66tT=MO`aaFFQ%%%%%%%%rN)r/r0r1rOrUrrequires_subprocessrrrrrrrrrrrrrs$$$)))!W ""SS#"SNNN999999...&&&DDD&&&&&rr__main__)rimportlib.utilrCr<rWrRrsrrr:rrrtest.supportrrrrtypeTestCaserr4rrrr/mainrrr<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