+
    h::                       ^ RI H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t^ RIt^ RIHt ^ RIHtHtHt ^ RIt^ RIHt ^ RIHt ]'       d   ^ RItMN]
P0                  P3                  R4      '       d   ^ RIHu Hu Hu Ht M]
P8                  ]P>                  ,          t] t!]'       d   ^ RI"H#t# . R!Ot$R"R lt%]PL                  R"R l4       t']PL                  R 4       t(]PL                  R 4       t)]PL                  R 4       t* ! R R]+4      t, ! R R4      t-]PL                  R 4       t.R t/]PL                  R 4       t0]PL                  R 4       t10 R#mt2R t3R t4R t5 ! R R	4      t6]7! ]R4      '       d   ]Pp                  .t9M. t9 ! R R
]64      t:]Pv                  ! ]Px                  RP{                  4        U u. uF  p ]>! ]V ^ 4      NK  	  up 4      t? ! R  R]4      t@R# u up i )$    )annotationsN)TracebackType)TYPE_CHECKINGAnyClassVar)working_set)DistutilsErrorjava)SelfAbstractSandboxDirectorySandboxSandboxViolationc                    Rp\        W4      ;_uu_ 4       pVP                  4       pRRR4       Vf   Tp\        XV R4      p\        WaV4       R#   + '       g   i     L1; i)z&
Python 3 implementation of execfile.
rbNexec)openreadcompiler   )filenameglobalslocalsmodestreamscriptcodes   &&&    4/usr/lib/python3/dist-packages/setuptools/sandbox.py	_execfiler   *   sQ     D	h		 
~68V,D 
	s   AA 	c              #     "   \         P                  R ,          pV e   V \         P                  R &    Vx  V\         P                  R &   R#   T\         P                  R &   i ; i5iNNNN)sysargv)replsaveds   & r   	save_argvr%   7   sI     HHQKEes   /A#A A#A  A#c               #     "   \         P                  R ,          p  V x  V \         P                  R &   R#   T \         P                  R &   i ; i5ir   )r!   pathr$   s    r   	save_pathr)   B   s6     HHQKEes   A4 AA		Ac              #     "   \         P                  ! V RR7       \        P                  pV \        n         Rx  V\        n        R#   T\        n        i ; i5i)zD
Monkey-patch tempfile.tempdir with replacement, ensuring it exists
T)exist_okN)osmakedirstempfiletempdir)replacementr$   s   & r   override_tempr1   K   s@     
 KKd+E"H! 5s   4AA AAAc              #     "   \         P                  ! 4       p\         P                  ! V 4        Vx  \         P                  ! V4       R #   \         P                  ! T4       i ; i5iN)r,   getcwdchdir)targetr$   s   & r   pushdr7   \   s<     IIKEHHV
s   ,A&A A&A##A&c                  *    ] tR t^ftRt]R 4       tRtR# )UnpickleableExceptionzH
An exception representing another Exception that could not be pickled.
c           	          \         P                  ! V 4      \         P                  ! V4      3#   \         d*    ^ RIHp TP                  Y"! \        T4      4      4      u # i ; i)zq
Always return a dumped (pickled) type and exc. If exc can't be pickled,
wrap it in UnpickleableException first.
)r9   )pickledumps	Exceptionsetuptools.sandboxr9   dumprepr)typeexcclss   && r   r?   UnpickleableException.dumpk   sO    	1<<%v||C'888 	1G88CT#Y00		1s   +. 1A"!A" N)__name__
__module____qualname____firstlineno____doc__staticmethodr?   __static_attributes__rE       r   r9   r9   f   s     1 1rM   r9   c                  8    ] tR t^ztRtR R ltR R ltR tRtR# )	ExceptionSaverzQ
A Context Manager that will save an exception, serialize, and restore it
later.
c                   V ^8  d   QhRR/# )   returnr   rE   )formats   "r   __annotate__ExceptionSaver.__annotate__   s      4 rM   c                	    V # r3   rE   selfs   &r   	__enter__ExceptionSaver.__enter__   s    rM   c               (    V ^8  d   QhRRRRRRRR/# )	rQ   rA   type[BaseException] | NonerB   BaseException | NonetbTracebackType | NonerR   boolrE   )rS   s   "r   rT   rU      s2      ( " !	
 
