o
0iI @ s6 d dl Z d dlZddlmZ dgZG dd deZdS ) N )utilPopenc @ s` e Zd ZdZdd Zdd ZejfddZdd d
Z dd Z
d
d Zdd Zdd Z
dd ZdS )r forkc C s" t d | _d | _| | d S N)r Z_flush_std_streams
returncode finalizer_launch)selfprocess_obj r A/opt/alt/python310/lib64/python3.10/multiprocessing/popen_fork.py__init__ s zPopen.__init__c C s |S r r )r
fdr r r
duplicate_for_child s zPopen.duplicate_for_childc C sR | j d u r&zt| j|\}}W n
ty Y d S w || jkr&t|| _ | j S r )r oswaitpidpidOSErrorwaitstatus_to_exitcode)r
flagr stsr r r
poll s
z
Popen.pollNc C sP | j d u r%|d urddlm} || jg|sd S | |dkr"tjS dS | j S )Nr )waitg )r Zmultiprocessing.connectionr sentinelr r WNOHANG)r
timeoutr r r r
r $ s
z
Popen.waitc C s\ | j d u r,z
t| j| W d S ty Y d S ty+ | jddd u r( Y d S w d S )Ng?)r )r r killr ProcessLookupErrorr r )r
Zsigr r r
_send_signal. s
zPopen._send_signalc C | tj d S r )r signalSIGTERMr
r r r
terminate8 zPopen.terminatec C r r )r r! SIGKILLr# r r r
r ; r% z
Popen.killc C s d}t \}}t \}}t | _| jdkr7zt | t | |j|d}W t | d S t | w t | t | t| tj ||f| _
|| _d S )Nr r )Zparent_sentinel)r piper r close
_bootstrap_exitr ZFinalizeZ close_fdsr r )r
r codeZparent_rZchild_wZchild_rZparent_wr r r
r > s
z
Popen._launchc C s | j d ur| d S d S r )r r# r r r
r( Q s
zPopen.closer )__name__
__module____qualname__methodr r r r r r r r$ r r r( r r r r
r s
)r r! r __all__objectr r r r r