3 \p@spddlZddlZddlmZmZddlmZddlmZddlmZdgZ Gdd d e Z Gd ddej Z dS) N) reductionset_spawning_popen) popen_fork)spawn)utilPopenc@seZdZddZddZdS)_DupFdcCs ||_dS)N)fd)selfr r 9/usr/lib64/python3.6/multiprocessing/popen_spawn_posix.py__init__sz_DupFd.__init__cCs|jS)N)r )r r r r detachsz _DupFd.detachN)__name__ __module__ __qualname__rrr r r r r sr cs4eZdZdZeZfddZddZddZZ S)rrcsg|_tj|dS)N)_fdssuperr)r process_obj) __class__r r rszPopen.__init__cCs|jj||S)N)rappend)r r r r r duplicate_for_child"s zPopen.duplicate_for_childc Cs@ddlm}|j}|jj|tj|j}tj }t |zt j ||t j ||Wdt dXd}}}} z~t j\}}t j\}} tj||d} |jj||gtjtj| |j|_||_t| ddd} | j|jWdQRXWd|dk rtj|t j|fx(||| fD]} | dk rt j| qWXdS)Nr)semaphore_tracker) tracker_fdZ pipe_handlewbF)closefd)rZgetfdrrrZget_preparation_data_nameioBytesIOrrdumpospipeZget_command_lineextendrZspawnv_passfdsZget_executablepidsentinelopenwrite getbufferZFinalizeclose) r rrrZ prep_datafpZparent_rZchild_wZchild_rZparent_wcmdfr r r r _launch&s6           z Popen._launch) rrrmethodr ZDupFdrrr. __classcell__r r )rr rs  ) rr"contextrrrrrr__all__objectr rr r r r s