a ÕDOgI ã@s6ddlZddlZddlmZdgZGdd„deƒZdS)éNé)ÚutilÚPopenc@s`eZdZdZdd„Zdd„Zejfdd„Zdd d „Z d d „Z d d„Z dd„Z dd„Z dd„ZdS)rÚforkcCs"t ¡d|_d|_| |¡dS©N)rZ_flush_std_streamsÚ returncodeÚ finalizerÚ_launch)ÚselfÚ process_obj©r ú?/opt/alt/python39/lib64/python3.9/multiprocessing/popen_fork.pyÚ__init__szPopen.__init__cCs|Srr )r Úfdr r r Úduplicate_for_childszPopen.duplicate_for_childcCsR|jdurLzt |j|¡\}}Wnty4YdS0||jkrLt |¡|_|jSr)rÚosÚwaitpidÚpidÚOSErrorÚwaitstatus_to_exitcode)r ÚflagrÚstsr r r Úpolls    z Popen.pollNcCsN|jdurH|dur0ddlm}||jg|ƒs0dS| |dkrBtjnd¡S|jS)Nr)Úwaitg)rZmultiprocessing.connectionrÚsentinelrrÚWNOHANG)r Útimeoutrr r r r$s  z Popen.waitcCsV|jdurRzt |j|¡Wn4ty.Yn$tyP|jdddurL‚Yn0dS)Ngš™™™™™¹?)r)rrÚkillrÚProcessLookupErrorrr)r Zsigr r r Ú _send_signal.s   zPopen._send_signalcCs| tj¡dSr)rÚsignalÚSIGTERM©r r r r Ú terminate8szPopen.terminatecCs| tj¡dSr)rr ÚSIGKILLr"r r r r;sz Popen.killc Cs¢d}t ¡\}}t ¡\}}t ¡|_|jdkrnz.t |¡t |¡|j|d}Wt |¡qžt |¡0n0t |¡t |¡t |tj ||f¡|_ ||_ dS)Nrr)Zparent_sentinel) rÚpiperrÚcloseÚ _bootstrapÚ_exitrZFinalizeZ close_fdsrr)r r ÚcodeZparent_rZchild_wZchild_rZparent_wr r r r >s          ÿz Popen._launchcCs|jdur| ¡dSr)rr"r r r r&Qs z Popen.close)N)Ú__name__Ú __module__Ú __qualname__Úmethodrrrrrrrr#rr r&r r r r r s  )rr ÚrÚ__all__Úobjectrr r r r Ús