Ë
    óÇ:j{  ã                  ó  — d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z
mZ ddlmZmZmZ ddlmZ ddlmZ dd	lmZ erdd
lmZ  ede
¬«      Zd„ Zdd„Zedd„«       Zedd„«       Zdd„Z	 	 	 d	 	 	 	 	 	 	 	 	 dd„Zddd„Zy)z–distutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
é    )ÚannotationsN)ÚMappingÚMutableSequence)ÚTYPE_CHECKINGÚTypeVarÚoverloadé   )Úlog©ÚDEBUG)ÚDistutilsExecError)Ú_ENVÚ	_MappingT)Úboundc                ó   — t         r| S | d   S )zE
    Render a subprocess command differently depending on DEBUG.
    r   r   )Úcmds    úp/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/setuptools/_distutils/spawn.pyÚ_debugr      s   € õ ˆ3Ð#˜S ™VÐ#ó    c                ó€   — t        j                  «       dk7  r| S ddlm}m}  |«       }|r||ini }i t        | «      ¥|¥S )NÚDarwinr	   )ÚMACOSX_VERSION_VARÚget_macosx_target_ver)ÚplatformÚsystemÚutilr   r   Ú_resolve)Úenvr   r   Ú
target_verÚupdates        r   Ú_inject_macos_verr!   $   sD   € Ü‡�Ó˜HÒ$Øˆ
ç?á&Ó(€JÙ1;Ð  *Ñ-À€FØ&Œh�s‹mÐ&˜vÐ&Ð&r   c                 ó   — y ©N© ©r   s    r   r   r   /   s   € Ø-0r   c                 ó   — y r#   r$   r%   s    r   r   r   1   s   € Ø+.r   c                ó*   — | €t         j                  S | S r#   )ÚosÚenvironr%   s    r   r   r   3   s   € Ø˜Œ2�:‰:Ð-¨#Ð-r   c                óÀ  — t        j                  t        j                  | «      «       |rt	        j
                  | d   «      }|�|| d<   	 t        j                  | t        |«      ¬«       y# t        $ r-}t        dt        | «      ›d|j                  d   › �«      |‚d}~wt        j                  $ r*}t        dt        | «      ›d|j                  › �«      |‚d}~ww xY w)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.
    There is no way to run a program with a name different from that of its
    executable.

    If 'search_path' is true (the default), the system's executable
    search path will be used to find the program; otherwise, cmd[0]
    must be the exact path to the executable.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
    r   Nr%   zcommand z	 failed: éÿÿÿÿz failed with exit code )r
   ÚinfoÚ
subprocessÚlist2cmdlineÚshutilÚwhichÚ
check_callr!   ÚOSErrorr   r   ÚargsÚCalledProcessErrorÚ
returncode)r   Úsearch_pathÚverboser   Ú
executableÚexcÚerrs          r   Úspawnr;   7   sÑ   € ô( ‡H�HŒZ×$Ñ$ SÓ)Ô*áÜ—\‘\ # a¡&Ó)ˆ
ØÐ!ØˆC�‰Fð	Ü×Ñ˜cÔ'8¸Ó'=Ö>øÜò Ü Ø”v˜c“{�o Y¨s¯x©x¸©|¨nÐ=ó
àð	ûô ×(Ñ(ò Ü Ø”v˜c“{�oÐ%<¸S¿^¹^Ð<LÐMó
àð	ûðús$   Á A, Á,	CÁ5(BÂCÂ3%CÃCc                ó’  — t        j                  dt        d¬«       t        j                  j                  | «      \  }}t        j                  dk(  r
|dk7  r| dz   } t        j                  j                  | «      r| S |€8t        j                  j                  dd«      }|€	 t        j                  d«      }|sy|j                  t        j                   «      }|D ]E  }t        j                  j#                  || «      }t        j                  j                  |«      sŒC|c S  y# t        t        f$ r t        j                  }Y ŒŽw xY w)	zÚTries 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ÚDeprecationWarningr(   ÚpathÚsplitextÚsysr   Úisfiler)   ÚgetÚconfstrÚAttributeErrorÚ
ValueErrorÚdefpathÚsplitÚpathsepÚjoin)r8   rE   Ú_ÚextÚpathsÚpÚfs          r   Úfind_executablerV   ^   s  € ô ‡M�MØ5Ô7IÐVWõô �W‰W×Ñ˜jÓ)�F€A€sÜ�‰˜Ò c¨V¢mØ &Ñ(ˆ
ä	‡w�w‡~�~�jÔ!ØÐà€|Ü�z‰z�~‰~˜f dÓ+ˆàˆ<ð"Ü—z‘z )Ó,�ñ Øà�J‰J”r—z‘zÓ"€EØò ˆÜ�G‰G�L‰L˜˜JÓ'ˆÜ�7‰7�>‰>˜!ÕàŠHð	ð
 øô #¤JÐ/ò "ä—z‘z’ð"ús   Â"D$ Ä$EÅE)r   ú_MappingT | NoneÚreturnz'_MappingT | dict[str, str | int] | None)r   ÚNonerX   zos._Environ[str])r   r   rX   r   )r   rW   rX   z_MappingT | os._Environ[str])TFN)
r   z/MutableSequence[bytes | str | os.PathLike[str]]r6   Úboolr7   rZ   r   z_ENV | NonerX   rY   r#   )r8   ÚstrrE   ú
str | NonerX   r\   )Ú__doc__Ú
__future__r   r(   r   r/   r-   rG   rB   Úcollections.abcr   r   Útypingr   r   r   Ú_logr
   Údebugr   Úerrorsr   r   r   r   r!   r   r;   rV   r$   r   r   ú<module>rd      s¸   ðñõ #ã 	Û Û Û Û 
Û ß 4ß 3Ñ 3å Ý Ý &áÝñ �K wÔ/€	ò$ó'ð 
Ú 0ó 
Ø 0Ø	Ú .ó 
Ø .ó.ð ØØð	$Ø	8ð$àð$ð ð$ð 
ð	$ð
 
ó$õN$r   