ef VdZddlZddlZddlZddlmZddlmZddlm Z d dZ d dZ dS) 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)DistutilsExecError)DEBUG)logct|}tjtj||rdS|rt |d}|||d<||nt tj}tj dkrddl m }m }|}|r|||< tj||} | | j} nP#t"$rC} t$s|d}t'd|| jd| d} ~ wwxYw| r2t$s|d}t'd|| dS) 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. Nrdarwin)MACOSX_VERSION_VARget_macosx_target_ver)envzcommand {!r} failed: {}z%command {!r} failed with exit code {})listrinfo subprocess list2cmdlinefind_executabledictosenvironsysplatformdistutils.utilr r Popenwait returncodeOSErrorrrformatargs) cmd search_pathverbosedry_runr executabler r macosx_target_verprocexitcodeexcs {/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/_distutils/spawn.pyspawnr(s$ s))CHZ $S ) )*** $SV,,  !CF##d2:&6&6C |xLLLLLLLL1133  8&7C" # --- ?  a&C % , ,S#(2, ? ?     a&C 3 : :3 I I     s1C D>DDcRtj|\}}tjdkr |dkr|dz}tj|r|S|[tjdd}|9 tjd}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. win32z.exeNPATHCS_PATH)rpathsplitextrrisfilergetconfstrAttributeError ValueErrordefpathsplitpathsepjoin)r"r-_extpathspfs r'rrKs) W  j ) )FAs cVmm&(  w~~j!! |z~~fd++ < "z),,"J/ " " "z " t JJrz " "E  GLLJ ' ' 7>>!   HHH  4sBB98B9)rrrN)N) __doc__rrrerrorsrdebugr_logrr(rr'rCs &&&&&&6 6 6 6 r""""""rB