3 \ @s>ddlZddlZddlZddlmZdgZGdddeZdS)N)utilPopenc@sHeZdZdZddZddZejfddZdd d Z d d Z d dZ dS)rforkcCstjd|_|j|dS)N)rZ_flush_std_streams returncode_launch)self process_objr 2/usr/lib64/python3.6/multiprocessing/popen_fork.py__init__szPopen.__init__cCs|S)Nr )rfdr r r duplicate_for_childszPopen.duplicate_for_childcCs|jdkrzx>ytj|j|\}}Wn tk rB}zdSd}~Xq XPq W||jkrztj|rntj| |_n tj||_|jS)N)roswaitpidpidOSError WIFSIGNALEDWTERMSIG WEXITSTATUS)rflagrstser r r polls    z Popen.pollNcCsN|jdkrH|dk r0ddlm}||jg|s0dS|j|dkrBtjndS|jS)Nr)waitg)rZmultiprocessing.connectionrsentinelrrWNOHANG)rtimeoutrr r r r+s  z Popen.waitc Cs\|jdkrXytj|jtjWn8tk r2Yn&tk rV|jdddkrRYnXdS)Ng?)r) rrkillrsignalSIGTERMProcessLookupErrorrr)rr r r terminate5s zPopen.terminatec Csd}tj\}}tj|_|jdkrdz0tj|dtjkrJddl}|j|j }Wdtj |Xn"tj|t j |tj|f||_ dS)Nrrrandom)rpiperrclosesysmodulesr#Zseed _bootstrap_exitrZFinalizer)rr codeZparent_rZchild_wr#r r r r?s       z Popen._launch)N) __name__ __module__ __qualname__methodr rrrrrr"rr r r r r s  )rr&rr__all__objectrr r r r s