[{@sddlZddlZddlmZddlmZddlmZddlmZddlmZdgZGd d d e Z Gd ddej Z dS) N)context) popen_fork) reduction)spawn)utilPopenc@s(eZdZddZddZdS)_DupFdcCs ||_dS)N)fd)selfr r 7/usr/lib/python3.4/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 s  r csFeZdZdZeZfddZddZddZS)rrcsg|_tj|dS)N)_fdssuperr)r process_obj) __class__r r rs zPopen.__init__cCs|jj||S)N)rappend)r r r r r duplicate_for_child#szPopen.duplicate_for_childc Csddlm}|j}|jj|tj|j}tj }t j |z$t j ||t j ||Wdt j dXd}}}} ztj\}}tj\}} tjd|d|} |jj||gtjtj| |j|_||_t| ddd} | j|jWdQXWd|dk rztj|tj|fnx3||| fD]"} | dk rtj| qqWXdS)Nr)semaphore_tracker tracker_fdZ pipe_handlewbclosefdF)rZgetfdrrrZget_preparation_data_nameioBytesIOrZset_spawning_popenrdumpospipeZget_command_lineextendrZspawnv_passfdsZget_executablepidsentinelopenwrite getbufferZFinalizeclose) r rrrZ prep_datafpZparent_rZchild_wZchild_rZparent_wcmdfr r r r _launch's6       z Popen._launch) rrrmethodr ZDupFdrrr.r r )rr rs  ) rr"rrrrrr__all__objectr rr r r r s