rM   c                	Z    V'       g   R # \         P                  W4      V n        W0n        R# )FT)r9   r?   _saved_tb)rX   rA   rB   r^   s   &&&&r   __exit__ExceptionSaver.__exit__   s(      ,00; rM   c                    R\        V 4      9  d   R# \        \        P                  V P                  4      w  rVP                  V P                  4      h)z"restore and re-raise any exceptionrb   N)varsmapr;   loadsrb   with_tracebackrc   )rX   _typerB   s   &  r   resumeExceptionSaver.resume   s>     4:%t{{3
  **rM   )rb   rc   N)	rF   rG   rH   rI   rJ   rY   rd   rl   rL   rE   rM   r   rO   rO   z   s    
 +rM   rO   c               #  X  a"   \         P                  P                  4       o\        4       ;_uu_ 4       p Sx  RRR4       \         P                  P	                  S4       V3R l\         P                   4       p\        V4       X P                  4        R#   + '       g   i     Lf; i5i)z
Context in which imported modules are saved.

Translates exceptions internal to the context into the equivalent exception
outside the context.
Nc              3  l   <"   T F)  pVS9  g   K  VP                  R 4      '       d   K%  Vx  K+  	  R# 5i)z
encodings.N
startswith).0mod_namer$   s   & r   	<genexpr>save_modules.<locals>.<genexpr>   s7      #H5  	 ##L1	 	#s   	44
4)r!   modulescopyrO   update_clear_modulesrl   )	saved_excdel_modulesr$   s     @r   save_modulesr|      st      KKE			Y 
 KKuK ; 
	s   1B*BAB*B'	"B*c                L    \        V 4       F  p\        P                  V K  	  R # r3   )listr!   rv   )module_namesrs   s   & r   ry   ry      s    &KK! 'rM   c               #     "   \         P                  ! 4       p  V x  \         P                  ! V 4       R #   \         P                  ! T 4       i ; i5ir3   )pkg_resources__getstate____setstate__r(   s    r   save_pkg_resources_stater      s9     &&(E*""5)""5)s   A5 AAAc              #    "   \         P                  P                  V R 4      p\        4       ;_uu_ 4        \	        4       ;_uu_ 4        \        4       ;_uu_ 4        \        4        \        4       ;_uu_ 4        \        V4      ;_uu_ 4        \        V 4      ;_uu_ 4        \        R4       Rx  RRR4       RRR4       RRR4       RRR4       RRR4       RRR4       R#   + '       g   i     L:; i  + '       g   i     LE; i  + '       g   i     LP; i  + '       g   i     L[; i  + '       g   i     Lf; i  + '       g   i     R# ; i5i)temp
setuptoolsN)r,   r'   joinr   r|   r)   hide_setuptoolsr%   r1   r7   
__import__)	setup_dirtemp_dirs   & r   setup_contextr      s     ww||Iv.H	!	#	#^^![[&x00"9--&|4! . 1 !   
$	# .- 10 ![  ^ 
$	#	#s   3EED.	D8DC5 C"0C58D DD.	E
E"C2-C55D DDDD+&D.	.D>9EE		Ec                F    V P                  R^4      ^ ,          pV\        9   # )a  
>>> _needs_hiding('setuptools')
True
>>> _needs_hiding('pkg_resources')
True
>>> _needs_hiding('setuptools_plugin')
False
>>> _needs_hiding('setuptools.__init__')
True
>>> _needs_hiding('distutils')
True
>>> _needs_hiding('os')
False
>>> _needs_hiding('Cython')
True
.)split_MODULES_TO_HIDE)rs   base_modules   & r   _needs_hidingr      s%    " ..a(+K***rM   c                     \         P                  P                  RR4      p V e   V P                  4        \	        \
        \         P                  4      p\        V4       R# )a  
Remove references to setuptools' modules from sys.modules to allow the
invocation to import the most appropriate setuptools. This technique is
necessary to avoid issues such as #315 where setuptools upgrading itself
would fail to find a function declared in the metadata.
_distutils_hackN)r!   rv   get_remove_shimfilterr   ry   )r   rv   s     r   r   r      sC     kkoo&7>O"$$&]CKK0G7rM   c           	        \         P                  P                  \         P                  P                  V 4      4      p\	        V4      ;_uu_ 4         V .\        V4      ,           \        P                  R&   \        P                  P                  ^ V4       \        P                  ! 4        \        P                  P                  R 4       \        V4      ;_uu_ 4        \        V RR7      p\        W4       RRR4       RRR4       R#   + '       g   i     L; i  \          d7   pTP"                  '       d   TP"                  ^ ,          '       d   h  Rp?LYRp?ii ; i  + '       g   i     R# ; i)z8Run a distutils setup script, sandboxed in its directoryr    c                "    V P                  4       # r3   )activate)dists   &r   <lambda>run_setup.<locals>.<lambda>
  s
    dmmorM   __main__)__file__rF   N)r,   r'   abspathdirnamer   r~   r!   r"   insertr   __init__	callbacksappendr   dictr   
