U e5d@spddlZddlZddlmZmZddlmZddlmZddlmZdgZ Gdd d e Z Gd ddej Z dS) N) reductionset_spawning_popen) popen_fork)spawn)utilPopenc@seZdZddZddZdS)_DupFdcCs ||_dSNfdselfr r9/usr/lib64/python3.8/multiprocessing/popen_spawn_posix.py__init__sz_DupFd.__init__cCs|jSr r )rrrrdetachsz _DupFd.detachN)__name__ __module__ __qualname__rrrrrrr sr cs4eZdZdZeZfddZddZddZZ S)rrcsg|_t|dSr )_fdssuperr)r process_obj __class__rrrszPopen.__init__cCs|j||Sr )rappendr rrrduplicate_for_child"s zPopen.duplicate_for_childc CsXddlm}|}|j|t|j}t }t |zt ||t ||W5t dXd}}}} z~t\}}t\}} tj||d} |j||gt t| |j|_||_t| ddd} | |W5QRXW5g} || fD]} | dk r| | qt |t j| |_||fD]} | dk r6t| q6XdS)Nr)resource_tracker) tracker_fdZ pipe_handlewbF)closefd)rZgetfdrrrZget_preparation_data_nameioBytesIOrrdumprZFinalizeZ close_fds finalizerosclosepipeZget_command_lineextendZspawnv_passfdsZget_executablepidsentinelopenwrite getbuffer)rrrrZ prep_datafpZparent_rZchild_wZchild_rZparent_wZ fds_to_closer cmdfrrr_launch&sB            z Popen._launch) rrrmethodr ZDupFdrrr3 __classcell__rrrrrs  ) r#r'contextrrr!rrr__all__objectr rrrrrs