python (3.12.0)

(root)/
lib/
python3.12/
asyncio/
__pycache__/
unix_events.cpython-312.opt-2.pyc

ˑep	ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZdZe	j4dk(reddZdZGddej<ZGddej@Z!GddejDejFZ$GddejJZ&GddZ'Gdde'Z(Gdd e'Z)Gd!d"e)Z*Gd#d$e)Z+Gd%d&e'Z,Gd'd(e'Z-d)Z.Gd*d+ej^Z0eZ1e0Z2y),N)base_events)base_subprocess)	constants)
coroutines)events)
exceptions)futures)selector_events)tasks)
transports)logger)SelectorEventLoopAbstractChildWatcherSafeChildWatcherFastChildWatcherPidfdChildWatcherMultiLoopChildWatcherThreadedChildWatcherDefaultEventLoopPolicywin32z+Signals are not really supported on Windowsc	yN)signumframes  G/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/asyncio/unix_events.py_sighandler_noopr*scP	tj|S#t$r|cYSwxYwr)oswaitstatus_to_exitcode
ValueError)statuss rr"r"/s.((00
	s%%ceZdZ	dfd	ZfdZdZdZdZdZdZ			dd	Z
		dd
Z	ddZdZ
	ddddddd
dZ	dddddddddZdZdZdZdZxZS)_UnixSelectorEventLoopNc2t||i|_yr)super__init___signal_handlers)selfselector	__class__s  rr)z_UnixSelectorEventLoop.__init__?s
" "rc0t|tjs,t	|j
D]}|j
|y|j
r;tjd|dt||j
jyy)NzClosing the loop z@ on interpreter shutdown stage, skipping signal handlers removalsource)r(closesys
is_finalizinglistr*remove_signal_handlerwarningswarnResourceWarningclear)r+sigr-s  rr1z_UnixSelectorEventLoop.closeCs

  "D112
0**3/
0$$

 1$:HI.%)	+
%%++-
%rc:|D]}|s|j|yr)_handle_signal)r+datars   r_process_self_dataz)_UnixSelectorEventLoop._process_self_dataQs%	(F'		(rcT	tj|stj|rtd|j	||j	t
j|jjtj|||d}||j |<	t
j|t"t
j$|dy#ttf$r}tt|d}~wwxYw#t$r}|j |=|j sI	t
jdn2#ttf$r }t'j(d|Yd}~nd}~wwxYw|j*t*j,k(rtd|dd}~wwxYw)Nz3coroutines cannot be used with add_signal_handler()Fset_wakeup_fd(-1) failed: %ssig  cannot be caught)riscoroutineiscoroutinefunction	TypeError
_check_signal
_check_closedsignal
set_wakeup_fd_csockfilenor#OSErrorRuntimeErrorstrrHandler*rsiginterruptrinfoerrnoEINVAL)r+r:callbackargsexchandlenexcs       radd_signal_handlerz)_UnixSelectorEventLoop.add_signal_handlerXsv	

""8,..x889
93	)

  !3!3!56xtT:%+c"	
MM#/0
U+G$	)s3x((	)	%%c*((F((,"G,FKK >EEFyyELL("T#.?#@AA	sZ-C.0D
D.DD
	F'F"-EF"E2E-(F"-E220F""F'c	|jj|}|y|jr|j|y|j	|yr)r*get
_cancelledr5_add_callback_signalsafe)r+r:rXs   rr<z%_UnixSelectorEventLoop._handle_signalsH@&&**3/>&&s+))&1rc	|j|	|j|=|tjk(rtj
}ntj}	tj|||js	tjdyy#t$rYywxYw#t$r2}|jtjk(rtd|dd}~wwxYw#ttf$r }tjd|Yd}~yd}~wwxYw)NFrBrCr@rAT)rGr*KeyErrorrISIGINTdefault_int_handlerSIG_DFLrMrSrTrNrJr#rrR)r+r:handlerrWs    rr5z,_UnixSelectorEventLoop.remove_signal_handlers		
3	%%c*&--00GnnG	MM#w'$$
A$$R(-			yyELL("T#.?#@AA		(
A:C@@
AsA
BB9C	BB	C(-CCD,DDc	t|tstd||tjvrtd|y)Nzsig must be an int, not zinvalid signal number )
isinstanceintrFrI
valid_signalsr#)r+r:s  rrGz$_UnixSelectorEventLoop._check_signalsO	
#s#6sg>??f**,,5cU;<<-rc t|||||Sr)_UnixReadPipeTransportr+pipeprotocolwaiterextras     r_make_read_pipe_transportz0_UnixSelectorEventLoop._make_read_pipe_transports%dD(FEJJrc t|||||Sr)_UnixWritePipeTransportrks     r_make_write_pipe_transportz1_UnixSelectorEventLoop._make_write_pipe_transports&tT8VUKKrc	lKtj5tjdtt	j
}
ddd
5|
j
std|j}t||||||||f||d|	}|
j|j|j|	|d{	ddd|S#1swYxYw7#ttf$rt$r+|j!|j#d{7wxYw#1swYSxYww)NignorezRasyncio.get_child_watcher() is not activated, subprocess support is not installed.)rnro)r6catch_warningssimplefilterDeprecationWarningrget_child_watcher	is_activerN
create_future_UnixSubprocessTransportadd_child_handlerget_pid_child_watcher_callback
SystemExitKeyboardInterrupt
BaseExceptionr1_wait)
r+rmrVshellstdinstdoutstderrbufsizerokwargswatcherrntransps
             r_make_subprocess_transportz1_UnixSelectorEventLoop._make_subprocess_transports;
