f _@spddlZddlZddlmZmZddlmZddlmZddlmZdgZ Gdd d e Z Gd ddej Z dS) N) reductionset_spawning_popen) popen_fork)spawn)utilPopenc@seZdZddZddZdS)_DupFdcCs ||_dSNfdselfr r:/usr/lib64/python3.10/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 Csddlm}|}|j|t|j}t }t |z$t ||t ||Wt dn t d0d}}}} zt \}}t \}} tj||d} |j||gtt| |j|_||_t| ddd} | |Wdn1s0YWg} || fD]} | dur| | qt|tj| |_||fD]} | durRt | qRn`g} || fD]} | dur|| | q|t|tj| |_||fD]} | durt | q0dS)Nr)resource_tracker) tracker_fdZ pipe_handlewbF)closefd)rZgetfdrrrZget_preparation_data_nameioBytesIOrrdumpospipeZget_command_lineextendrspawnv_passfdsZget_executablepidsentinelopenwrite getbufferFinalize close_fds finalizerclose)rrrrZ prep_datafpparent_rchild_wchild_rparent_wcmdfZ fds_to_closer rrr_launch&sP       0        z Popen._launch) rrrmethodr DupFdrrr: __classcell__rrrrrs  ) r#r&contextrrr!rrr__all__objectr rrrrrs