a ˆåÏh8ã@sndZddlZddlZddlZddlmZmZddlmZddl m Z ej dkrVda da d dd „Zd d d „ZdS)zìdistutils.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 Cszt|ƒ}t d |¡¡|r dS|r@t|dƒ}|dur@||d<|durL|nttjƒ}tj dkrät duršddl m }|  d¡p€da t ršdd „t  d ¡Dƒat rätj dt ¡}td d „| d ¡DƒkrØd |t f}t|ƒ‚|j|d �z tj||d�} |  ¡| j} WnLt�yP} z2t�s$|d}td|| jdfƒ| ‚WYd} ~ n d} ~ 00| �rvt�sf|d}td|| fƒ‚dS)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. ú Nrr)Ú sysconfigÚMACOSX_DEPLOYMENT_TARGETÚcSsg|] }t|ƒ‘qS©©Úint©Ú.0Úxr r ú?/usr/lib/python3.9/site-packages/setuptools/_distutils/spawn.pyÚ =ózspawn..Ú.cSsg|] }t|ƒ‘qSr r rr r rrCrzF$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configure)r )Úenvzcommand %r failed: %séÿÿÿÿz#command %r failed with exit code %s)ÚlistrÚinfoÚjoinÚfind_executableÚdictÚosÚenvironÚsysÚplatformÚ _cfg_targetÚ distutilsr Zget_config_varÚsplitÚ_cfg_target_splitÚgetrÚupdateÚ subprocessÚPopenÚwaitÚ returncodeÚOSErrorrrÚargs) ÚcmdÚ search_pathÚverboseÚdry_runrÚ executabler Z cur_targetZmy_msgÚprocZexitcodeÚexcr r rÚspawnsZ   ÿÿþ  ÿÿ ÿr4c CsÈtj |¡\}}tjdkr*|dkr*|d}tj |¡r:|S|dur„tj dd¡}|dur„zt d¡}Wnt t fy‚tj }Yn0|sŒdS|  tj ¡}|D]&}tj ||¡}tj |¡rœ|SqœdS)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. Úwin32z.exeNÚPATHÚCS_PATH)rÚpathÚsplitextrr Úisfilerr%ÚconfstrÚAttributeErrorÚ ValueErrorÚdefpathr#Úpathsepr)r1r8Ú_ÚextÚpathsÚpÚfr r rr(     r)rrrN)N)Ú__doc__rrr'Zdistutils.errorsrrZdistutils.debugrr"rr r!r$r4rr r r rÚs    D