+
    Bi/              	          ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIHt ^ RIHtHt R tR t ! R R]! ]
P&                  4      4      t ! R R	4      t ! R
 R]]
P&                  ]RR7      t ! R R]]
P&                  ]RR7      t ! R R]
P&                  4      t]R8X  d   ]
P4                  ! 4        R# R# )    N)support)	os_helperscript_helperc                 F   a  \         P                  ! S 4      V 3R  l4       pV# )c                     < \         P                  ! 4       ;_uu_ 4       pVP                  R 4       S! V / VB uuRRR4       #   + '       g   i     R# ; i)SOURCE_DATE_EPOCHN)r   EnvironmentVarGuardunsetargskwargsenvfxns   *, +/usr/lib/python3.14/test/test_py_compile.pywrapper*without_source_date_epoch.<locals>.wrapper   s=    **,,II)*'' -,,,s   AA		functoolswrapsr   r   s   f r   without_source_date_epochr      %    __S( ( N    c                 F   a  \         P                  ! S 4      V 3R  l4       pV# )c                     < \         P                  ! 4       ;_uu_ 4       pR VR&   S! V / VB uuRRR4       #   + '       g   i     R# ; i)	123456789r   N)r   r	   r   s   *, r   r   'with_source_date_epoch.<locals>.wrapper   s;    **,,'2C#$'' -,,,s	   7A	r   r   s   f r   with_source_date_epochr      r   r   c                   2   a a ] tR t^%t oV 3R ltRtVtV ;t# )SourceDateEpochTestMetac                  < \         S	V `  WW#4      p\        V4       FR  pVP                  R 4      '       g   K  \	        WV4      pV'       d   \        V4      pM\        V4      p\        WVV4       KT  	  V# )test_)super__new__dir
startswithgetattrr   r   setattr)
mclsnamebasesdctsource_date_epochclsattrmethr   	__class__s
   &&&&$    r   r$   SourceDateEpochTestMeta.__new__&   sb    god%5HDw''s)$4T:G7=G7+  
r    )__name__
__module____qualname____firstlineno__r$   __static_attributes____classdictcell____classcell__)r1   __classdict__s   @@r   r    r    %   s      r   r    c                   ,  a  ] tR t^5t o R tR tR tR t]P                  ! ]
P                  P                  ]
P                  4      '       * ;'       g&    ]
P                  P                  ]
P                  4      R4      R 4       tR tR tR	 t]P(                  ]P                  ! ]
P*                  R
8H  R4      ]P,                  R 4       4       4       tR tR t]P                  ! ]P6                  P8                  ^ 8  R4      R 4       tR tR tR t Rt!V t"R# )PyCompileTestsBasec                   \         P                  ! \        P                  ! 4       R 7      V n        \        P
                  P                  V P                  R4      V n        V P                  R,           V n        \        P                  P                  V P                  4      V n        \        P
                  P                  \        P                  ! 4       4      ^ ,          V n        \        P
                  P                  V P                  4      ^ ,          pV'       d   \        P                  ! V4       \!        V P                  R4      ;_uu_ 4       pVP#                  R4       RRR4       R#   + '       g   i     R# ; i))r%   _test.pycwx = 123
