\ds 8dZddlZGddZdZdZdS)z Basic subprocess implementation for POSIX which only uses os functions. Only implement features required by setup.py to build C extension modules when subprocess is unavailable. setup.py is not used on Windows. NceZdZddZdZdS)PopenNc0||_||_d|_dSN)_cmd_env returncode)selfcmdenvs ..\python\lib\_bootsubprocess.py__init__zPopen.__init__ s  ctj}|dkr |j,tj|jd|j|jn%tj|jd|jtjdnJ#tjdwxYwtj|d\}}tj||_ |j S)Nr) osforkrexecverexecv_exitwaitpidwaitstatus_to_exitcoder )r pid_statuss r waitz Popen.waitsgii !88 9(IdilDItyAAAAHTYq\49555   3**IAv 7??DOs ABBr)__name__ __module__ __qualname__rrrr rr s7 rrcg}dD]W\}}tt|t|dzD]$}|t|%X|dd|}t |t tfr|}nt |tr|g}ndS|D],}t |tsdS|sdS|D] }||vrdS -dS)N))az)AZ)09rz./-FT) rangeordappendchrjoin isinstancetupleliststr)r safe_charsfirstlastch check_strsargs r _check_cmdr8$s2J;'' tE CIIM22 ' 'B   c"gg & & & & 'e$$J#t}%% C  U u#s## 55 55  B##uuu$  4rc |rtt|t|std|d}t |t sd|}|d|} tj|}tj |}|rtd|d| t|d5}| }dddn #1swxYwYn#t$rd}YnwxYw tj |n:#t$rYn.wxYw# tj |w#t$rYwwxYwxYw|S) Nzunsupported command: zcheck_output.tmp z >zCommand z returned non-zero exit status rbr)NotImplementedErrorreprr8 ValueErrorr.r1r-rsystemropenreadFileNotFoundErrorunlinkOSError)r kwargs tmp_filenamerexitcodefpstdouts r check_outputrJBs 0!$v,,/// c??:888999%L c3  hhsmm  " "L " "C3,V44  :999,499:: : lD)) #R # # # # # # # # # # # # # # #    FFF   Il # # # #    D   Il # # # #    D  Ms4?D)4C1C% C1%C))C1,C)-C10D)1 D=D)?DD)D D&%D&)E+E?E E  E E  E)__doc__rrr8rJr rr rLsj  2<r