f _c@spddlZddlZddlmZmZddlmZddlmZddlmZdgZ Gdd d e Z Gd ddej Z dS) iN) reductionset_spawning_popen) popen_fork)spawn)utilPopenc@seZdZddZddZdS)_DupFdcCs ||_dSNfdselfr r :/usr/lib64/python3.10/multiprocessing/popen_spawn_posix.py__init__z_DupFd.__init__cCs|jSrr )r r r rdetachrz _DupFd.detachN)__name__ __module__ __qualname__rrr r r rrsrcs4eZdZdZeZfddZddZddZZ S)rrcsg|_t|dSr)_fdsZsuperr)r process_objZ __class__r rrszPopen.__init__cCs|j||Sr)rappendr r r rduplicate_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_handleZwbF)Zclosefd)rZgetfdrrrZget_preparation_dataZ_nameioZBytesIOrrZdumposZpipeZget_command_lineZextendrZspawnv_passfdsZget_executableZpidZsentinelZopenZwriteZ getbufferZFinalizeZ close_fdsZ finalizerZclose)r rrrZ prep_dataZfpZparent_rZchild_wZchild_rZparent_wZcmdZfZ fds_to_closer r r r_launch&sP       0        z Popen._launch) rrrZmethodrZDupFdrrrZ __classcell__r r rrrs  ) rrZcontextrrrrrrZ__all__Zobjectrrr r r rZs