N)tempfilemkdtemposgetcwd	directorypathjoinsource_pathpyc_path	importlibutilcache_from_source
cache_path
splitdrive	cwd_drivechdiropenwrite)selfdrivefiles   &  r   setUpPyCompileTestsBase.setUp7   s    !))biik:77<<
C((3.#..::4;K;KL++BIIK8;
 ""4#3#34Q7HHUO$""C((DJJ{# )(((s   E++E<	c                    \         P                  ! V P                  4       V P                  '       d#   \        P
                  ! V P                  4       R # R # N)shutilrmtreerG   rQ   rE   rR   rU   s   &r   tearDownPyCompileTestsBase.tearDownG   s0    dnn%>>>HHT^^$ r   c                <   \         P                  ! V P                  V P                  4       V P	                  \
        P                  P                  V P                  4      4       V P                  \
        P                  P                  V P                  4      4       R # r[   )

py_compilecompilerJ   rK   
assertTruerE   rH   existsassertFalserO   r^   s   &r   test_absolute_path%PyCompileTestsBase.test_absolute_pathL   sX    4++T]];t}}5689r   c                    \         P                  ! V P                  R ,           V P                  4       V P                  \        4      ;_uu_ 4        \
        P                  ! V P                  V P                  4       RRR4       R#   + '       g   i     R# ; i  \        \        3 d    T P                  R4        R# i ; i)z.actualNz.need to be able to create a symlink for a file)rE   symlinkrK   assertRaisesFileExistsErrorrb   rc   rJ   NotImplementedErrorOSErrorskipTestr^   s   &r   test_do_not_overwrite_symlinks1PyCompileTestsBase.test_do_not_overwrite_symlinksQ   s    	DJJt}}y0$--@
 ""?33""4#3#3T]]C 4333	 $W- 	LMMJK	Ls   2B ,BB	"C Cz7requires os.devnull and for it to be a non-regular filec                    V P                  \        4      ;_uu_ 4        \        P                  ! V P                  \
        P                  4       R R R 4       R #   + '       g   i     R # ; ir[   )rk   rl   rb   rc   rJ   rE   devnullr^   s   &r   &test_do_not_overwrite_nonregular_files9PyCompileTestsBase.test_do_not_overwrite_nonregular_files]   s>    
 //t//< 0///s   0AA)	c                    \         P                  ! V P                  4       V P                  \        P
                  P                  V P                  4      4       R # r[   )rb   rc   rJ   rd   rE   rH   re   rO   r^   s   &r   test_cache_path"PyCompileTestsBase.test_cache_pathe   s3    4++,t78r   c                8   \         P                  ! V P                  4      ;_uu_ 4        \        P                  ! \
        P                  P                  V P                  4      \
        P                  P                  V P                  4      4       R R R 4       V P                  \
        P                  P                  V P                  4      4       V P                  \
        P                  P                  V P                  4      4       R #   + '       g   i     L; ir[   )r   
change_cwdrG   rb   rc   rE   rH   basenamerJ   rK   rd   re   rf   rO   r^   s   &r   test_cwdPyCompileTestsBase.test_cwdi   s    !!$..11rww//0@0@A!ww//>@ 2 	t}}5689	 21s   A&D		D	c                   \         P                  ! \        P                  P	                  V P
                  4      \        P                  P	                  V P                  4      4       V P                  \        P                  P                  V P                  4      4       V P                  \        P                  P                  V P                  4      4       R # r[   )rb   rc   rE   rH   relpathrJ   rK   rd   re   rf   rO   r^   s   &r   test_relative_path%PyCompileTestsBase.test_relative_pathp   su    277??4+;+;<77??4==9	;t}}5689r   ntz/cannot control directory permissions on Windowsc                $   \         P                  ! V P                  4      p\         P                  ! V P                  \        P                  4        V P                  \        4      ;_uu_ 4        \        P                  ! V P                  V P                  4       R R R 4       \         P                  ! V P                  VP                  4       R #   + '       g   i     L=; i  \         P                  ! T P                  TP                  4       i ; ir[   )rE   statrG   chmodS_IREADrk   IOErrorrb   rc   rJ   rK   st_mode)rU   modes   & r   test_exceptions_propagate,PyCompileTestsBase.test_exceptions_propagatev   s     wwt~~&
.	3""7++""4#3#3T]]C , HHT^^T\\2 ,+ HHT^^T\\2s$   C" .,CC" C	C" "-Dc           	        \         P                  P                  \         P                  P                  \        4      R R4      p\
        P                  ! 4       ;_uu_ 4        V P                  \        P                  ! VRR7      4       RRR4       V P                  \         P                  P                  \        P                  P                  V4      4      4       R#   + '       g   i     L]; i)tokenizedatabad_coding2.pyF)doraiseN)rE   rH   rI   dirname__file__r   captured_stderrassertIsNonerb   rc   rf   re   rL   rM   rN   )rU   
bad_codings   & r   test_bad_coding"PyCompileTestsBase.test_bad_coding   s    WW\\"''//(";"0"24
 $$&&j00UKL 'NN,,Z8: 	; '&s    (CC-	c                   \         P                  ! V P                  V P                  4       V P	                  \
        P                  P                  V P                  4      4       V P                  \
        P                  P                  V P                  4      4       \        V P                  R 4      ;_uu_ 4       p\        P                  P                  VP                  4       R/ 4      pRRR4       \
        P                  P!                  R4      '       d   ^pM^ pV P#                  XV4       R#   + '       g   i     LN; i)rbtestNr   )rb   rc   rJ   rK   rd   rE   rH   re   rf   rO   rS   rL   _bootstrap_external_classify_pycreadenvirongetassertEqual)rU   fpflagsexpected_flagss   &   r   test_source_date_epoch)PyCompileTestsBase.test_source_date_epoch   s    4++T]];t}}5689$--&&"11??	62'E ' ::>>-..!N!N/ '&s   :0D00E 	ztest does not work with -Oc           	     x   \         P                  P                  V P                  R 4      p\        P
                  P                  V4      pVR,           p\         P                  P                  V4      w  rE\         P                  P                  V4      pV P                  \         P                  P                  We4      \         P                  P                  RRP                  \        P                  P                  4      4      4       \        VR4      ;_uu_ 4       pVP                  R4       RRR4       \         P"                  ! V4       V P%                  \         P                  P'                  V4      4       V P)                  \         P                  P'                  V4      4       R#   + '       g   i     L; i)z