SystemExitargs)setup_scriptr   r   nsvs   &&   r   	run_setupr     s     =>I	y	!	!	'.4:5CHHQKHHOOAy)  "!!(()EF!),,<*E,+ - 
"	! -,  	vvv!&&))	 
"	!	!s[   E BDD		7D	DDE DE'*EEE EE  E1	c                      ] tR tRtRtRtR R ltR tR R ltR	 R
 lt	R t
R R ltR F$  t]! ]]4      '       g   K  ]! ]4      ]! 4       ]&   K&  	  RR R llt]! R]4      tR F$  t]! ]]4      '       g   K  ]! ]4      ]! 4       ]&   K&  	  R R ltR  F$  t]! ]]4      '       g   K  ]! ]4      ]! 4       ]&   K&  	  R R ltR! F$  t]! ]]4      '       g   K  ]! ]4      ]! 4       ]&   K&  	  R tR tR tR t]'       d   R R ltRtR# RtR# )"r   i  zDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFc                   V ^8  d   QhRR/# rQ   rR   NonerE   )rS   s   "r   rT   AbstractSandbox.__annotate__  s     
 
$ 
rM   c                	    \        \        4       Uu. uF1  pVP                  R 4      '       d   K  \        W4      '       g   K/  VNK3  	  upV n        R# u upi )_N)dir_osrq   hasattr_attrsrX   names   & r   r   AbstractSandbox.__init__  sG     C
 ??3' ,3D,? D 
 
s   AAAc           	     	`    V P                    F  p\        \        V\        W4      4       K  	  R # r3   )r   setattrr,   getattr)rX   sourcer   s   && r   _copyAbstractSandbox._copy!  s!    KKDBgf34  rM   c                   V ^8  d   QhRR/# r   rE   )rS   s   "r   rT   r   %  s      4 rM   c                	`    V P                  V 4       V P                  \        n        R V n        R# )TN)r   _openbuiltinsr   _activerW   s   &r   rY   AbstractSandbox.__enter__%  s     

4

rM   c               $    V ^8  d   QhRRRRRR/# )rQ   exc_typer\   	exc_valuer]   	tracebackr_   rE   )rS   s   "r   rT   r   *  s(      , ( (	rM   c                	\    R V n         \        \        n        V P	                  \
        4       R# )FN)r   r   r   r   r   r   )rX   r   r   r   s   &&&&r   rd   AbstractSandbox.__exit__*  s     

3rM   c                b    V ;_uu_ 4        V! 4       uuRRR4       #   + '       g   i     R# ; i)zRun 'func' under os sandboxingNrE   )rX   funcs   &&r   runAbstractSandbox.run4  s    T6 TTTs   .	c                   V ^8  d   QhRR/# rQ   r   strrE   )rS   s   "r   rT   r   9  s      C rM   c                	8   a a \        \        S 4      oV V3R  lpV# )c                r   < V P                   '       d   V P                  ! SW.VO5/ VB w  rS! W.VO5/ VB # r3   )r   _remap_pair)rX   srcdstr   kwr   originals   &&&*,r   wrap3AbstractSandbox._mk_dual_path_wrapper.<locals>.wrap<  s?    |||++D#HTHRHC2t2r22rM   r   r   r   r   r   s   f @r   _mk_dual_path_wrapper%AbstractSandbox._mk_dual_path_wrapper9  s    3%	3
 rM   Nc                   V ^8  d   QhRR/# r   rE   )rS   s   "r   rT   r   G  s      c rM   c                	L   a a S;'       g    \        \        S 4      oV V3R  lpV# )c                n   < V P                   '       d   V P                  ! SV.VO5/ VB pS! V.VO5/ VB # r3   )r   _remap_inputrX   r'   r   r   r   r   s   &&*,r   r   5AbstractSandbox._mk_single_path_wrapper.<locals>.wrapJ  s=    |||((tAdAbAD.4.2..rM   r   )r   r   r   s   ff r   _mk_single_path_wrapper'AbstractSandbox._mk_single_path_wrapperG  s#    11wsD1	/
 rM   r   c                   V ^8  d   QhRR/# r   rE   )rS   s   "r   rT   r   j  s     	 	S 	rM   c                	8   a a \        \        S 4      oV V3R  lpV# )c                   < V P                   '       d4   V P                  ! SV.VO5/ VB pV P                  SS! V.VO5/ VB 4      # S! V.VO5/ VB # r3   )r   r   _remap_outputr   s   &&*,r   r   4AbstractSandbox._mk_single_with_return.<locals>.wrapm  s_    |||((tAdAbA))$0K0K0KLLD.4.2..rM   r   r   s   f @r   _mk_single_with_return&AbstractSandbox._mk_single_with_returnj  s    3%	/ rM   c                   V ^8  d   QhRR/# r   rE   )rS   s   "r   rT   r   y  s     	 	 	rM   c                	8   a a \        \        S 4      oV V3R  lpV# )c                `   < S! V/ VB pV P                   '       d   V P                  SV4      # V# r3   )r   r   )rX   r   r   retvalr   r   s   &*, r   r   'AbstractSandbox._mk_query.<locals>.wrap|  s3    t*r*F|||))$77MrM   r   r   s   f @r   	_mk_queryAbstractSandbox._mk_queryy  s    3%	 rM   c                    V# )z=Called to remap or validate any path, whether input or outputrE   )rX   r'   s   &&r   _validate_pathAbstractSandbox._validate_path  s    rM   c                $    V P                  V4      # zCalled for path inputsr   rX   	operationr'   r   r   s   &&&*,r   r   AbstractSandbox._remap_input      ""4((rM   c                $    V P                  V4      # )zCalled for path outputsr   )rX   r   r'   s   &&&r   r   AbstractSandbox._remap_output  r  rM   c                z    V P                   ! VR,           V.VO5/ VB V P                   ! VR,           V.VO5/ VB 3# )?Called for path pairs like rename, link, and symlink operationsz-fromz-to)r   rX   r   r   r   r   r   s   &&&&*,r   r   AbstractSandbox._remap_pair  sL     i'13DDDi%/BtBrB
 	
