K idZddlmZddlZddlZddlZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZddlmZdd lmZe rdd lmZed e Zd ZddZeddZeddZddZ d ddZdddZy)zdistutils.spawn Provides the 'spawn()' function, a front-end to various platform- specific functions for launching another program in a sub-process. ) annotationsN)MappingMutableSequence) TYPE_CHECKINGTypeVaroverload)logDEBUG)DistutilsExecError)_ENV _MappingT)boundctr|S|dS)zE Render a subprocess command differently depending on DEBUG. rr )cmds a/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/setuptools/_distutils/spawn.py_debugrs3#SV#ctjdk7r|Sddlm}m}|}|r||ini}it ||S)NDarwinr )MACOSX_VERSION_VARget_macosx_target_ver)platformsystemutilrr_resolve)envrr target_verupdates r_inject_macos_verr!$sDH$ ?&(J1; * -F &hsm &v &&rcyNrs rrr/s-0rcyr#r$r%s rrr1s+.rc*|tjS|Sr#)osenvironr%s rrr3s2::-#-rctjtj||ry|rt j |d}|||d< tj |t|y#t$r-}tdt|d|jd|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 )r info subprocess list2cmdlineshutilwhich check_callr!OSErrorr rargsCalledProcessError returncode)r search_pathverbosedry_runr executableexcerrs rspawnr<7s,HHZ $ $S )*\\#a&)  !CF c'8'=>  vc{oYsxx|n =    ( ( vc{o%>! H  #J/ "zz "s"D$$EE)r_MappingT | Nonereturnz'_MappingT | dict[str, str | int] | None)rNonerYzos._Environ[str])rrrYr)rrXrYz_MappingT | os._Environ[str])TFFN) rz/MutableSequence[bytes | str | os.PathLike[str]]r6boolr7r[r8r[rz _ENV | NonerYrZr#)r9strrF str | NonerYr])__doc__ __future__rr(rr/r-rHrCcollections.abcrrtypingrrr_logr debugr errorsr rrrr!rr<rWr$rrres #   433& Kw / $' 0 0 . ..  ( 8((( (  (  (V$r