foo.bar.pyr@   __pycache__zfoo.bar.{}.pycrA   rB   N)rE   rH   rI   rG   rL   rM   rN   splitr{   r   formatsysimplementation	cache_tagrS   rT   rb   rc   rd   re   rf   )rU   
weird_pathrO   rK   headtailpenultimate_tailrW   s   &       r   test_double_dot_no_clobber-PyCompileTestsBase.test_double_dot_no_clobber   s    WW\\$..,?
^^55jA
#WW]]:.
77++D1GGLL)0GGLL ''(:(:(D(DEG	H
 *c""dJJ{# #:&z2312	 #"s   F))F9	c                j    V P                  R \        P                  ! V P                  ^R7      4       R# )zopt-2)optimizeN)assertInrb   rc   rJ   r^   s   &r   test_optimization_path)PyCompileTestsBase.test_optimization_path   s#    gz11$2B2BQOPr   c                   \         P                  ! V P                  \         P                  P                  R 7       \        V P                  R4      ;_uu_ 4       p\        P                  P                  VP                  4       R/ 4      pRRR4       V P                  X^4       \         P                  ! V P                  \         P                  P                  R 7       \        V P                  R4      ;_uu_ 4       p\        P                  P                  VP                  4       R/ 4      pRRR4       V P                  V^4       R#   + '       g   i     L; i  + '       g   i     L7; i))invalidation_moder   r   N)rb   rc   rJ   PycInvalidationModeCHECKED_HASHrS   rO   rL   r   r   r   r   UNCHECKED_HASH)rU   r   r   s   &  r   test_invalidation_mode)PyCompileTestsBase.test_invalidation_mode   s    (<<II	
 $//4((B11??	62'E ) 	%(<<KK	
 $//4((B11??	62'E ) 	$ )( )(s   0E;0EE	E*	c           
        \         P                  P                  \         P                  P                  \        4      R R4      p\
        P                  ! 4       ;_uu_ 4       pV P                  \        P                  ! VR^R7      4       V P                  \        P                  ! VR^R7      4       V P                  VP                  4       R4       V P                  \        P                  4      ;_uu_ 4        \        P                  ! VR^R7       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   r   F)r   quietT N)rE   rH   rI   r   r   r   r   r   rb   rc   r   getvaluerk   PyCompileError)rU   r   stderrs   &  r   
test_quietPyCompileTestsBase.test_quiet   s    WW\\"''//(";"0"24
 $$&&&j00URSTUj00TQRSTV__.3"":#<#<=="":t1E >	 '& >=	 '&&s%    BD78D$	D7$D4/D77E	)rO   rQ   rG   rK   rJ   N)#r4   r5   r6   r7   rX   r_   rg   rp   unittestskipIfrE   rH   re   rs   isfilert   rw   r|   r   r   skip_if_dac_overrider*   skip_unless_working_chmodr   r   r   r   r   r   r   r   r   r   r8   r9   r;   s   @r   r=   r=   5   s    $ %
:

D __

33QQrww~~bjj7QNP=P=9:: ##__RWW_FH((
3 )H $
3;0 __SYY''!+-IJ3 K3&Q%$	F 	Fr   r=   c                       ] tR t^tRtR# )PyCompileTestsWithSourceEpochr3   Nr4   r5   r6   r7   r8   r3   r   r   r   r           	r   r   T)	metaclassr-   c                       ] tR t^tRtR# ) PyCompileTestsWithoutSourceEpochr3   Nr   r3   r   r   r   r      r   r   r   Fc                      a  ] tR t^t o R tR t]P                  ! 4       R 4       tR t	R t
R tR tR tR	 tR
 tRtV tR# )PyCompileCLITestCasec                   \         P                  ! 4       V n        \        P                  P                  V P                  R 4      V n        \        P                  P                  V P                  ^R7      T n
        \        T P                  R4      ;_uu_ 4       pTP                  R4       RRR4       R#   + '       g   i     R# ; i)r?   )optimizationrA   rB   N)rC   rD   rG   rE   rH   rI   rJ   rL   rM   rN   rO   rS   rT   )rU   rW   s   & r   rX   PyCompileCLITestCase.setUp   s    !))+77<<
