
    nj
                        S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSKJ	r	  SSK
Jr  SSKJr  \R                  S 5       rSS	 jrSSS
 jjrg)zdistutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
    )annotationsN)MutableSequence   )log)DistutilsExecErrorc              #     #     Sv   g! [          a(  n[        SU S   < SUR                  S    35      UeSnAf[        R                   a%  n[        SU S   < SUR
                   35      UeSnAff = f7f)zCReraise a subprocess failure running 'cmd' as a DistutilsExecError.Nzcommand r   z	 failed: z failed with exit code )OSErrorr   args
subprocessCalledProcessError
returncode)cmdexcerrs      W/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/setuptools/_distutils/spawn.py_translate_errorsr      s}      X 8CF:Ysxx|n!MNTWW((  s1vj 77GH
	s.   A5	 A5
A2#6A2 A--A22A5c                    [         R                  " [        R                  " U 5      5        [	        U 5         [        R
                  " U 40 UD6  SSS5        g! , (       d  f       g= f)an  Run another program, specified as a command list 'cmd', in a new process.

'cmd' is just the argument list for the new process, ie.
cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
Any keyword arguments are passed through to ``subprocess.check_call``.

Raise DistutilsExecError if running the program fails in any way; just
return on success.
N)r   infor   list2cmdliner   
check_call)r   kwargss     r   spawnr   !   sB     HHZ$$S)*	3	c,V, 
 		s   A
A%c                   [         R                  " S[        SS9  [        R                  R                  U 5      u  p#[        R                  S:X  a  US:w  a  U S-   n [        R                  R                  U 5      (       a  U $ Uc:  [        R                  R                  SS5      nUc   [        R                  " S5      nU(       d  gUR                  [        R                   5      nU HJ  n[        R                  R#                  XP5      n[        R                  R                  U5      (       d  MH  Us  $    g! [        [        4 a    [        R                  n Nf = f)	zTries to find 'executable' in the directories listed in 'path'.

A string listing directories separated by 'os.pathsep'; defaults to
os.environ['PATH'].  Returns the complete filename or None if not found.
z+Use shutil.which instead of find_executable   )
stacklevelwin32z.exeNPATHCS_PATH)warningswarnDeprecationWarningospathsplitextsysplatformisfileenvirongetconfstrAttributeError
ValueErrordefpathsplitpathsepjoin)
executabler$   _extpathspfs          r   find_executabler8   0   s	    MM57IVW WWj)FAcVm&(
	ww~~j!!|zz~~fd+<"zz), JJrzz"EGGLL'77>>!H	 
  #J/ "zz"s   (D6 6 EE)r   z/MutableSequence[bytes | str | os.PathLike[str]]returnNone)N)r2   strr$   
str | Noner9   r<   )__doc__
__future__r   
contextlibr#   r   r&   r    collections.abcr   _logr   errorsr   contextmanagerr   r   r8        r   <module>rF      sK    #  	  
  +  & 	 	-$rE   