rM   c                    V ^8  d   QhRRRR/# )rQ   r   r   rR   r   rE   )rS   s   "r   rT   r     s    9999rM   c                	    R # r3   rE   r   s   &&r   __getattribute__ AbstractSandbox.__getattribute__  s    crM   )r   r   )renamelinksymlinkr3   )statlistdirr5   r   chmodchownmkdirremoveunlinkrmdirutimelchownchrootlstat	startfilemkfifomknodpathconfaccess)readlinktempnam)r4   tmpnam)rF   rG   rH   rI   rJ   r   r   r   rY   rd   r   r   _AbstractSandbox__namer   r   r   r   r   r   r   r   r   r   r   r   r
  rL   rE   rM   r   r   r     s   NG
5

 034V<FHV 0 $FE2E* 36v>FHV-0	 *35f=FHV *	 '3(0FHV '))
  	:9 rM   devnullc                      ] tR tRt$ Rt]P                  . RO4      tR]R&   . t	R]R&    ]
3R R lltR	 tRR
 ltR R ltR tR tR tR tRR R lltRtR# )r   i  z<Restrict operations to a single subdirectory - pseudo-chrootzClassVar[dict[str, None]]	write_opszlist[str | re.Pattern]_exception_patternsc                   V ^8  d   QhRR/# r   rE   )rS   s   "r   rT   DirectorySandbox.__annotate__  s     ' '4 'rM   c                	   \         P                  P                  \         P                  P                  V4      4      V n        \         P                  P                  V P                  R 4      V n        V Uu. uF?  p\         P                  P                  \         P                  P                  V4      4      NKA  	  upV n        \        P                  V 4       R# u upi ) N)
r,   r'   normcaserealpath_sandboxr   _prefix_exceptionsr   r   )rX   sandbox
exceptionsr'   s   &&& r   r   DirectorySandbox.__init__  s    (()9)9')BCww||DMM26AK
AKBGGRWW--d34
 	  &