$
$
&	1!!(,>?..0G	1	$$&
#$GHH'')F-dHdE,16676396/56F
%%fnn&6$($@$@&
J
!	0
9	1	1( 12
 
lln$$
'	0
seD4/C
D4A-D'>C!CC!	
D4CD4C!!;D$DD$$D''D1,D4cR|j|j|j|yr)call_soon_threadsafe	call_soon_process_exited)r+pid
returncoders    rrz._UnixSelectorEventLoop._child_watcher_callbacks!!$..&2H2H*Ur)sslsockserver_hostnamessl_handshake_timeoutssl_shutdown_timeoutcK|r
|2td|td|td|td||tdtj|}tjtjtj
d}	|j
d|j||d{nf|td|jtjk7s|jtj
k7rtd	||j
d|j||||||
d{\}}	||	fS7#|jxYw7#w)Nz/you have to pass server_hostname when using sslz+server_hostname is only meaningful with ssl1ssl_handshake_timeout is only meaningful with ssl0ssl_shutdown_timeout is only meaningful with ssl3path and sock can not be specified at the same timerFzno path and sock were specified.A UNIX Domain Stream Socket was expected, got )rr)r#r!fspathsocketAF_UNIXSOCK_STREAMsetblockingsock_connectr1familytype_create_connection_transport)
r+protocol_factorypathrrrrr	transportrms
          rcreate_unix_connectionz-_UnixSelectorEventLoop.create_unix_connections& EGG* !NOO$0 GII#/ FHH IKK99T?D==1C1CQGD
  '''d333| !BCCv~~-II!3!33 DTHMOOU#$($E$E"C"7!5%F%77	8(""%4


7s=BE#&E7E	8E<BE#=E!>E#	EEE#dT)rbacklogrrr
start_servingc	Kt|trtd|
|std|
|std||tdt	j
|}t
jtjtj}|ddvrH	tjt	j|jrt	j|	|j#|nU|td
|j*tjk7s|j,tjk7rtd||j/dt1j2||g|||||}|r-|j5t7j8dd{|S#t$rYt$r!}	tj d||	Yd}	~	d}	~	wwxYw#t$rT}
|j%|
j&t&j(k(r!d|d	}tt&j(|dd}
~
w|j%xYw7w)
Nz*ssl argument must be an SSLContext or Nonerrrr)rz2Unable to check or remove stale UNIX socket %r: %rzAddress z is already in usez-path was not specified, and no sock specifiedrF)rfboolrFr#r!rrrrstatS_ISSOCKst_moderemoveFileNotFoundErrorrMrerrorbindr1rS
EADDRINUSErrrrServer_start_servingrsleep)
r+rrrrrrrrerrrWmsgservers
             rcreate_unix_serverz)_UnixSelectorEventLoop.create_unix_servers7c4 HII ,SCE
E +CBD
D IKK99T?D==1C1CDDAwk)6}}RWWT]%:%:;		$

		$| CEEv~~-II!3!33 DTHMOO	
##D4&2B$'2G$8:!!#++a.  
S)6LL"*+/666


99 0 00%TH,>?C!%"2"2C8dB


&
!siBIAF'"G3B-I I!I'	G0I2G:GIGI	I'AH66IIc
K	tj	|j}	tj|j}|r|n|}|sy|j}	|j|	d|||||d|	d{S#t$rtjdwxYw#ttjf$r}tjdd}~wwxYw#t$rtjdwxYw7~w)Nzos.sendfile() is not availableznot a regular filer)
r!sendfileAttributeErrorr	SendfileNotAvailableErrorrLioUnsupportedOperationfstatst_sizerMr{_sock_sendfile_native_impl)
r+rfileoffsetcountrLrfsize	blocksizefuts
          r_sock_sendfile_nativez,_UnixSelectorEventLoop._sock_sendfile_nativecs	2KK	M[[]F	MHHV$,,E#E	  "''T4(.y!	Ey%	26602
2	2
 7 78	M667KLL	M	M667KLL	MsVC<BB"C6C<;C:<C<BC<"C;CCC<C77C<c	
|j}	||j||jr|j|||y|r/||z
}|dkr%|j||||j	|y	tj|	|||}
|
dk(r%|j||||j	|y||
z
}||
z
}||j|||j|	|j||	||||||
y#ttf$r;||j|||j|	|j||	||||||
Yyt$r}|Q|jtjk(r4t|t ur#t!dtj}||_|}|dk(r:t%j&d}
|j||||j)|
n)|j||||j)|Yd}~yYd}~yd}~wt*t,f$rt.$r.}|j||||j)|Yd}~yd}~wwxYw)Nrzsocket is not connectedzos.sendfile call failed)rL
remove_writer	cancelled_sock_sendfile_update_filepos
set_resultr!r_sock_add_cancellation_callback
add_writerrBlockingIOErrorInterruptedErrorrMrSENOTCONNrConnectionError	__cause__r	r
set_exceptionrrr)r+r
registered_fdrrLrrr
total_sentfdsentrWnew_excrs              rrz1_UnixSelectorEventLoop._sock_sendfile_native_implzsT
[[]$

}-==?..vvzJ
*IA~2266:Nz*1	F;;r669=DJqy2266:Nz*$d"
 (88dCD$C$CS "D& &y*F[ !12	B$44S$?OOB ? ?f"E9j
B	')II/I_4
*-u~~?$'!Q
!::-/2266:N!!#&2266:N!!#&&'-.		#..vvzJc""	#s,:C??AIIB6HI+$IIcZ|dkDr&tj||tjyyNr)r!lseekSEEK_SET)r+rLrrs    rrz4_UnixSelectorEventLoop._sock_sendfile_update_fileposs">HHVVR[[1rc6fd}|j|y)Ncv|jr(j}|dk7rj|yyy)Nr@)rrLr)rrr+rs  rcbzB_UnixSelectorEventLoop._sock_add_cancellation_callback.<locals>.cbs6}}[[]8&&r*r)add_done_callback)r+rrrs` ` rrz6_UnixSelectorEventLoop._sock_add_cancellation_callbacks	+
	b!rrNN)__name__
__module____qualname__r)r1r>rZr<r5rGrprsrrrrrrrr
__classcell__r-s@rr&r&9s
#.(+Z2@
=@D(,KAE)-L04BV
*.0#4 "&!%0#f*.Gs"&!%GR.DFL2"rr&ceZdZdZdfd	ZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZej fd
ZddZdZdZxZS)rjic4t||||jd<||_||_|j|_||_d|_d|_	tj|jj}tj|sJtj|s5tj |s d|_d|_d|_t#dtj$|jd|jj'|jj(||jj'|j*|j|j,|,|jj't.j0|dyy)NrlFz)Pipe transport is for pipes/sockets only.)r(r)_extra_loop_piperL_fileno	_protocol_closing_pausedr!rrrS_ISFIFOrS_ISCHRr#set_blockingrconnection_made_add_reader_read_readyr
_set_result_unless_cancelled)r+looprlrmrnromoder-s       rr)z_UnixReadPipeTransport.__init__s.
"F

{{}!
xx%--

d#

d#T"DJDL!DNHII
e,

T^^;;TB

T--!\\4+;+;	=JJ  !E!E!'
/rc^|jsy|jj||yr)
is_readingrr)r+rrUs   rrz"_UnixReadPipeTransport._add_readers# 

r8,rc:|jxr
|jSr)rrr+s rrz!_UnixReadPipeTransport.is_readings<<5

$55rct|jjg}|j|jdn|jr|jd|jd|j
t
|jdd}|jW|Utj||j
tj}|r|jdnA|jdn/|j|jdn|jddjd	j|S)
Nclosedclosingfd=	_selectorpollingidleopen<{}> )r-rrappendrrgetattrrr_test_selector_event	selectors
EVENT_READformatjoin)r+rRr,r
s    r__repr__z_UnixReadPipeTransport.__repr__s''(::KK!
]]KK	"c$,,()4::{D9::!h&:%::$,,	(<(<>GI&F#
ZZ
#KKKK!}}SXXd^,,rch	tj|j|j}|r|jj|y|jjrtjd|d|_
|jj|j|jj|jj|jj|jdy#tt f$rYyt"$r}|j%|dYd}~yd}~wwxYw)N%r was closed by peerTz"Fatal read error on pipe transport)r!readrmax_sizer
data_receivedr	get_debugrrRr_remove_readerreof_received_call_connection_lostrrrM_fatal_error)r+r=rWs   rrz"_UnixReadPipeTransport._read_readys	G774<<7D,,T2::'')KK 7> $


))$,,7

$$T^^%@%@A

$$T%?%?F !12		Ic#GHH	Is*C<<D1
D1D,,D1c|jsyd|_|jj|j|jjrt
jd|yy)NTz%r pauses reading)rrrrrrrdebugrs r
pause_readingz$_UnixReadPipeTransport.pause_readingsP 

!!$,,/::!LL,d3"rc|js|jsyd|_|jj|j|j
|jj
rtjd|yy)NFz%r resumes reading)	rrrrrrrrr"rs rresume_readingz%_UnixReadPipeTransport.resume_reading&s[==

t||T-=-=>::!LL-t4"rc||_yrrr+rms  rset_protocolz#_UnixReadPipeTransport.set_protocol.	!rc|jSrr'rs rget_protocolz#_UnixReadPipeTransport.get_protocol1~~rc|jSrrrs r
is_closingz!_UnixReadPipeTransport.is_closing4}}rc@|js|jdyyr)r_closers rr1z_UnixReadPipeTransport.close7s}}KKrcv|j-|d|t||jjyyNzunclosed transport r/rr8r1r+_warns  r__del__z_UnixReadPipeTransport.__del__;5::!'x0/$OJJ"rc<t|trQ|jtjk(r4|jjrDt
jd||dn*|jj||||jd|j|yNz%r: %sTexc_info)message	exceptionrrm)rfrMrSEIOrrrr"call_exception_handlerrr3r+rWr?s   rr z#_UnixReadPipeTransport._fatal_error@srsG$eii)?zz##%XtWtDJJ--" ! NN	/
	
Crcd|_|jj|j|jj	|j
|yNT)rrrrrrr+rWs  rr3z_UnixReadPipeTransport._closeNs9


!!$,,/

T77=rc	|jj||jjd|_d|_d|_y#|jjd|_d|_d|_wxYwrrconnection_lostrr1rrFs  rrz,_UnixReadPipeTransport._call_connection_lostSg	NN**3/JJDJ!DNDJ
JJDJ!DNDJA

1A>rzFatal error on pipe transport)rrrrr)rrrrr#r%r)r,r0r1r6r7r9r r3rrrs@rrjrjs]H/<-
6-*G$45"%MM
>
rrjceZdZdfd	ZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZej fd
ZdZddZddZdZxZS)rrct
|||||jd<||_|j	|_||_t|_d|_	d|_
tj|j
j}tj|}tj |}tj"|}	|s$|s"|	s d|_d|_d|_t%dtj&|j
d|j(j+|jj,||	s!|rdt.j0j3dsE|j(j+|j(j4|j
|j6|,|j(j+t8j:|dyy)NrlrFz?Pipe transport is only for pipes, sockets and character devicesaix)r(r)rrrLrr	bytearray_buffer
_conn_lostrr!rrrrrrr#rrrrr2platform
startswithrrr
r)r+rrlrmrnroris_charis_fifo	is_socketr-s          rr)z _UnixWritePipeTransport.__init__`si
%"F
{{}! {
xx%--,,t$--%MM$'	7iDJDL!DNDE
E	e,

T^^;;TB
)@)@)GJJ  !7!7!%t/?/?
AJJ  !E!E!'
/rc|jjg}|j|jdn|jr|jd|jd|j
t
|jdd}|j{|ytj||j
tj}|r|jdn|jd|j}|jd|n/|j|jdn|jdd	jd
j|S)Nrrrr	r
rzbufsize=rr
r)r-rrrrrrrrrrEVENT_WRITEget_write_buffer_sizerr)r+rRr,r
rs     rrz _UnixWritePipeTransport.__repr__s''(::KK!
]]KK	"c$,,()4::{D9::!h&:%::$,,	(=(=?GI&F#002GKK(7),-
ZZ
#KKKK!}}SXXd^,,rc,t|jSr)lenrQrs rrZz-_UnixWritePipeTransport.get_write_buffer_sizes4<<  rc|jjrtjd||jr|jt
y|jy)Nr)rrrrRrQr3BrokenPipeErrorrs rrz#_UnixWritePipeTransport._read_readys@::!KK/6<<KK)*KKMrct|trt|}|sy|js|jrH|jt
jk\rtjd|xjdz
c_y|jss	tj|j|}|t'|k(ry|dkDrt||d}|j(j+|j|j,|xj|z
c_	|j/y#ttf$rd}Ytt f$rt"$r1}|xjdz
c_|j%|dYd}~yd}~wwxYw)Nz=pipe closed by peer or os.write(pipe, data) raised exception.rr#Fatal write error on pipe transport)rfrP
memoryviewrRrr!LOG_THRESHOLD_FOR_CONNLOST_WRITESrwarningrQr!writerrrrrrr r\r_add_writer_write_ready_maybe_pause_protocol)r+r=nrWs    rrdz_UnixWritePipeTransport.writes7dI&d#D??dmm)"M"MM HIOOq O||	
HHT\\40CI~Q!$'+JJ""4<<1B1BC""$$%56
 12
 
1$!!#'LM
s D$$E?7E?'E::E?c	tj|j|j}|t	|jk(r|jj|jj|j|j|jr6|jj|j|jdy|dkDr|jd|=yy#ttf$rYyttf$rt $rp}|jj|xj"dz
c_|jj|j|j%|dYd}~yd}~wwxYw)Nrrr`)r!rdrrQr\r9r_remove_writer_maybe_resume_protocolrrrrrrrrrRr )r+rhrWs   rrfz$_UnixWritePipeTransport._write_readys.	%t||4AC%%""$

))$,,7++-==JJ--dll;..t4QLL!$) !12	-.		JLL OOq O
JJ%%dll3c#HII
	Js*C,,F=FA&E??FcyrErrs r
can_write_eofz%_UnixWritePipeTransport.can_write_eofrc|jryd|_|jsL|jj|j|jj|jdyyrE)rrQrrrrrrs r	write_eofz!_UnixWritePipeTransport.write_eofsO==
||JJ%%dll3JJ  !;!;TBrc||_yrr'r(s  rr)z$_UnixWritePipeTransport.set_protocolr*rc|jSrr'rs rr,z$_UnixWritePipeTransport.get_protocolr-rc|jSrr/rs rr0z"_UnixWritePipeTransport.is_closingr1rcX|j|js|jyyyr)rrrprs rr1z_UnixWritePipeTransport.closes$::!$--NN+8!rcv|j-|d|t||jjyyr5r6r7s  rr9z_UnixWritePipeTransport.__del__r:rc&|jdyr)r3rs rabortz_UnixWritePipeTransport.abortsDrct|tr4|jjrDt	j
d||dn*|jj
||||jd|j|yr<)	rfrMrrrr"rBrr3rCs   rr z$_UnixWritePipeTransport._fatal_error
scc7#zz##%XtWtDJJ--" ! NN	/
	
Crc>d|_|jr%|jj|j|jj|jj
|j|jj|j|yrE)	rrQrrjrr9rrrrFs  rr3z_UnixWritePipeTransport._closesf
<<JJ%%dll3

!!$,,/

T77=rc	|jj||jjd|_d|_d|_y#|jjd|_d|_d|_wxYwrrHrFs  rrz-_UnixWritePipeTransport._call_connection_lost rJrKrrLr)rrrr)rrZrrdrfrmrpr)r,r0r1r6r7r9rwr r3rrrs@rrrrr]sd#/J-0!!%F%8C"
%MM
>rrrceZdZdZy)r|c
d}|tjk(r6tjj	drtj\}}	tj|f||||d|d||_|=|jt|jd||j_d}|!|j|jyy#|!|j|jwwxYw)NrOF)rrrruniversal_newlinesrwb)	buffering)
subprocessPIPEr2rSrTr
socketpairPopen_procr1rdetachr)	r+rVrrrrrrstdin_ws	         r_startz_UnixSubprocessTransport._start,sJOO#(?(?(F
$..0NE7	 #))E!vf#('E=CEDJ"
#'(8$'#R

 "


#w"


#s

A!C%C7N)rrrrrrrr|r|*s rr|c@eZdZ	d
dZdZdZdZdZdZdZ	d	Z
y)rNc\|jtk7rtjdddyy)NrP{name!r} is deprecated as of Python 3.12 and will be removed in Python {remove}.r)rrr6_deprecated)clss r__init_subclass__z&AbstractChildWatcher.__init_subclass__Ys,>>X%  !7;%,
.&rc	trNotImplementedErrorr+rrUrVs    rr}z&AbstractChildWatcher.add_child_handler`s	"##rc	trrr+rs  rremove_child_handlerz)AbstractChildWatcher.remove_child_handlerks	1
"##rc	trrr+rs  rattach_loopz AbstractChildWatcher.attach_loopss	"##rc	trrrs rr1zAbstractChildWatcher.close}s	"##rc	trrrs rrzzAbstractChildWatcher.is_actives	"##rc	trrrs r	__enter__zAbstractChildWatcher.__enter__s	*"##rc	trrr+abcs    r__exit__zAbstractChildWatcher.__exit__s(!##r)returnN)rrrrr}rrr1rzrrrrrrrBs/,.	$$$$$$$rrc>eZdZ	dZdZdZdZdZdZdZ	dZ
y	)
rc|Srrrs rrzPidfdChildWatcher.__enter__rcyrr)r+exc_type	exc_value
exc_tracebacks    rrzPidfdChildWatcher.__exit__rcyrErrs rrzzPidfdChildWatcher.is_activernrcyrrrs rr1zPidfdChildWatcher.closerrcyrrrs  rrzPidfdChildWatcher.attach_looprrctj}tj|}|j	||j
||||yr)rget_running_loopr!
pidfd_openr_do_wait)r+rrUrVrpidfds      rr}z#PidfdChildWatcher.add_child_handlers:&&(

c"

sE8TJrc$tj}|j|	tj|d\}}t|}tj||||g|y#t$rd}tjd|YCwxYw)NrzJchild process pid %d exit status already read:  will report returncode 255)
rrrr!waitpidr"ChildProcessErrorrrcr1)	r+rrrUrVr_r$rs	         rrzPidfdChildWatcher._do_waits&&(E"	8

3*IAv07J
j(4(!	JNN.
		sA++!BBcyrErrs  rrz&PidfdChildWatcher.remove_child_handlerrN)rrrrrrzr1rr}rrrrrrrs0	


K
)&rrc6eZdZdZdZdZdZdZdZdZ	y)	BaseChildWatcherc d|_i|_yr)r
_callbacksrs rr)zBaseChildWatcher.__init__s
rc&|jdyr)rrs rr1zBaseChildWatcher.closesrcV|jduxr|jjSr)r
is_runningrs rrzzBaseChildWatcher.is_actives#zz%A$***?*?*AArctrr)r+expected_pids  r_do_waitpidzBaseChildWatcher._do_waitpid!##rctrrrs r_do_waitpid_allz BaseChildWatcher._do_waitpid_allrrc^|j(|&|jrtjdt|j)|jjtj||_|;|jtj|j|jyy)NzCA loop is being detached from a child watcher with pending handlers)rrr6r7RuntimeWarningr5rISIGCHLDrZ	_sig_chldrrs  rrzBaseChildWatcher.attach_loops::!dltMM=
 
::!JJ,,V^^<
##FNNDNNC
  "rc	|jy#ttf$rt$r(}|jjd|dYd}~yd}~wwxYw)N$Unknown exception in SIGCHLD handler)r?r@)rrrrrrBrFs  rrzBaseChildWatcher._sig_chldsX	  "-.		
JJ--A /

		sAAAN)
rrrr)r1rzrrrrrrrrrs&B$$#(rrcNeZdZ	fdZfdZdZdZdZdZdZ	dZ
xZS)	rcRt|tjdddy)Nrrrr)r(r)r6rr+r-s rr)zSafeChildWatcher.__init__s'
/;%,	.rcV|jjt|
yr)rr9r(r1rs rr1zSafeChildWatcher.closes

rc|Srrrs rrzSafeChildWatcher.__enter__rrcyrrrs    rrzSafeChildWatcher.__exit__ rrcH||f|j|<|j|yr)rrrs    rr}z"SafeChildWatcher.add_child_handler#s% ($/	
rc>	|j|=y#t$rYywxYwNTFrr`rs  rrz%SafeChildWatcher.remove_child_handler)(	$		
	cZt|jD]}|j|yrr4rrrs  rrz SafeChildWatcher._do_waitpid_all0s((	"CS!	"rc	tj|tj\}}|dk(ryt|}|jjrt
jd||		|jj|\}}|||g|y#t$r|}d}t
jd|YOwxYw#t$r7|jjrt
jd|dYyYywxYw)Nr$process %s exited with returncode %sr8Unknown child process pid %d, will report returncode 255'Child watcher got an unexpected pid: %rTr=)
r!rWNOHANGr"rrrr"rrcrpopr`)r+rrr$rrUrVs       rrzSafeChildWatcher._do_waitpid5s	7**\2::>KCax/7Jzz##%C):7		-!__005NHd
S*,t,7!	CJNNJ
	(	3zz##%H"T3&	3s#'B-B?#B<;B<?;C?>C?)rrrr)r1rrr}rrrrrs@rrrs0.
"
 -rrcHeZdZ	fdZfdZdZdZdZdZdZ	xZ
S)rct|tj|_i|_d|_tjdddy)Nrrrrr)	r(r)	threadingLock_lock_zombies_forksr6rrs rr)zFastChildWatcher.__init__bsC
^^%

/;%,	.rc|jj|jjt|yr)rr9rr(r1rs rr1zFastChildWatcher.closels,



rct|j5|xjdz
c_|cdddS#1swYyxYw)Nr)rrrs rrzFastChildWatcher.__enter__qs/
ZZ	KK1K			s.7c>|j5|xjdzc_|js|js
	dddyt|j}|jj	dddtjdy#1swY xYw)Nrz5Caught subprocesses termination from unknown pids: %s)rrrrOr9rrc)r+rrrcollateral_victimss     rrzFastChildWatcher.__exit__ws{
ZZ	"KK1K{{$--		"	""%T]]!3MM!	"	C	 	"	"s/B/BBc|j5	|jj|}	ddd||g|y#t$r||f|j|<YdddywxYw#1swY<xYwr)rrrr`r)r+rrUrVrs     rr}z"FastChildWatcher.add_child_handlerszZZ	
!]]..s3
		j(4(

'/~$
		
		s&A&>A#A&"A##A&&A/c>	|j|=y#t$rYywxYwrrrs  rrz%FastChildWatcher.remove_child_handlerrrc		tjdtj\}}|dk(ryt|}|j
5	|jj|\}}|jjrtjd||	dddtjd||n
|||g#t$rYywxYw#t$r\|jrK||j|<|jjrtjd||Yddd4d}YwxYw#1swYxYw)Nr@rrz,unknown process %s exited with returncode %sz8Caught subprocess termination from unknown pid: %d -> %d)r!rrr"rrrrrrrr"r`rrrc)r+rr$rrUrVs      rrz FastChildWatcher._do_waitpid_allsC

< jjRZZ8V
!83F;

66%)__%8%8%=NHdzz++-%K%(*6!
6& #Z1j040K%

 
${{-7

c*:://1"LL*>),j:!
6
6 $H
$
6
6sN'CD=	C'2D=	CCAD:*D=5D:7D=9D::D==E)rrrr)r1rrr}rrrrs@rrrXs+.
 )(1rrcPeZdZ	dZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
y)
rcPi|_d|_tjdddy)Nrrrr)r_saved_sighandlerr6rrs rr)zMultiLoopChildWatcher.__init__s*!%4;%,	.rc|jduSr)rrs rrzzMultiLoopChildWatcher.is_actives%%T11rcZ|jj|jytjtj
}||jk7rtjdd|_ytjtj
|jd|_y)Nz+SIGCHLD handler was changed by outside code)	rr9rrI	getsignalrrrrc)r+rds  rr1zMultiLoopChildWatcher.closesz!!)""6>>2dnn$NNHI"&
MM&..$*@*@A!%rc|Srrrs rrzMultiLoopChildWatcher.__enter__rrcyrrr+rexc_valexc_tbs    rrzMultiLoopChildWatcher.__exit__rrcrtj}|||f|j|<|j|yr)rrrr)r+rrUrVrs     rr}z'MultiLoopChildWatcher.add_child_handlers5&&( $h5	
rc>	|j|=y#t$rYywxYwrrrs  rrz*MultiLoopChildWatcher.remove_child_handlerrrc8|jytjtj|j|_|j*t	j
dtj|_tjtjdy)NzaPrevious SIGCHLD handler was set by non-Python code, restore to default handler on watcher close.F)rrIrrrrcrcrQrs  rrz!MultiLoopChildWatcher.attach_loopso
!!-!'v~~t~~!N!!)NNJ
K%+^^D"	FNNE2rcZt|jD]}|j|yrrrs  rrz%MultiLoopChildWatcher._do_waitpid_alls((	"CS!	"rc*	tj|tj\}}|dk(ryt|}d}	|jj|\}}}|jrtjd||y|r'|jrtjd|||j|||g|y#t$r|}d}tjd|d}YwxYw#t$rtjd|d	YywxYw)
NrTrrF%Loop %r that handles pid %r is closedrrr=)r!rrr"rrrcrr	is_closedrr"rr`)	r+rrr$r	debug_logrrUrVs	         rrz!MultiLoopChildWatcher._do_waitpids
	**\2::>KCax/7JI	L#'??#6#6s#; D(D~~FcR!1LL!G!-z;)))(CKdK=!	CJNNJ
I	$	/
NND
/	/s"'CC.%C+*C+.!DDc	|jy#ttf$rt$rt	j
ddYywxYw)NrTr=)rrrrrrc)r+rrs   rrzMultiLoopChildWatcher._sig_chld=sE	R  "-.		RNNADQ	Rs/AAN)rrrr)rzr1rrr}rrrrrrrrrrsA	$.2
&
3""#LJRrrcheZdZ	dZdZdZdZdZdZe	jfdZdZd	Z
d
ZdZy)
rcFtjd|_i|_yr)	itertoolsr_pid_counter_threadsrs rr)zThreadedChildWatcher.__init__Ss%OOA.
rcyrErrs rrzzThreadedChildWatcher.is_activeWrnrc$|jyr)
_join_threadsrs rr1zThreadedChildWatcher.closeZsrc	t|jjDcgc] }|jr|js|"}}|D]}|jycc}wr)r4rvaluesis_alivedaemonr)r+threadthreadss   rrz"ThreadedChildWatcher._join_threads]s`3(,T]]-A-A-C(D?foo'

??	FKKM	?s%A&c|Srrrs rrzThreadedChildWatcher.__enter__drrcyrrrs    rrzThreadedChildWatcher.__exit__grrct|jjDcgc]}|jr|}}|r||jdt
|yycc}w)Nz0 has registered but not finished child processesr/)r4rrrr-r8)r+r8rrs    rr9zThreadedChildWatcher.__del__jsd(,T]]-A-A-C(D)foo'))T^^$$TU!
)sA!ctj}tj|jdt|j||||fd}||j|<|jy)Nzwaitpid-T)targetnamerVr)	rrrThreadrnextr
rstart)r+rrUrVrrs      rr}z&ThreadedChildWatcher.add_child_handlerrsf&&(!!)9)9)1$t7H7H2I1J'K(,c8T'B)-/$

crcyrErrs  rrz)ThreadedChildWatcher.remove_child_handler{rrcyrrrs  rrz ThreadedChildWatcher.attach_looprrc	tj|d\}}t|}|jrt	j
d||	|jrt	jd||n|j|||g||jj|y#t$r|}d}t	jd|Y~wxYw)Nrrrrr)r!rr"rrr"rrcrrrr)r+rrrUrVrr$rs        rrz ThreadedChildWatcher._do_waitpids	7**\15KC07J~~C):7>>NNBD#N%D%%hZG$G

,''!	CJNNJ
	sB''#C
C
N)rrrr)rzr1rrrr6r7r9r}rrrrrrrrFsG

%MM
(rrcttdsy	tj}tjtj|dy#t
$rYywxYw)NrFrT)hasattrr!getpidr1rrM)rs r
can_use_pidfdr$sO2|$iik
sA&'s=A	AAc@eZdZ	eZfdZdZfdZdZdZ	xZ
S)_UnixDefaultEventLoopPolicyc0t|d|_yr)r(r)_watcherrs rr)z$_UnixDefaultEventLoopPolicy.__init__s

rcftj5|jtrt	|_nt|_t
jt
jur/|jj|jjdddy#1swYyxYwr)rrr(r$rrrcurrent_threadmain_threadr_localrrs r
_init_watcherz)_UnixDefaultEventLoopPolicy._init_watchers{
\\	A}}$ ?$5$7DM$8$:DM++-1F1F1HHMM--dkk.?.?@	A	A	AsB
B''B0c	t|||jEtjtj
ur|jj
|yyyr)r(set_event_loopr(rr*r+r)r+rr-s  rr/z*_UnixDefaultEventLoopPolicy.set_event_loopsX		t$MM%((*i.C.C.EEMM%%d+F
&rc	|j|jtjddd|jS)Nryrrr)r(r-r6rrs rryz-_UnixDefaultEventLoopPolicy.get_child_watchersE	==  0:BI	K}}rc	|j|jj||_tjdddy)Nset_child_watcherrrr)r(r1r6r)r+rs  rr2z-_UnixDefaultEventLoopPolicy.set_child_watchersB2==$MM!
0:BI	Kr)rrrr&
_loop_factoryr)r-r/ryr2rrs@rr&r&s&D*MA,Krr&)3rSrr	r!rrIrrrr2rr6rrrrrr	r
rrr
logr__all__rSImportErrorrr"BaseSelectorEventLoopr&
ReadTransportrj_FlowControlMixinWriteTransportrrBaseSubprocessTransportr|rrrrrrrr$BaseDefaultEventLoopPolicyr&rrrrr<module>r>se8		


<<7
C
DD	
Q"_BBQ"hMZ55M`Jj::(77JZ FF 0S$S$l7,7t2+2jN-'N-bj1'j1Z~R0~RBV(/V(p	8K&"C"C8Kv+4r