B œ< "b#+ã@s\ddlZejdkZddlZddlZddlZddlZddlZddlZddl Z ddlm Z Gdd„de ƒZ Gdd„de ƒZGdd „d e ƒZer²ddlZddlZddlZGd d „d ƒZnDddlZddlZddlZddlZeed d ƒZeedƒrðejZnejZddddddddddddd dgZer¬ddlmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/e 0dddddd d!d"d d#d$d%d&d'd(d)d*d+d,g¡Gd-d.„d.e1ƒZ2erÀdZ3d/d0„Z4n gZ3d1d0„Z4d2Z5d3Z6d4Z7d5d6„Z8d7d8„Z9dd9œd:d„Z:d;d„Z;dd9œddd>dd>d?œd@d„Z?dAdB„Z@dCd„ZAdDd„ZBGdEd„de=ƒZCdS)FéNÚwin32)Ú monotonicc@s eZdZdS)ÚSubprocessErrorN)Ú__name__Ú __module__Ú __qualname__©rrú-/opt/alt/python37/lib/python3.7/subprocess.pyr9src@s8eZdZd dd„Zdd„Zedd„ƒZejdd„ƒZdS) ÚCalledProcessErrorNcCs||_||_||_||_dS)N)Ú returncodeÚcmdÚoutputÚstderr)Úselfr r r rrrr Ú__init__CszCalledProcessError.__init__cCsb|jrN|jdkrNyd|jt |j ¡fStk rJd|j|j fSXnd|j|jfSdS)NrzCommand '%s' died with %r.z)Command '%s' died with unknown signal %d.z.Command '%s' returned non-zero exit status %d.)r r ÚsignalZSignalsÚ ValueError)rrrr Ú__str__IszCalledProcessError.__str__cCs|jS)N)r )rrrr ÚstdoutUszCalledProcessError.stdoutcCs ||_dS)N)r )rÚvaluerrr rZs)NN)rrrrrÚpropertyrÚsetterrrrr r <s  r c@s8eZdZd dd„Zdd„Zedd„ƒZejdd„ƒZdS) ÚTimeoutExpiredNcCs||_||_||_||_dS)N)r Útimeoutr r)rr rr rrrr rhszTimeoutExpired.__init__cCsd|j|jfS)Nz'Command '%s' timed out after %s seconds)r r)rrrr rnszTimeoutExpired.__str__cCs|jS)N)r )rrrr rrszTimeoutExpired.stdoutcCs ||_dS)N)r )rrrrr rvs)NN)rrrrrrrrrrrr ras  rc@s,eZdZdddddddœdd„Zdd„ZdS)Ú STARTUPINFOrN)ÚdwFlagsÚ hStdInputÚ hStdOutputÚ hStdErrorÚ wShowWindowÚlpAttributeListcCs0||_||_||_||_||_|p(dgi|_dS)NÚ handle_list)rrrrrr )rrrrrrr rrr r‚s zSTARTUPINFO.__init__cCs@|j ¡}d|kr"t|dƒ|d<t|j|j|j|j|j|dS)Nr!)rrrrrr ) r ÚcopyÚlistrrrrrr)rZ attr_listrrr Ú_copy‹s zSTARTUPINFO._copy)rrrrr$rrrr rsrZPIPE_BUFiÚ PollSelectorÚPopenÚPIPEÚSTDOUTÚcallÚ check_callÚgetstatusoutputÚ getoutputÚ check_outputÚrunÚDEVNULLÚCompletedProcess)ÚCREATE_NEW_CONSOLEÚCREATE_NEW_PROCESS_GROUPÚSTD_INPUT_HANDLEÚSTD_OUTPUT_HANDLEÚSTD_ERROR_HANDLEÚSW_HIDEÚSTARTF_USESTDHANDLESÚSTARTF_USESHOWWINDOWÚABOVE_NORMAL_PRIORITY_CLASSÚBELOW_NORMAL_PRIORITY_CLASSÚHIGH_PRIORITY_CLASSÚIDLE_PRIORITY_CLASSÚNORMAL_PRIORITY_CLASSÚREALTIME_PRIORITY_CLASSÚCREATE_NO_WINDOWÚDETACHED_PROCESSÚCREATE_DEFAULT_ERROR_MODEÚCREATE_BREAKAWAY_FROM_JOBr1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBc@s6eZdZdZejfdd„Zdd„Zdd„ZeZ eZ dS) ÚHandleFcCs|jsd|_||ƒdS)NT)Úclosed)rÚ CloseHandlerrr ÚCloseÊsz Handle.ClosecCs |jsd|_t|ƒStdƒ‚dS)NTzalready closed)rDÚintr)rrrr ÚDetachÏsz Handle.DetachcCsd|jjt|ƒfS)Nz%s(%d))Ú __class__rrG)rrrr Ú__repr__ÕszHandle.__repr__N) rrrrDÚ_winapirErFrHrJÚ__del__rrrrr rCÇs rCcCsdS)Nrrrrr Ú_cleanupçsrMc Cs`tdkr dSxNtdd…D]>}|jtjd}|dk ryt |¡Wqtk rVYqXqWdS)N)Ú _deadstate)Ú_activeÚ_internal_pollÚsysÚmaxsizeÚremover)ÚinstZresrrr rMðséÿÿÿÿéþÿÿÿéýÿÿÿcCs*g}tjj}|dkr&| dd|¡|S)Nrú-ÚO)rQÚflagsÚoptimizeÚappend)Úargsrrrr Ú"_optim_args_from_interpreter_flagss r^c Csbdddddddœ}tƒ}x:| ¡D].\}}ttj|ƒ}|dkr"| d ||¡q"Wtjjrh| d ¡n$tjjrz| d ¡tjjrŒ| d ¡tj dd…}tjj }ttd iƒ}d|k}|dkrÊ|  d¡n|rØ|  d¡|ræ|  d¡x|D]}| d|¡qìW|r|  d¡xJdD]B}||kr||} | dkr>|} n d|| f} |  d| f¡qW|S)NÚdÚBÚSÚvÚbÚq)ÚdebugÚdont_write_bytecodeÚno_siteÚverboseÚ bytes_warningÚquietrrXz-Iz-Ez-sÚ _xoptionsÚdevézerror::BytesWarningzdefault::BytesWarningÚdefaultz-W)z-Xrl)Z faulthandlerÚ tracemallocZ importtimeZshowalloccountZ showrefcountÚutf8Tz%s=%sz-X) r^ÚitemsÚgetattrrQrZr\ÚisolatedÚignore_environmentÚ no_user_siteÚ warnoptionsrirSÚextend) Z flag_opt_mapr]ÚflagÚoptrbZwarnoptsriZxoptionsÚdev_moderÚargrrr Ú_args_from_interpreter_flagssN              r|)rc Os>t||Ž*}y |j|dS| ¡‚YnXWdQRXdS)N)r)r&ÚwaitÚkill)rÚ popenargsÚkwargsÚprrr r)Ks   cOs6t||Ž}|r2| d¡}|dkr(|d}t||ƒ‚dS)Nr]r)r)Úgetr )rr€Úretcoder rrr r*\s   cOsTd|krtdƒ‚d|kr<|ddkr<| dd¡r4dnd|d<t|t|dd œ|—ŽjS) Nrz3stdout argument not allowed, it will be overridden.ÚinputÚuniversal_newlinesFÚóT)rrÚcheck)rr‚r.r'r)rrr€rrr r-os #c@s&eZdZddd„Zdd„Zdd„ZdS) r0NcCs||_||_||_||_dS)N)r]r rr)rr]r rrrrr r©szCompletedProcess.__init__cCshd |j¡d |j¡g}|jdk r4| d |j¡¡|jdk rP| d |j¡¡d t|ƒjd |¡¡S)Nz args={!r}zreturncode={!r}z stdout={!r}z stderr={!r}z{}({})z, ) Úformatr]r rr\rÚtyperÚjoin)rr]rrr rJ¯s   zCompletedProcess.__repr__cCs |jrt|j|j|j|jƒ‚dS)N)r r r]rr)rrrr Úcheck_returncode¸sz!CompletedProcess.check_returncode)NN)rrrrrJrŒrrrr r0žs  F)r„Úcapture_outputrrˆc Os |dk r&| d¡dk rtdƒ‚t|d<|r^| d¡dk sF| d¡dk rNtdƒ‚t|d<t|d<t||Ž¢}y|j||d\}}Wn^tk rÊ} z,| ¡tr°| ¡\| _| _ n|  ¡‚Wdd} ~ XYn| ¡‚YnX|  ¡} |r| rt | |j ||d‚WdQRXt|j | ||ƒS)NÚstdinz/stdin and input arguments may not both be used.rrz@stdout and stderr arguments may not be used with capture_output.)r)r r)r‚rr'r&Ú communicaterr~Ú _mswindowsrrr}Úpollr r]r0) r„rrrˆrr€ZprocessrrÚexcrƒrrr r.¿s4  cCsèg}d}xÔ|D]Ì}g}|r$| d¡d|kp8d|kp8| }|rH| d¡xj|D]b}|dkrf| |¡qN|dkr”| dt|ƒd¡g}| d¡qN|r¦| |¡g}| |¡qNW|rÂ| |¡|r| |¡| d¡qWd |¡S) NFú ú ú"ú\éz\"r†)r\Úlenrwr‹)ÚseqÚresultZ needquoter{Zbs_bufÚcrrr Ú list2cmdlines4         rœc Cslyt|ddtd}d}Wn.tk rF}z|j}|j}Wdd}~XYnX|dd…dkrd|dd…}||fS)NT)ÚshellÚtextrrrUÚ )r-r(r r r )r ÚdataZexitcodeZexrrr r+Ms cCs t|ƒdS)Nrm)r+)r rrr r,ls c@s”eZdZdZdFddddœdd „Zed d „ƒZejd d „ƒZd d„Zdd„Z dd„Z e j e jfdd„Zdd„Zdd„ZdGdd„Zdd„Zdd„ZdHdd „ZdId!d"„Zerd#d$„Zd%d&„Zd'd(„Zd)d*„Zdejejejfd+d,„Z d-d.„Z!d/d0„Z"d1d2„Z#d3d4„Z$d5d6„Z%e%Z&n‚d7d$„Zd8d*„Ze'j(e'j)e'j*e'j+e'j,e'j-fd9d:„Z.de'j/e'j0e1j2fd;d,„Z dd.„Z!d?d2„Z#d@dA„Z4dBd4„Z$dCd6„Z%dDdE„Z&dS)Jr&FrUNTrr)ÚencodingÚerrorsržcCsZtƒt ¡|_d|_d|_|dkr(d}t|tƒs:tdƒ‚t rP|dk rˆt dƒ‚n8|rh|sht   dt ¡d}| dk rxt dƒ‚|dkrˆt d ƒ‚||_d|_d|_d|_d|_d|_||_||_|dk rà| dk ràt| ƒt|ƒkràtd ƒ‚| |||¡\}}}}}}t rN|dkrt | ¡d¡}|dkr4t | ¡d¡}|dkrNt | ¡d¡}|pb|pb|pb| |_d |_d|_yÜ|dkr²t  |d |¡|_|jr²tj!|jd|d k||d|_|dkrèt  |d|¡|_|jrètj!|j||d|_|dkrt  |d|¡|_|jrtj!|j||d|_| "|||||| | | || ||||||||¡WnxDt#d|j|j|jfƒD]*}y | $¡Wnt%k r”YnXqnW|jsNg}|t&kr¼| '|¡|t&krÐ| '|¡|t&krä| '|¡t(|dƒrü| '|j)¡xP|D]H}y*t r$t|t*ƒr$| +¡n t, $|¡Wnt%k rFYnXqW‚YnXdS)NFrUzbufsize must be an integerz0preexec_fn is not supported on Windows platformszpass_fds overriding close_fds.Tz2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformszlCannot disambiguate when both text and universal_newlines are supplied but different. Pass one or the other.gÐ?Úwbrm)Ú write_throughÚline_bufferingr¡r¢Úrb)r¡r¢Ú_devnull)-rMÚ threadingZLockÚ _waitpid_lockÚ_inputÚ_communication_startedÚ isinstancerGÚ TypeErrorrrÚwarningsÚwarnÚRuntimeWarningr]rŽrrÚpidr r¡r¢ÚboolrÚ _get_handlesÚmsvcrtZopen_osfhandlerHÚ text_modeÚ_sigint_wait_secsÚ_closed_child_pipe_fdsÚioÚopenÚ TextIOWrapperÚ_execute_childÚfilterÚcloseÚOSErrorr'r\Úhasattrr§rCrFÚos)rr]ÚbufsizeÚ executablerŽrrÚ preexec_fnÚ close_fdsrÚcwdÚenvr…Ú startupinfoÚ creationflagsÚrestore_signalsÚstart_new_sessionÚpass_fdsr¡r¢ržÚp2creadÚp2cwriteÚc2preadÚc2pwriteÚerrreadÚerrwriteÚfZto_closeÚfdrrr r©s°                            zPopen.__init__cCs|jS)N)rµ)rrrr r…>szPopen.universal_newlinescCst|ƒ|_dS)N)r²rµ)rr…rrr r…DscCs | ||¡}| dd¡ dd¡S)Nz rŸú )ÚdecodeÚreplace)rr r¡r¢rrr Ú_translate_newlinesHs zPopen._translate_newlinescCs|S)Nr)rrrr Ú __enter__LszPopen.__enter__cCsˆ|jr|j ¡|jr |j ¡z|jr2|j ¡Wd|tkrz|jdkrpy|j|jdWntk rnYnXd|_dS| ¡XdS)Nr)r) rr½rrŽÚKeyboardInterruptr¶Ú_waitrr})rÚexc_typerÚ tracebackrrr Ú__exit__Os    zPopen.__exit__cCsT|js dS|jdkr(|d|jt|d|j|d|jdkrPtdk rPt |¡dS)Nzsubprocess %s is still running)Úsource)rN)Ú_child_createdr r±ÚResourceWarningrPrOr\)rZ_maxsizeZ_warnrrr rLks    z Popen.__del__cCs"t|dƒst tjtj¡|_|jS)Nr§)r¿rÀr¹ÚdevnullÚO_RDWRr§)rrrr Ú _get_devnullzs zPopen._get_devnullc Cs²|rZy|j |¡WnDtk r(Yn2tk rX}z|jtjkrFn‚Wdd}~XYnXy|j ¡WnDtk r|Yn2tk r¬}z|jtjkršn‚Wdd}~XYnXdS)N)rŽÚwriteÚBrokenPipeErrorr¾ÚerrnoZEINVALr½)rr„r’rrr Ú _stdin_writes"  zPopen._stdin_writec CsT|jr|rtdƒ‚|dkr”|js”|j|j|jg d¡dkr”d}d}|jrT| |¡n6|jrp|j ¡}|j ¡n|jrŠ|j ¡}|j ¡|  ¡n¸|dk r¨t ƒ|}nd}z„y|  |||¡\}}Wnht k r,|dk ròt |j| |¡ƒ}n|j}d|_y|j|dWntk r$YnX‚YnXWdd|_X|j | |¡d}||fS)Nz.Cannot send input after starting communicationr—r)rT)r«rrŽrrÚcountrçÚreadr½r}Ú_timeÚ _communicaterÙÚminr¶Ú_remaining_timerÚr)rr„rrrÚendtimeÚsigint_timeoutÚstsrrr r˜sD         zPopen.communicatecCs| ¡S)N)rP)rrrr r‘Üsz Popen.pollcCs|dkr dS|tƒSdS)N)rê)rrîrrr ríâszPopen._remaining_timecCsL|dkr dS|stƒ|krHt|j||r0d |¡nd|r@d |¡ndd‚dS)Nr‡)r r)rêrr]r‹)rrîÚ orig_timeoutZ stdout_seqZ stderr_seqÚskip_check_and_raiserrr Ú_check_timeoutêszPopen._check_timeoutc Csˆ|dk rtƒ|}y |j|dStk r‚|dk rJt|j| |¡ƒ}n|j}d|_y|j|dWntk rzYnX‚YnXdS)N)rr)rêrÚrÙrìr¶rír)rrrîrïrrr r}ös  z Popen.waitc Cs~|dkr|dkr|dkrdSd\}}d\}}d\}} |dkrtt tj¡}|dkrÜt dd¡\}} t|ƒ}t | ¡nh|tkr t dd¡\}}t|ƒt|ƒ}}n<|tkr¸t  |  ¡¡}n$t |t ƒrÎt  |¡}nt  |  ¡¡}| |¡}|dkr*t tj¡}|dkr˜t dd¡\} }t|ƒ}t | ¡nn|tkrXt dd¡\}}t|ƒt|ƒ}}n@|tkrrt  |  ¡¡}n&t |t ƒrŠt  |¡}nt  |  ¡¡}| |¡}|dkræt tj¡} | dkrdt dd¡\} } t| ƒ} t | ¡n~|tkrt dd¡\}} t|ƒt| ƒ}} nP|tkr$|} n@|tkr>t  |  ¡¡} n&t |t ƒrVt  |¡} nt  |  ¡¡} | | ¡} |||||| fS)N)rUrUrUrUrUrU)rUrUr)rKZ GetStdHandler3Z CreatePiperCrEr'r/r´Z get_osfhandlerãr¬rGÚfilenoÚ_make_inheritabler4r5r() rrŽrrrÌrÍrÎrÏrÐrÑÚ_rrr r³sn                        zPopen._get_handlescCs&t t ¡|t ¡ddtj¡}t|ƒS)Nrrm)rKZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSrC)rÚhandleÚhrrr rõZs  zPopen._make_inheritablecCstdd„|DƒƒS)NcSs,h|]$}|d@dks$t |¡tjkr|’qS)é)rKZ GetFileTypeZFILE_TYPE_CHAR)Ú.0r÷rrr ú js z,Popen._filter_handle_list..)r#)rr!rrr Ú_filter_handle_listcszPopen._filter_handle_listc CsDt|tƒst|ƒ}|dkr"tƒ}n| ¡}d| ||fk}|r^|jtjO_| |_||_ ||_ |j }t |oxd|kox|dƒ}|sˆ|rú|rú|dkrši}|_ t | dg¡ƒ}|d<|rÐ|t| ƒt|ƒt|ƒg7}| |¡|dd…<|rú|söt dt¡d}| rˆ|jtjO_tj|_|sxtj d¡}|sdtj dd¡}tj |dd ¡}tj |¡sdtd ƒ‚tj |¡r||}n|}d  ||¡}z@t ||ddt| ƒ| ||dk r¶t |¡nd|¡ \}}}}Wd| dkrÜ|   ¡|dkrî|  ¡|dkr|  ¡t!|d ƒrt "|j#¡d |_$Xd |_%t&|ƒ|_'||_(t )|¡dS)NrUr!z?startupinfo.lpAttributeList['handle_list'] overriding close_fdsFZComSpecZ SystemRootr†ZSystem32zcmd.exez:shell not found: neither %ComSpec% nor %SystemRoot% is setz {} /c "{}"r§T)*r¬Ústrrœrr$rrKr7rrrr r²r#r‚rGrür®r¯r°r8r6rrÀÚenvironÚpathr‹ÚisabsÚFileNotFoundErrorr‰Z CreateProcessÚfspathrFr¿r½r§r·rßrCÚ_handler±rE)rr]rÂrÃrÄrËrÅrÆrÇrÈrrÌrÍrÎrÏrÐrÑZunused_restore_signalsZunused_start_new_sessionZuse_std_handlesZattribute_listZhave_handle_listr!ZcomspecZ system_rootZhpZhtr±Útidrrr r»ps|            zPopen._execute_childcCs,|jdkr&||jdƒ|kr&||jƒ|_|jS)Nr)r r)rrNZ_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessrrr rPás  zPopen._internal_pollcCs^|dkrtj}n t|dƒ}|jdkrXt |j|¡}|tjkrJt|j|ƒ‚t  |j¡|_|jS)Niè) rKZINFINITErGr ÚWaitForSingleObjectrZ WAIT_TIMEOUTrr]ÚGetExitCodeProcess)rrZtimeout_millisršrrr rÚòs    z Popen._waitcCs| | ¡¡| ¡dS)N)r\rér½)rZfhÚbufferrrr Ú _readerthreadszPopen._readerthreadcCs\|jrBt|dƒsBg|_tj|j|j|jfd|_d|j_|j ¡|j r„t|dƒs„g|_ tj|j|j |j fd|_ d|j _|j  ¡|j r”|  |¡|jdk rÆ|j | |¡¡|j ¡rÆt|j|ƒ‚|j dk rø|j  | |¡¡|j  ¡røt|j|ƒ‚d}d}|jr|j}|j ¡|j r0|j }|j  ¡|dk rB|d}|dk rT|d}||fS)NÚ _stdout_buff)Útargetr]TÚ _stderr_buffr)rr¿r r¨ZThreadrZ stdout_threadZdaemonÚstartrr Z stderr_threadrŽrçr‹ríZis_aliverr]r½)rr„rîrñrrrrr rësF             zPopen._communicatecCsl|jdk rdS|tjkr"| ¡nF|tjkr>t |jtj¡n*|tjkrZt |jtj¡nt d  |¡ƒ‚dS)NzUnsupported signal: {}) r rÚSIGTERMÚ terminateZ CTRL_C_EVENTrÀr~r±ZCTRL_BREAK_EVENTrr‰)rÚsigrrr Ú send_signal;s     zPopen.send_signalcCsX|jdk rdSyt |jd¡Wn2tk rRt |j¡}|tjkrH‚||_YnXdS)Nrm)r rKZTerminateProcessrÚPermissionErrorrZ STILL_ACTIVE)rZrcrrr rIs   zPopen.terminatec Cs,d\}}d\}}d\}} |dkr"n@|tkr8t ¡\}}n*|tkrJ| ¡}nt|tƒrZ|}n| ¡}|dkrln@|tkr‚t ¡\}}n*|tkr”| ¡}nt|tƒr¤|}n| ¡}|dkr¶nf|tkrÌt ¡\}} nP|tkrî|dkrâ|} n t j  ¡} n.|tkr| ¡} nt|tƒr|} n| ¡} |||||| fS)N)rUrUrU) r'rÀÚpiper/rãr¬rGrôr(rQÚ __stdout__) rrŽrrrÌrÍrÎrÏrÐrÑrrr r³^sJ        c*sÂt|ttfƒr|g}nt|ƒ}| rLttdƒr0dnd}|dg|}ˆrLˆ|d<ˆdkr\|d‰ˆ}t ¡\}}g}x |dkr| |¡t  |¡}qrWx|D]}t  |¡q˜WzÖzî|dk rg}xL|  ¡D]:\}}t  |¡}d|krêt dƒ‚| |dt  |¡¡qÈWnd}t  ˆ¡‰tj ˆ¡r,ˆf}nt‡fd d „t |¡Dƒƒ}t|ƒ}| |¡t |||tttt|ƒƒƒ||| | | ||||||||¡|_d |_Wdt  |¡Xt|d dƒ}| d krÞ| d krÞ| |krÞt  | ¡|d kr| d kr||krt  |¡|d kr.|d kr.||kr.t  |¡|dk rBt  |¡d |_tƒ}x0t |d¡} || 7}| rxt|ƒdkrPPqPWWdt  |¡X|r¾y6t  |jd¡\}!}"|!|jkrÂ| !|"¡ntj"|_#Wnt$k râYnXy| %dd¡\}#}$}%|% &¡}%Wn,t k r.d}#d}$d 't|ƒ¡}%YnXtt(|# &d¡t)ƒ}&t*|&t+ƒr¶|$r¶t|$dƒ}'|%dk}(|(rvd}%|})n|})|'dkrªt ,|'¡}%|'t-j.krª|%dt/|)ƒ7}%|&|'|%|)ƒ‚|&|%ƒ‚dS)NZgetandroidapilevelz/system/bin/shz/bin/shz-crrùó=z!illegal environment variable namec3s"|]}tj t |¡ˆ¡VqdS)N)rÀrÿr‹Úfsencode)rúÚdir)rÂrr ú Ïsz'Popen._execute_child..Tr§rUiPÃó:r—sSubprocessErroró0z#Bad exception data from child: {!r}ÚasciiéZnoexecr†z: )0r¬rýÚbytesr#r¿rQrÀrr\Údupr½rqrrrÿÚdirnameÚtupleÚ get_exec_pathÚsetÚaddÚ_posixsubprocessZ fork_execÚsortedÚmaprGr±rßrrr·Ú bytearrayrér˜ÚwaitpidÚ_handle_exitstatusrRr ÚChildProcessErrorÚsplitrÕr‰ÚbuiltinsrÚ issubclassr¾ÚstrerrorræÚENOENTÚrepr)*rr]rÂrÃrÄrËrÅrÆrÇrÈrrÌrÍrÎrÏrÐrÑrÉrÊZ unix_shellZorig_executableZ errpipe_readZ errpipe_writeZlow_fds_to_closeZlow_fdZenv_listÚkrbZexecutable_listZ fds_to_keepZ devnull_fdZ errpipe_dataÚpartr±rðZexception_nameZ hex_errnoZerr_msgZchild_exception_typeZ errno_numZchild_exec_never_calledZ err_filenamer)rÂr r»”s¾                                 cCsL||ƒr||ƒ |_n2||ƒr*||ƒ|_n||ƒr@||ƒ |_ntdƒ‚dS)NzUnknown child exit status!)r r)rrðZ _WIFSIGNALEDZ _WTERMSIGZ _WIFEXITEDZ _WEXITSTATUSZ _WIFSTOPPEDZ _WSTOPSIGrrr r(#s zPopen._handle_exitstatusc Cs®|jdkr¨|j d¡sdSz€y8|jdk r.|jS||j|ƒ\}}||jkrR| |¡WnBtk r–}z$|dk rv||_n|j|kr†d|_Wdd}~XYnXWd|j ¡X|jS)NFr)r r©Úacquirer±r(r¾ræÚrelease)rrNZ_waitpidZ_WNOHANGZ_ECHILDr±rðÚerrr rP5s      cCs>yt |j|¡\}}Wntk r4|j}d}YnX||fS)Nr)rÀr'r±r))rZ wait_flagsr±rðrrr Ú _try_waitXs  zPopen._try_waitc Cs|jdk r|jS|dk r¶tƒ|}d}xà|j d¡rxz6|jdk rBP| tj¡\}}||jkrh| |¡PWd|j  ¡X|  |¡}|dkr–t |j |ƒ‚t |d|dƒ}t |¡q(WnRxP|jdkr|j4|jdk rØP| d¡\}}||jkrú| |¡WdQRXq¸W|jS)Ngü©ñÒMb@?Frr—gš™™™™™©?)r rêr©r2r5rÀÚWNOHANGr±r(r3rírr]rìÚtimeZsleep)rrrîZdelayr±rðZ remainingrrr rÚes8           c Cs,|jrX|jsXy|j ¡Wntk r.YnX|sXy|j ¡Wntk rVYnXd}d}|jsi|_|jr~g|j|j<|jrg|j|j<|jr¢|j|j}|jr´|j|j}| |¡|j rÎt |j ƒ}t ƒÆ}|jrò|rò|  |jt j¡|jr|jjs|  |jt j¡|jr6|jjs6|  |jt j¡x^| ¡r–| |¡}|dk r~|dkr~|j||||ddtdƒ‚| |¡} | ||||¡xø| D]ð\} } | j|jkr<||j|jt…} y|jt | j| ¡7_Wn,tk r| | j¡| j ¡Yn*X|jt|j ƒkrŒ| | j¡| j ¡nP| j|j|jfkržt | jd¡} | sz| | j¡| j ¡|j| j | ¡qžWq:WWdQRX|j | |¡d|dk rÈd !|¡}|dk rÜd !|¡}|j"r$|dk r| #||jj$|jj%¡}|dk r$| #||jj$|jj%¡}||fS)NrT)ròzN_check_timeout(..., skip_check_and_raise=True) failed to raise TimeoutExpired.i€)rr‡)&rŽr«Úflushrår½Z_fileobj2outputrrÚ _save_inputrªÚ memoryviewÚ_PopenSelectorÚregisterÚ selectorsZ EVENT_WRITErDZ EVENT_READZget_mapríróÚ RuntimeErrorÚselectZfileobjÚ _input_offsetÚ _PIPE_BUFrÀrärÓZ unregisterr˜rér\r}r‹rµr×r¡r¢)rr„rîrñrrZ input_viewZselectorrZreadyÚkeyZeventsÚchunkr rrr rëŽs–                (        cCsF|jrB|jdkrBd|_||_|dk rB|jrB|j |jj|jj¡|_dS)Nr)rŽrªr@rµÚencoder¡r¢)rr„rrr r9ôs  zPopen._save_inputcCs|jdkrt |j|¡dS)N)r rÀr~r±)rrrrr rs cCs| tj¡dS)N)rrr )rrrr rscCs| tj¡dS)N)rrÚSIGKILL)rrrr r~ sz Popen.kill)rUNNNNNTFNNNNrTFr)NN)F)N)5rrrrßrrr…rr×rØrÝrQrRr®r¯rLrãrçrr‘rírór}rr³rõrür»rKrZ WAIT_OBJECT_0rrPrÚrrërrr~rÀÚ WIFSIGNALEDÚWTERMSIGÚ WIFEXITEDÚ WEXITSTATUSÚ WIFSTOPPEDÚWSTOPSIGr(r'r6ræZECHILDr5r9rrrr r&ysj.  D H  q46" )f )DrQÚplatformrr¸rÀr7rr+r®rærrêÚ Exceptionrr rr¨r´rKrr#r?r=rrrAr¿r%r;ZSelectSelectorÚ__all__r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrwrGrCrOrMr'r(r/r^r|r)r*r-Úobjectr0r.rœr+r,r&rrrr Ú,sx  %     P      ;/"DI