s   5ACc                	     ^ RI Hp V! WV4      h)r   )r   )r>   r   )rX   r   r   r   r   s   &&*, r   
_violationDirectorySandbox._violation  s    7y33rM   c                	    VR9  d/   V P                  V4      '       g   V P                  ! RW.VO5/ VB  \        W.VO5/ VB # )rr   )r8  rtr   rUU)_okr5  r   )rX   r'   r   r   r   s   &&&*,r   r   DirectorySandbox._open  sD    33DHHTNNOOFD<<<T-$-"--rM   c                   V ^8  d   QhRR/# r   rE   )rS   s   "r   rT   r)    s     " " "rM   c                	(    V P                  R 4       R# )r"  N)r5  rW   s   &r   r"  DirectorySandbox.tmpnam  s    !rM   c                	Z   V P                   p R V n         \        P                  P                  \        P                  P	                  V4      4      pV P                  V4      ;'       g2    W0P                  8H  ;'       g    VP                  V P                  4       W n         #   Y n         i ; i)F)	r   r,   r'   r,  r-  	_exemptedr.  rq   r/  )rX   r'   activer-  s   &&  r   r<  DirectorySandbox._ok  s    		" DLww''(8(8(>?Hx( 5 5}},5 5&&t||4 "L6Ls   AB" )B" ?B" "B*c                	   a V3R  lV P                    4       pV3R lV P                   4       p\        P                  ! W#4      p\	        V4      # )c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir3   rp   )rr   	exceptionfilepaths   & r   rt   -DirectorySandbox._exempted.<locals>.<genexpr>  s#      
<LyH	**<Ls   !c              3  R   <"   T F  p\         P                  ! VS4      x  K  	  R # 5ir3   )rematch)rr   patternrH  s   & r   rt   rI    s#      
7OGBHHWh''7Os   $')r0  r'  	itertoolschainany)rX   rH  start_matchespattern_matches
candidatess   &f   r   rB  DirectorySandbox._exempted  sG    
<@<L<L

7;7O7O
 __]D
:rM   c                    WP                   9   dL   V P                  V4      '       g5   V P                  ! V\        P                  P                  V4      .VO5/ VB  V# r   )r&  r<  r5  r,   r'   r-  r   s   &&&*,r   r   DirectorySandbox._remap_input  sD    &txx~~OOIrww'7'7'=KKKrM   c                    V P                  V4      '       d   V P                  V4      '       g   V P                  ! WV.VO5/ VB  W#3# )r  )r<  r5  r  s   &&&&*,r   r   DirectorySandbox._remap_pair  s;    xx}}DHHSMMOOIC=$="=zrM   c                    V ^8  d   QhRRRR/# )rQ   r   intrR   rE   )rS   s   "r   rT   r)    s     8 8c 83 8rM   c                    V\         ,          '       d0   V P                  V4      '       g   V P                  ! RWV.VO5/ VB  \        P                  ! WV.VO5/ VB # )zCalled for low-level os.open()zos.open)WRITE_FLAGSr<  r5  r   r   )rX   fileflagsr   r   r   s   &&&&*,r   r   DirectorySandbox.open  sN    ;txx~~OOItDF4F2FxxT7D7B77rM   )r   r0  r/  r.  N)r   r  r  r  r  r  r  r  r  r  r  r  r!  )r8  )i  )rF   rG   rH   rI   rJ   r   fromkeysr&  __annotations__r'  _EXCEPTIONSr   r5  r   r"  r<  rB  r   r   r   rL   rE   rM   r   r   r     sf    F+/== : ,I(   35/44+6 '4
.
""8 8rM   z4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc                  f    ] tR tRtRt]P                  ! R4      P                  4       tR R lt	Rt
R# )r   i  zEA setup script attempted to modify the filesystem outside the sandboxa  
        SandboxViolation: {cmd}{args!r} {kwargs}

        The package setup script has attempted to modify files on your system
        that are not within the EasyInstall build area, and has been aborted.

        This package cannot be safely installed by EasyInstall, and may not
        support alternate installation locations even if you run its setup
        script by hand.  Please inform the package's author and the EasyInstall
        maintainers to find out if a fix or workaround is available.
        c                   V ^8  d   QhRR/# )rQ   rR   r   rE   )rS   s   "r   rT   SandboxViolation.__annotate__  s     , , ,rM   c                	h    V P                   w  rpV P                  P                  ! R/ \        4       B # )NrE   )r   tmplrS   r   )rX   cmdr   kwargss   &   r   __str__SandboxViolation.__str__  s*     II6yy+&(++rM   rE   N)rF   rG   rH   rI   rJ   textwrapdedentlstriprg  rj  rL   rE   rM   r   r   r     s.    O??
	 fh 	, ,rM   )r   r   r   r   r3   >   Cython	distutilsr   r   r   )A
__future__r   r   
contextlib	functoolsrN  operatorr,   r;   rK  r!   r.   rl  typesr   typingr   r   r   r   r   distutils.errorsr	   r   platformrq   $org.python.modules.posix.PosixModulepythonrv   posixPosixModuler   r   r   typing_extensionsr   __all__r   contextmanagerr%   r)   r1   r7   r=   r9   rO   r|   ry   r   r   r   r   r   r   r   r   r$  rb  r   reduceor_r   r   r\  r   )as   0r   <module>r     s   "      	  	 
    / /  % +\\V$$66
++bgg
C &
      ! !   1I 1( +  +F  2"
 * * " " +*(I: I:X 2y::,KKR8 R8j LL HMMOOA 	QO,~ ,s   	G0