C#..::4;K;KBC ; E$""C((DJJ{# )(((s   B44C	c                F    \         P                  ! V P                  4       R # r[   )r   r]   rG   r^   s   &r   r_   PyCompileCLITestCase.tearDown   s    (r   c                    RpT'       dV   T^ ,          R8X  dH   RT9   dA   \         P                  ! \        P                  TRR.TR,          P	                  4       RR7      # \
        P                  ! TR.TO5/ TB # )Fz-Om-inputrb   T)r   capture_output)
subprocessrunr   
executableencoder   assert_python_ok)rU   r   r   optss   &*, r   pycompilecmd!PyCompileCLITestCase.pycompilecmd   so    
 ',DGsNw&'8>>3>>4s"K(.w(>(>(@157 7 --dLR4R6RRr   c                4    \         P                  ! R R.VO5!  # )z-mrb   )r   assert_python_failure)rU   r   s   &*r   pycompilecmd_failure)PyCompileCLITestCase.pycompilecmd_failure   s    224MMMr   c                   V P                  \        P                  P                  V P                  4      4       V P                  R V P                  R7      pV P                  VP                  ^ 4       V P                  VP                  R4       V P                  VP                  R4       V P                  \        P                  P                  V P                  4      4       R# )r   )r   r   N)rf   rE   rH   re   rO   r   rJ   r   
returncodestdoutr   rd   )rU   results   & r   
test_stdinPyCompileCLITestCase.test_stdin   s    89""3d.>.>"?**A.,,t78r   c                4   V P                  V P                  V P                  4      w  rpV P                  V^ 4       V P                  VR4       V P                  VR4       V P                  \        P
                  P                  V P                  4      4       R# )r   r   N)r   rJ   r   rd   rE   rH   re   rO   )rU   rcr   r   s   &   r   test_with_files$PyCompileCLITestCase.test_with_files  sr    !..t/?/?AQAQRFQ%%t78r   c                   \         P                  P                  \         P                  P                  \        4      R R4      pV P                  V4      w  r#pV P                  V^4       V P                  VR4       V P                  RV4       R# )r   badsyntax_3131.pyr   s   SyntaxErrorN)rE   rH   rI   r   r   r   r   r   rU   
bad_syntaxr   r   r   s   &    r   test_bad_syntax$PyCompileCLITestCase.test_bad_syntax  sn    WW\\"''//(";"0"57
 "66zBFQ%nf-r   c                    \         P                  P                  \         P                  P                  \        4      R R4      pV P                  RV4      w  r#pV P                  V^4       V P                  VR4       V P                  VR4       R# )r   r   -qr   N)rE   rH   rI   r   r   r   r   r   s   &    r   test_bad_syntax_with_quiet/PyCompileCLITestCase.test_bad_syntax_with_quiet  sr    WW\\"''//(";"0"57
 "66tZHFQ%%r   c                N   \         P                  P                  \         P                  P                  \        4      R 4      pV P                  V P                  V4      w  r#pV P                  V^4       V P                  VR4       V P                  RVP                  4       4       R# )should_not_exists.pyr   s   no such file or directoryN)
rE   rH   rI   r   r   r   rJ   r   r   lowerrU   should_not_existsr   r   r   s   &    r   test_file_not_exists)PyCompileCLITestCase.test_file_not_exists  sx    GGLL)BDZ[!66t7G7GIZ[FQ%2FLLNCr   c                4   \         P                  P                  \         P                  P                  \        4      R 4      pV P                  RV P                  V4      w  r#pV P                  V^4       V P                  VR4       V P                  VR4       R# )r   r   r   N)rE   rH   rI   r   r   r   rJ   r   r  s   &    r   test_file_not_exists_with_quiet4PyCompileCLITestCase.test_file_not_exists_with_quiet%  su    GGLL)BDZ[!66tT=M=MO`aFQ%%r   )rO   rG   rJ   N)r4   r5   r6   r7   rX   r_   r   requires_subprocessr   r   r   r   r   r   r  r  r8   r9   r   s   @r   r   r      sX     $)   "	S #	SN99.&D& &r   r   __main__)r   importlib.utilrL   rE   rb   r\   r   r   r   rC   r   r   r   test.supportr   r   r   r   typeTestCaser    r=   r   r   r   r4   mainr3   r   r   <module>r     s      	     
    1d8#4#45  [F [F|	$6$,$5$5.E6:		'9'/'8'81H9>	I&8,, I&X zMMO r   