
    d4                     x    d 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 ddl	m
Z
 ej        dk    rdadad
dZdd	ZdS )zdistutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
    N)DistutilsPlatformErrorDistutilsExecError)DEBUG)logdarwin   c                    t          |           } t          j        d                    |                      |rdS |rt	          | d                   }||| d<   d}t
          j        dk    rt          Hddlm	} |
                    d          pdat          r$d t                              d	          D             at          rt          j                            dt                    }d
 |                    d	          D             }t          dd         ddgk    r-|dd         ddgk     rd|dt          d}	t!          |	          t#          t          j        |          }	 t%          j        | |          }
|
                                 |
j        }nB# t,          $ r5}t.          s| d         } t1          d| d|j        d                   |d}~ww xY w|r$t.          s| d         } t1          d| d|          dS )a  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.  If 'dry_run' is true,
    the command will not actually be run.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
     Nr   r   )	sysconfigMACOSX_DEPLOYMENT_TARGET c                 ,    g | ]}t          |          S  int.0xs     !  /croot/python-split_1694437901252/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/python3.11/distutils/spawn.py
<listcomp>zspawn.<locals>.<listcomp><   s    $L$L$LSVV$L$L$L    .c                 ,    g | ]}t          |          S r   r   r   s     r   r   zspawn.<locals>.<listcomp>D   s    FFF1AFFFr      
      z)$MACOSX_DEPLOYMENT_TARGET mismatch: now "z" but "z)" during configure;must use 10.3 or later)r   )envzcommand z	 failed: z failed with exit code )listr   infojoinfind_executablesysplatform_cfg_target	distutilsr   get_config_varsplit_cfg_target_splitosenvirongetr   dict
subprocessPopenwait
returncodeOSErrorr   r   args)cmdsearch_pathverbosedry_run
executabler   r   
cur_targetcur_target_splitmy_msgprocexitcodeexcs                r   spawnr?      sn   $ s))CHSXXc]]   $SV,,
!CF
C
|x++++++#22"<> > DAC  M$L$L[5F5Fs5K5K$L$L$L! 	< (BKPPJFF
0@0@0E0EFFF !$Q//4DRaR4HBPQ74R4R4R $.::{{{< -V444rz0:< < <CD---		? D D D 	a&C  '*ssCHRLL9; ;@C	DD  G 	a&C  7:ssHHEG G 	GG Gs   #1F 
G0GGc                 R   t           j                            |           \  }}t          j        dk    r|dk    r| dz   } t           j                            |           r| S |[t           j                            dd          }|9	 t          j        d          }n## t          t          f$ r t           j        }Y nw xY w|sdS |                    t           j                  }|D ]E}t           j                            ||           }t           j                            |          r|c S FdS )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.
    win32z.exeNPATHCS_PATH)r*   pathsplitextr#   r$   isfiler+   r,   confstrAttributeError
ValueErrordefpathr(   pathsepr!   )r8   rD   _extpathspfs          r   r"   r"   _   s)    Wj))FAscVmm&(
	w~~j!! |z~~fd++<"z),,"J/ " " "z"  tJJrz""E  GLLJ''7>>! 	HHH	 4s   B B98B9)r   r   r   )N)__doc__r#   r*   r.   distutils.errorsr   r   distutils.debugr   r&   r   r$   r%   r)   r?   r"   r   r   r   <module>rT      s     


 				     G G G G G G G G ! ! ! ! ! !       <8KEG EG EG EGP" " " " " "r   