选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
U e5dÛ¿ã@sÖdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZddl mZddl mZddl mZddl mZdd l mZdd l mZdd l mZdd l mZdd l mZddlmZdZe jdkrþedƒ‚dd„ZGdd„dejƒZGdd„dej ƒZ!Gdd„dej"ej#ƒZ$Gdd„dej%ƒZ&Gdd„dƒZ'dd„Z(Gd d!„d!e'ƒZ)Gd"d#„d#e)ƒZ*Gd$d%„d%e)ƒZ+Gd&d'„d'e'ƒZ,Gd(d)„d)e'ƒZ-Gd*d+„d+ej.ƒZ/eZ0e/Z1dS),z2Selector event loop for Unix with signal handling.éNé)Ú base_events)Úbase_subprocess)Ú constants)Ú coroutines)Úevents)Ú exceptions)Úfutures)Úselector_events)Útasks)Ú transports)Úlogger)ÚSelectorEventLoopÚAbstractChildWatcherÚSafeChildWatcherÚFastChildWatcherÚMultiLoopChildWatcherÚThreadedChildWatcherÚDefaultEventLoopPolicyZwin32z+Signals are not really supported on WindowscCsdS)zDummy signal handler.N©)ÚsignumÚframerrú+/usr/lib64/python3.8/asyncio/unix_events.pyÚ_sighandler_noop*srcsÊeZdZdZd)‡fdd„ Z‡fdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z d*dd„Z d+dd„Z d,dd„Z dd„Zd-dddddœdd„Zd.ddddddœdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Z‡ZS)/Ú_UnixSelectorEventLoopzdUnix event loop. Adds signal handling and UNIX Domain Socket support to SelectorEventLoop. Ncstƒ |¡i|_dS©N)ÚsuperÚ__init__Ú_signal_handlers)ÚselfÚselector©Ú __class__rrr5s z_UnixSelectorEventLoop.__init__csZtƒ ¡t ¡s.t|jƒD]}| |¡qn(|jrVtjd|›d�t |d�|j  ¡dS)NzClosing the loop z@ on interpreter shutdown stage, skipping signal handlers removal©Úsource) rÚcloseÚsysÚ is_finalizingÚlistrÚremove_signal_handlerÚwarningsÚwarnÚResourceWarningÚclear©rÚsigr!rrr%9s üz_UnixSelectorEventLoop.closecCs|D]}|sq| |¡qdSr)Ú_handle_signal)rÚdatarrrrÚ_process_self_dataGsz)_UnixSelectorEventLoop._process_self_datac GsLt |¡st |¡rtdƒ‚| |¡| ¡zt |j  ¡¡Wn2t t fk rt}zt t |ƒƒ‚W5d}~XYnXt |||d¡}||j|<zt |t¡t |d¡Wnšt k �rF}zz|j|=|j�szt d¡Wn4t t fk �r}zt d|¡W5d}~XYnX|jtjk�r4t d|›d�ƒ‚n‚W5d}~XYnXdS)zÃAdd a handler for a signal. UNIX only. Raise ValueError if the signal number is invalid or uncatchable. Raise RuntimeError if there is a problem setting up the handler. z3coroutines cannot be used with add_signal_handler()NFéÿÿÿÿúset_wakeup_fd(-1) failed: %súsig ú cannot be caught)rZ iscoroutineZiscoroutinefunctionÚ TypeErrorÚ _check_signalZ _check_closedÚsignalÚ set_wakeup_fdZ_csockÚfilenoÚ ValueErrorÚOSErrorÚ RuntimeErrorÚstrrZHandlerrÚ siginterruptr ÚinfoÚerrnoÚEINVAL)rr/ÚcallbackÚargsÚexcÚhandleZnexcrrrÚadd_signal_handlerNs2 ÿ   z)_UnixSelectorEventLoop.add_signal_handlercCs8|j |¡}|dkrdS|jr*| |¡n | |¡dS)z2Internal helper that is the actual signal handler.N)rÚgetZ _cancelledr)Z_add_callback_signalsafe)rr/rGrrrr0{s   z%_UnixSelectorEventLoop._handle_signalc Csæ| |¡z |j|=Wntk r,YdSX|tjkr@tj}ntj}zt ||¡WnBtk r˜}z$|jtj kr†t d|›d�ƒ‚n‚W5d}~XYnX|jsâzt  d¡Wn2t tfk rà}zt  d|¡W5d}~XYnXdS)zwRemove a handler for a signal. UNIX only. Return True if a signal handler was removed, False if not. Fr5r6Nr3r4T)r8rÚKeyErrorr9ÚSIGINTÚdefault_int_handlerÚSIG_DFLr=rBrCr>r:r<r rA)rr/ÚhandlerrFrrrr)…s(    z,_UnixSelectorEventLoop.remove_signal_handlercCs6t|tƒstd|›�ƒ‚|t ¡kr2td|›�ƒ‚dS)zÁInternal helper to validate a signal. Raise ValueError if the signal number is invalid or uncatchable. Raise RuntimeError if there is a problem setting up the handler. zsig must be an int, not zinvalid signal number N)Ú isinstanceÚintr7r9Ú valid_signalsr<r.rrrr8¥s  z$_UnixSelectorEventLoop._check_signalcCst|||||ƒSr)Ú_UnixReadPipeTransport©rÚpipeÚprotocolÚwaiterÚextrarrrÚ_make_read_pipe_transport±sz0_UnixSelectorEventLoop._make_read_pipe_transportcCst|||||ƒSr)Ú_UnixWritePipeTransportrSrrrÚ_make_write_pipe_transportµsz1_UnixSelectorEventLoop._make_write_pipe_transportc Ës¼t ¡�ª} |  ¡stdƒ‚| ¡} t||||||||f| |dœ| —Ž} |  |  ¡|j| ¡z| IdHWnDt t fk r‚‚Yn,t k r¬|   ¡|   ¡IdH‚YnXW5QRX| S)NzRasyncio.get_child_watcher() is not activated, subprocess support is not installed.)rVrW)rÚget_child_watcherÚ is_activer>Ú create_futureÚ_UnixSubprocessTransportÚadd_child_handlerZget_pidÚ_child_watcher_callbackÚ SystemExitÚKeyboardInterruptÚ BaseExceptionr%Z_wait) rrUrEÚshellÚstdinÚstdoutÚstderrÚbufsizerWÚkwargsÚwatcherrVÚtransprrrÚ_make_subprocess_transport¹s8  ÿþý ÿz1_UnixSelectorEventLoop._make_subprocess_transportcCs| |j|¡dSr)Úcall_soon_threadsafeZ_process_exited)rÚpidÚ returncoderkrrrr`×sz._UnixSelectorEventLoop._child_watcher_callback)ÚsslÚsockÚserver_hostnameÚssl_handshake_timeoutc Ãs |dkst|tƒst‚|r,|dkrLtdƒ‚n |dk r.cb)Zadd_done_callback)rr rqr±rr°rr§«sz6_UnixSelectorEventLoop._sock_add_cancellation_callback)N)NN)NN)N)N)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr%r2rHr0r)r8rXrZrlr`rƒr“r¡r›r¤r§Ú __classcell__rrr!rr/sH -   ÿ ÿ þ ÿü .ÿü CFrcsŠeZdZdZd‡fdd„ Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z e jfdd„Zddd„Zdd„Zdd„Z‡ZS) rRiNcsÚtƒ |¡||jd<||_||_| ¡|_||_d|_d|_ t   |j¡j }t  |¡s„t  |¡s„t  |¡s„d|_d|_d|_tdƒ‚t  |jd¡|j |jj|¡|j |jj|j|j¡|dk rÖ|j tj|d¡dS)NrTFz)Pipe transport is for pipes/sockets only.)rrÚ_extraÚ_loopÚ_piper;Ú_filenoÚ _protocolÚ_closingÚ_pausedrxr™rŒrŠÚS_ISFIFOr‹ÚS_ISCHRr<Ú set_blockingÚ call_soonÚconnection_madeÚ _add_readerÚ _read_readyr Ú_set_result_unless_cancelled)rrˆrTrUrVrWÚmoder!rrr¸s:    ÿþ ÿ ÿz_UnixReadPipeTransport.__init__cCsÀ|jjg}|jdkr | d¡n|jr0| d¡| d|j›�¡t|jddƒ}|jdk r�|dk r�t  ||jt j ¡}|r„| d¡q°| d¡n |jdk r¦| d¡n | d¡d  d   |¡¡S) NÚclosedÚclosingúfd=Ú _selectorÚpollingÚidleÚopenú<{}>ú )r"r²r¹Úappendr¼rºÚgetattrr¸r Ú_test_selector_eventÚ selectorsZ EVENT_READÚformatÚjoin)rrAr rËrrrÚ__repr__Ös(    ÿ     z_UnixReadPipeTransport.__repr__c Csºzt |j|j¡}WnDttfk r,YnŠtk rX}z| |d¡W5d}~XYn^X|rl|j  |¡nJ|j   ¡r‚t   d|¡d|_|j  |j¡|j  |jj¡|j  |jd¡dS)Nz"Fatal read error on pipe transportú%r was closed by peerT)rxÚreadrºÚmax_sizer¥r¦r=Ú _fatal_errorr»Z data_receivedr¸Ú get_debugr rAr¼Ú_remove_readerrÁZ eof_receivedÚ_call_connection_lost)rr1rFrrrrÄës  z"_UnixReadPipeTransport._read_readycCs>|js |jrdSd|_|j |j¡|j ¡r:t d|¡dS)NTz%r pauses reading)r¼r½r¸rÜrºrÛr Údebug©rrrrÚ pause_readingýs   z$_UnixReadPipeTransport.pause_readingcCsB|js |jsdSd|_|j |j|j¡|j ¡r>t d|¡dS)NFz%r resumes reading) r¼r½r¸rÃrºrÄrÛr rÞrßrrrÚresume_readings   z%_UnixReadPipeTransport.resume_readingcCs ||_dSr©r»©rrUrrrÚ set_protocol sz#_UnixReadPipeTransport.set_protocolcCs|jSrrârßrrrÚ get_protocolsz#_UnixReadPipeTransport.get_protocolcCs|jSr©r¼rßrrrÚ is_closingsz!_UnixReadPipeTransport.is_closingcCs|js| d¡dSr)r¼Ú_closerßrrrr%sz_UnixReadPipeTransport.closecCs,|jdk r(|d|›�t|d�|j ¡dS©Nzunclosed transport r#©r¹r,r%©rÚ_warnrrrÚ__del__s z_UnixReadPipeTransport.__del__úFatal error on pipe transportcCsZt|tƒr4|jtjkr4|j ¡rLtjd||dd�n|j ||||j dœ¡|  |¡dS©Nz%r: %sT©Úexc_info)ÚmessageÚ exceptionr‚rU) rOr=rBZEIOr¸rÛr rÞÚcall_exception_handlerr»rè©rrFròrrrrÚs üz#_UnixReadPipeTransport._fatal_errorcCs(d|_|j |j¡|j |j|¡dS©NT)r¼r¸rÜrºrÁrÝ©rrFrrrrè-sz_UnixReadPipeTransport._closecCs4z|j |¡W5|j ¡d|_d|_d|_XdSr©r¹r%r»r¸Zconnection_lostr÷rrrrÝ2s  z,_UnixReadPipeTransport._call_connection_lost)NN)rî)r²r³r´rÙrrÖrÄràrárärårçr%r*r+rírÚrèrÝr¶rrr!rrR´s rRcs¨eZdZd%‡fdd„ Zdd„Zdd„Zdd „Zd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zejfdd„Zdd„Zd&dd „Zd'd!d"„Zd#d$„Z‡ZS)(rYNc sþtƒ ||¡||jd<||_| ¡|_||_tƒ|_d|_ d|_ t   |j¡j }t |¡}t |¡}t |¡} |s”|s”| s”d|_d|_d|_tdƒ‚t  |jd¡|j |jj|¡| sÈ|ràtj d¡sà|j |jj|j|j¡|dk rú|j tj|d¡dS)NrTrFz?Pipe transport is only for pipes, sockets and character devicesZaix)rrr·r¹r;rºr»Ú bytearrayÚ_bufferÚ _conn_lostr¼rxr™rŒrŠr¿r¾r‹r<rÀr¸rÁrÂr&ÚplatformÚ startswithrÃrÄr rÅ) rrˆrTrUrVrWrÆZis_charZis_fifoZ is_socketr!rrr?s:       ÿ ÿz _UnixWritePipeTransport.__init__cCsØ|jjg}|jdkr | d¡n|jr0| d¡| d|j›�¡t|jddƒ}|jdk r¨|dk r¨t  ||jt j ¡}|r„| d¡n | d¡|  ¡}| d|›�¡n |jdk r¾| d¡n | d¡d   d  |¡¡S) NrÇrÈrÉrÊrËrÌzbufsize=rÍrÎrÏ)r"r²r¹rÐr¼rºrÑr¸r rÒrÓZ EVENT_WRITEÚget_write_buffer_sizerÔrÕ)rrAr rËrhrrrrÖds,    ÿ     z _UnixWritePipeTransport.__repr__cCs t|jƒSr)Úlenrúrßrrrrþ|sz-_UnixWritePipeTransport.get_write_buffer_sizecCs6|j ¡rt d|¡|jr*| tƒ¡n| ¡dS)Nr×)r¸rÛr rArúrèÚBrokenPipeErrorrßrrrrÄs   z#_UnixWritePipeTransport._read_readyc CsRt|tttfƒstt|ƒƒ‚t|tƒr.t|ƒ}|s6dS|jsB|jrj|jtj krXt   d¡|jd7_dS|j �s8zt  |j|¡}Wntttfk r d}YnZttfk r¸‚YnBtk rø}z$|jd7_| |d¡WY¢dSd}~XYnX|t|ƒk�r dS|dk�r&t|ƒ|d…}|j |j|j¡|j |7_ | ¡dS)Nz=pipe closed by peer or os.write(pipe, data) raised exception.rrú#Fatal write error on pipe transport)rOÚbytesrùÚ memoryviewrwÚreprrûr¼rZ!LOG_THRESHOLD_FOR_CONNLOST_WRITESr ÚwarningrúrxÚwriterºr¥r¦rarbrcrÚrÿr¸Z _add_writerÚ _write_readyZ_maybe_pause_protocol)rr1ÚnrFrrrrˆs8      z_UnixWritePipeTransport.writec Cs|jstdƒ‚zt |j|j¡}Wn‚ttfk r:YnÒttfk rR‚Ynºt k r¤}z6|j  ¡|j d7_ |j   |j¡| |d¡W5d}~XYnhX|t|jƒkrö|j  ¡|j   |j¡| ¡|jrò|j  |j¡| d¡dS|dk�r |jd|…=dS)NzData should not be emptyrrr)rúrwrxrrºr¥r¦rarbrcr-rûr¸Ú_remove_writerrÚrÿZ_maybe_resume_protocolr¼rÜrÝ)rrrFrrrr«s,    z$_UnixWritePipeTransport._write_readycCsdSrörrßrrrÚ can_write_eofÇsz%_UnixWritePipeTransport.can_write_eofcCsB|jr dS|jst‚d|_|js>|j |j¡|j |jd¡dSrö) r¼r¹rwrúr¸rÜrºrÁrÝrßrrrÚ write_eofÊs z!_UnixWritePipeTransport.write_eofcCs ||_dSrrârãrrrräÓsz$_UnixWritePipeTransport.set_protocolcCs|jSrrârßrrrråÖsz$_UnixWritePipeTransport.get_protocolcCs|jSrrærßrrrrçÙsz"_UnixWritePipeTransport.is_closingcCs|jdk r|js| ¡dSr)r¹r¼r rßrrrr%Üsz_UnixWritePipeTransport.closecCs,|jdk r(|d|›�t|d�|j ¡dSrérêrërrrríás z_UnixWritePipeTransport.__del__cCs| d¡dSr)rèrßrrrÚabortæsz_UnixWritePipeTransport.abortrîcCsNt|tƒr(|j ¡r@tjd||dd�n|j ||||jdœ¡| |¡dSrï) rOr=r¸rÛr rÞrôr»rèrõrrrrÚés  üz$_UnixWritePipeTransport._fatal_errorcCsFd|_|jr|j |j¡|j ¡|j |j¡|j |j|¡dSrö) r¼rúr¸r rºr-rÜrÁrÝr÷rrrrè÷s  z_UnixWritePipeTransport._closecCs4z|j |¡W5|j ¡d|_d|_d|_XdSrrør÷rrrrÝÿs  z-_UnixWritePipeTransport._call_connection_lost)NN)rî)N)r²r³r´rrÖrþrÄrrr r rärårçr%r*r+rír rÚrèrÝr¶rrr!rrY<s"% #   rYc@seZdZdd„ZdS)r^c KsŠd}|tjkrt ¡\}}zPtj|f||||d|dœ|—Ž|_|dk rh| ¡t| ¡d|d�|j_ d}W5|dk r„| ¡| ¡XdS)NF)rdrerfrgZuniversal_newlinesrhÚwb)Ú buffering) Ú subprocessÚPIPErzZ socketpairr%ÚPopenÚ_procrÍÚdetachre) rrErdrerfrgrhriZstdin_wrrrÚ_start s.  ÿþþz_UnixSubprocessTransport._startN)r²r³r´rrrrrr^ sr^c@sHeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dS)raHAbstract base class for monitoring child processes. Objects derived from this class monitor a collection of subprocesses and report their termination or interruption by a signal. New callbacks are registered with .add_child_handler(). Starting a new process must be done within a 'with' block to allow the watcher to suspend its activity until the new process if fully registered (this is needed to prevent a race condition in some implementations). Example: with watcher: proc = subprocess.Popen("sleep 1") watcher.add_child_handler(proc.pid, callback) Notes: Implementations of this class must be thread-safe. Since child watcher objects may catch the SIGCHLD signal and call waitpid(-1), there should be only one active object per process. cGs tƒ‚dS)aRegister a new child handler. Arrange for callback(pid, returncode, *args) to be called when process 'pid' terminates. Specifying another callback for the same process replaces the previous handler. Note: callback() must be thread-safe. N©ÚNotImplementedError©rrnrDrErrrr_9s z&AbstractChildWatcher.add_child_handlercCs tƒ‚dS)z Removes the handler for process 'pid'. The function returns True if the handler was successfully removed, False if there was nothing to remove.Nr©rrnrrrÚremove_child_handlerDsz)AbstractChildWatcher.remove_child_handlercCs tƒ‚dS)zÔAttach the watcher to an event loop. If the watcher was previously attached to an event loop, then it is first detached before attaching to the new loop. Note: loop may be None. Nr©rrˆrrrÚ attach_loopLsz AbstractChildWatcher.attach_loopcCs tƒ‚dS)zlClose the watcher. This must be called to make sure that any underlying resource is freed. Nrrßrrrr%VszAbstractChildWatcher.closecCs tƒ‚dS)zºReturn ``True`` if the watcher is active and is used by the event loop. Return True if the watcher is installed and ready to handle process exit notifications. Nrrßrrrr\]szAbstractChildWatcher.is_activecCs tƒ‚dS)zdEnter the watcher's context and allow starting new processes This function must return selfNrrßrrrÚ __enter__fszAbstractChildWatcher.__enter__cCs tƒ‚dS)zExit the watcher's contextNr©rÚaÚbÚcrrrÚ__exit__lszAbstractChildWatcher.__exit__N) r²r³r´rµr_rrr%r\rr!rrrrr"s   rcCs2t |¡rt |¡ St |¡r*t |¡S|SdSr)rxÚ WIFSIGNALEDÚWTERMSIGÚ WIFEXITEDÚ WEXITSTATUS)ÚstatusrrrÚ_compute_returncodeqs     r'c@sDeZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dS)ÚBaseChildWatchercCsd|_i|_dSr)r¸Ú _callbacksrßrrrr�szBaseChildWatcher.__init__cCs| d¡dSr)rrßrrrr%…szBaseChildWatcher.closecCs|jdk o|j ¡Sr)r¸Z is_runningrßrrrr\ˆszBaseChildWatcher.is_activecCs tƒ‚dSrr)rÚ expected_pidrrrÚ _do_waitpid‹szBaseChildWatcher._do_waitpidcCs tƒ‚dSrrrßrrrÚ_do_waitpid_allŽsz BaseChildWatcher._do_waitpid_allcCs~|dkst|tjƒst‚|jdk r<|dkr<|jrrr%rßr!rrr%s  zFastChildWatcher.closec Cs0|j� |jd7_|W5QR£SQRXdS)Nr)r=r?rßrrrrszFastChildWatcher.__enter__c Cs^|j�B|jd8_|js"|js0W5QR£dSt|jƒ}|j ¡W5QRXt d|¡dS)Nrz5Caught subprocesses termination from unknown pids: %s)r=r?r>r?r-r r)rrrr Zcollateral_victimsrrrr!s  þzFastChildWatcher.__exit__c Gst|jstdƒ‚|j�Fz|j |¡}Wn.tk rT||f|j|<YW5QR£dSXW5QRX|||f|žŽdS)NzMust use the context manager)r?rwr=r>r;rJr))rrnrDrErorrrr_'sz"FastChildWatcher.add_child_handlercCs*z|j|=WdStk r$YdSXdSr1r2rrrrr5s z%FastChildWatcher.remove_child_handlerc Csþzt dtj¡\}}Wntk r,YdSX|dkr:dSt|ƒ}|j�‚z|j |¡\}}WnNtk r¬|j r¤||j |<|j   ¡r–t  d||¡YW5QR£qd}YnX|j   ¡rÆt  d||¡W5QRX|dkrèt  d||¡q|||f|žŽqdS)Nr3rz,unknown process %s exited with returncode %sr6z8Caught subprocess termination from unknown pid: %d -> %d)rxr8r9r:r'r=r)r;rJr?r>r¸rÛr rÞr)rrnr&rorDrErrrr,<s@  þ  ÿþz FastChildWatcher._do_waitpid_all) r²r³r´rµrr%rr!r_rr,r¶rrr!rrþs  rc@sheZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„ZdS)ra~A watcher that doesn't require running loop in the main thread. This implementation registers a SIGCHLD signal handler on instantiation (which may conflict with other code that install own handler for this signal). The solution is safe but it has a significant overhead when handling a big number of processes (*O(n)* each time a SIGCHLD is received). cCsi|_d|_dSr)r)Ú_saved_sighandlerrßrrrrzszMultiLoopChildWatcher.__init__cCs |jdk Sr)r@rßrrrr\~szMultiLoopChildWatcher.is_activecCsT|j ¡|jdkrdSt tj¡}||jkr:t d¡nt tj|j¡d|_dS)Nz+SIGCHLD handler was changed by outside code) r)r-r@r9Ú getsignalr.r/r r)rrNrrrr%�s     zMultiLoopChildWatcher.closecCs|Srrrßrrrr�szMultiLoopChildWatcher.__enter__cCsdSrr©rÚexc_typeZexc_valZexc_tbrrrr!�szMultiLoopChildWatcher.__exit__cGs&t ¡}|||f|j|<| |¡dSr)rÚget_running_loopr)r+)rrnrDrErˆrrrr_“sz'MultiLoopChildWatcher.add_child_handlercCs*z|j|=WdStk r$YdSXdSr1r2rrrrršs z*MultiLoopChildWatcher.remove_child_handlercCsN|jdk rdSt tj|j¡|_|jdkrýsÿz6ThreadedChildWatcher._join_threads..N)r(rIÚvaluesrÕ)rÚthreadsrOrrrrJûsz"ThreadedChildWatcher._join_threadscCs|SrrrßrrrrszThreadedChildWatcher.__enter__cCsdSrrrBrrrr!szThreadedChildWatcher.__exit__cCs6dd„t|j ¡ƒDƒ}|r2||j›d�t|d�dS)NcSsg|]}| ¡r|‘qSr)rKrMrrrrP sÿz0ThreadedChildWatcher.__del__..z0 has registered but not finished child processesr#)r(rIrQr"r,)rrìrRrrrrís  þzThreadedChildWatcher.__del__cGsFt ¡}tj|jdt|jƒ›�||||fdd�}||j|<| ¡dS)Nzwaitpid-T)ÚtargetÚnamerErL) rrDr<ZThreadr+ÚnextrHrIÚstart)rrnrDrErˆrOrrrr_s ý z&ThreadedChildWatcher.add_child_handlercCsdSrörrrrrrsz)ThreadedChildWatcher.remove_child_handlercCsdSrrrrrrrsz ThreadedChildWatcher.attach_loopcCs¤|dks t‚zt |d¡\}}Wn(tk rH|}d}t d|¡Yn Xt|ƒ}| ¡rht d||¡|  ¡r€t d||¡n|j |||f|žŽ|j   |¡dS)Nrr4r5r6rE) rwrxr8r:r rr'rÛrÞrFrmrIr;)rrˆr*rDrErnr&rorrrr+"s( þ ÿz ThreadedChildWatcher._do_waitpidN)r²r³r´rµrr\r%rJrr!r*r+rír_rrr+rrrrräs  rcsHeZdZdZeZ‡fdd„Zdd„Z‡fdd„Zdd „Z d d „Z ‡Z S) Ú_UnixDefaultEventLoopPolicyz:UNIX event loop policy with a watcher for child processes.cstƒ ¡d|_dSr)rrÚ_watcherrßr!rrrAs z$_UnixDefaultEventLoopPolicy.__init__c CsHtj�8|jdkr:tƒ|_tt ¡tjƒr:|j |j j ¡W5QRXdSr) rr=rXrrOr<Úcurrent_threadÚ _MainThreadrÚ_localr¸rßrrrÚ _init_watcherEs ÿz)_UnixDefaultEventLoopPolicy._init_watchercs6tƒ |¡|jdk r2tt ¡tjƒr2|j |¡dS)zÑSet the event loop. As a side effect, if a child watcher was set before, then calling .set_event_loop() from the main thread will call .attach_loop(loop) on the child watcher. N)rÚset_event_looprXrOr<rYrZrrr!rrr]Ms   ÿz*_UnixDefaultEventLoopPolicy.set_event_loopcCs|jdkr| ¡|jS)z~Get the watcher for child processes. If not yet set, a ThreadedChildWatcher object is automatically created. N)rXr\rßrrrr[[s z-_UnixDefaultEventLoopPolicy.get_child_watchercCs4|dkst|tƒst‚|jdk r*|j ¡||_dS)z$Set the watcher for child processes.N)rOrrwrXr%)rrjrrrÚset_child_watcheres  z-_UnixDefaultEventLoopPolicy.set_child_watcher) r²r³r´rµrZ _loop_factoryrr\r]r[r^r¶rrr!rrW=s   rW)2rµrBr—rGrxrÓr9rzrŠrr&r<r*Úrrrrrrr r r r Úlogr Ú__all__rüÚ ImportErrorrZBaseSelectorEventLooprZ ReadTransportrRZ_FlowControlMixinZWriteTransportrYZBaseSubprocessTransportr^rr'r(rrrrZBaseDefaultEventLoopPolicyrWrrrrrrÚs`             ÿNO5Ji}Y3