bg)dZddlmZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZddlmZd Zdd ZddZddZddZdS)zdistutils.spawn Provides the 'spawn()' function, a front-end to various platform- specific functions for launching another program in a sub-process. ) annotationsN)Mapping)logDEBUG)DistutilsExecErrorc$tr|n|dS)zE Render a subprocess command differently depending on DEBUG. rr)cmds R/opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/_distutils/spawn.py_debugr s #33SV#envMapping[str:str] | Nonereturnctjdkr|Sddlm}m}|}|r||ini}it ||S)NDarwinr)MACOSX_VERSION_VARget_macosx_target_ver)platformsystemutilrr_resolve)rrr target_verupdates r _inject_macos_verrskH$$ ????????&&((J1; C * - -F &hsmm &v &&rMapping[str:str]c"| tjn|SN)osenvironrs r rr(s2::#-rTFctjtj||rdS|r!t j|d}|||d< tj|t|dS#t$r3}tdt|d|j d|d}~wtj $r-}tdt|d|j |d}~wwxYw)aRun 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"zcommand z failed: z failed with exit code )rinfo subprocess list2cmdlineshutilwhich check_callrOSErrorr r argsCalledProcessError returncode)r search_pathverbosedry_runr executableexcerrs r spawnr5,s HZ $S ) )*** \#a&))  !CF c'8'='=>>>>>>  =vc{{ = =sx| = =     ( Mvc{{ M MS^ M M   s$#A44 C+>.B,,C+>(C&&C+ctjdtdtj|\}}t jdkr |dkr|dz}tj|r|S|[tj dd}|9 tj d}n##ttf$rtj}YnwxYw|sdS|tj}|D]E}tj||}tj|r|cSFdS) 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) stacklevelwin32z.exeNPATHCS_PATH)warningswarnDeprecationWarningr pathsplitextsysrisfiler!getconfstrAttributeError ValueErrordefpathsplitpathsepjoin)r2r?_extpathspfs r find_executablerPQsM  M57IVWW  j ) )FAs cVmm&(  w~~j!! |z~~fd++ < "z),,"J/ " " "z " t JJrz " "E  GLLJ ' ' 7>>!   HHH  4s B55CC)rrrr)rrrr)TFFNr)__doc__ __future__rr rr(r&rAr<typingr_logrdebugrerrorsr r rrr5rPrr rXs #"""""   &&&&&&$$$''''....""""J$$$$$$r