Your IP : 13.59.51.223


Current Path : /opt/alt/python313/lib64/python3.13/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/asyncio/__pycache__/unix_events.cpython-313.pyc

�

1}g�����SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSK
Jr SSK
Jr SSK
Jr SSK
Jr SSK
Jr SS	K
Jr SS
K
Jr SSK
Jr SSK
Jr SS
K
Jr SSKJr Sr\
R6S:Xa\"S5eSrSr"SS\R>5r "SS\RB5r""SS\RF\RH5r%"SS\RL5r'"SS5r("SS\(5r)"S S!\(5r*"S"S#\*5r+"S$S%\*5r,"S&S'\(5r-"S(S)\(5r.S*r/"S+S,\R`5r1\ r2\1r3\2r4g)-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�PidfdChildWatcher�MultiLoopChildWatcher�ThreadedChildWatcher�DefaultEventLoopPolicy�	EventLoop�win32z+Signals are not really supported on Windowsc��g)zDummy signal handler.N�)�signum�frames  �:/opt/alt/python313/lib64/python3.13/asyncio/unix_events.py�_sighandler_noopr+s���c�T�[R"U5$![a Us$f=f�N)�os�waitstatus_to_exitcode�
ValueError)�statuss rr#r#0s.����(�(��0�0�����
�	�s��'�'c	��^�\rSrSrSrSU4SjjrU4SjrSrSrSr	S	r
S
rSSjrSSjr
SS
jrSrSSSSSSS.SjjrSSSSSSSSS.SjjrSrSrSrSrU4SjrSrU=r$)�_UnixSelectorEventLoop�:z\Unix event loop.

Adds signal handling and UNIX Domain Socket support to SelectorEventLoop.
Nc�@>�[TU]U5 0Ul0Ulgr!)�super�__init__�_signal_handlers�_unix_server_sockets)�self�selector�	__class__s  �rr+�_UnixSelectorEventLoop.__init__@s ���
����"� "���$&��!rc�H>�[TU]5 [R"5(d.[	UR
5HnUR
U5 M gUR
(a:[R"SU<S3[US9 UR
R5 gg)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.�sigr0s  �rr5�_UnixSelectorEventLoop.closeEs����
��
��� � �"�"��D�1�1�2���*�*�3�/�3��$�$��
�
� 1�$��:H�I�.�%)�	+�
�%�%�+�+�-�
%rc�J�UHnU(dMURU5 M gr!)�_handle_signal)r.�datars   r�_process_self_data�)_UnixSelectorEventLoop._process_self_dataSs ���F�������'�	rc��[R"U5(d"U5(a[S5eUR	U5 UR5 [R"URR55 [R"X#US5nXPR U'[R"U["5 [R$"US5 g![[4an[[U55eSnAff=f![a�nUR U	UR (dL[R"S5 O4![[4a!n[&R("SU5 SnAOSnAff=fUR*[*R,:Xa[SUS35eeSnAff=f)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)r�iscoroutine�iscoroutinefunction�	TypeError�
_check_signal�
_check_closed�signal�
set_wakeup_fd�_csock�filenor$�OSError�RuntimeError�strr�Handler,r�siginterruptr�info�errno�EINVAL)r.r>�callback�args�exc�handle�nexcs       r�add_signal_handler�)_UnixSelectorEventLoop.add_signal_handlerZss��
�"�"�8�,�,��.�.�x�8�8��8�9�
9����3������	)�

� � ����!3�!3�!5�6����x�t�T�:��%+���c�"�	�
�M�M�#�/�0�
����U�+���G�$�	)��s�3�x�(�(��	)���	��%�%�c�*��(�(�F��(�(��,��"�G�,�F��K�K� >��E�E��F���y�y�E�L�L�(�"�T�#��.?�#@�A�A���	�sZ�$.C,�92D�,D�<D�D�
F?�"F:�E�F:�F	�(F�?F:�F	�	1F:�:F?c��URRU5nUcgUR(aURU5 gUR	U5 g)z2Internal helper that is the actual signal handler.N)r,�get�
_cancelledr9�_add_callback_signalsafe)r.r>r^s   rrA�%_UnixSelectorEventLoop._handle_signal�sE���&�&�*�*�3�/���>������&�&�s�+��)�)�&�1rc�4�URU5 URU	U[R:Xa[R
nO[Rn[R"X5 UR(d[R"S5 gg![a gf=f![a3nUR[R:Xa[SUS35eeSnAff=f![[4a!n[R"SU5 SnAgSnAff=f)zgRemove a handler for a signal.  UNIX only.

Return True if a signal handler was removed, False if not.
FrHrINrFrGT)rMr,�KeyErrorrO�SIGINT�default_int_handler�SIG_DFLrSrYrZrTrPr$rrX)r.r>�handlerr]s    rr9�,_UnixSelectorEventLoop.remove_signal_handler�s���
	
���3��	��%�%�c�*��&�-�-���0�0�G��n�n�G�	��M�M�#�'��$�$�
A��$�$�R�(���-�	��	���	��y�y�E�L�L�(�"�T�#��.?�#@�A�A���		����(�
A����:�C�@�@���
A�sA�
B�B&�>C&�
B#�"B#�&
C#�0.C�C#�&D�6D�Dc��[U[5(d[SU<35eU[R"5;a[SU35eg)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�intrLrO�
valid_signalsr$)r.r>s  rrM�$_UnixSelectorEventLoop._check_signal�sM���#�s�#�#��6�s�g�>�?�?��f�*�*�,�,��5�c�U�;�<�<�-rc��[XX#U5$r!)�_UnixReadPipeTransport�r.�pipe�protocol�waiter�extras     r�_make_read_pipe_transport�0_UnixSelectorEventLoop._make_read_pipe_transport�s��%�d�(�E�J�Jrc��[XX#U5$r!)�_UnixWritePipeTransportrus     r�_make_write_pipe_transport�1_UnixSelectorEventLoop._make_write_pipe_transport�s��&�t�8�U�K�Krc	��# �[R"5 [R"S[5 [R
"5n
SSS5 W
 U
R
5(d[S5eUR5n[XX#XEXg4X�S.U	D6nU
RUR5URU5 UIShv�N SSS5 U$!,(df   N�=fN ![[4a e[a+ UR!5 UR#5IShv�N ef=f!,(df   W$=f7f)N�ignorezRasyncio.get_child_watcher() is not activated, subprocess support is not installed.)rxry)r:�catch_warnings�simplefilter�DeprecationWarningr�get_child_watcher�	is_activerT�
create_future�_UnixSubprocessTransport�add_child_handler�get_pid�_child_watcher_callback�
SystemExit�KeyboardInterrupt�
BaseExceptionr5�_wait)
r.rwr\�shell�stdin�stdout�stderr�bufsizery�kwargs�watcherrx�transps
             r�_make_subprocess_transport�1_UnixSelectorEventLoop._make_subprocess_transport�s)����
$�
$�
&��!�!�(�,>�?��.�.�0�G�'���$�$�&�&�
#�$G�H�H��'�'�)�F�-�d�d�,1�6�6�39�6�/5�6�F�
�%�%�f�n�n�&6�$(�$@�$@�&�
J�
����!�0�
�9'�
&��(��� 1�2�
�� �
������l�l�n�$�$��
��'�W�0�
�se�E�1C�	
E�A-D1�C)�C'�C)�
E�
C$� E�'C)�)=D.�&D)�'D.�.D1�1
E�;Ec�<�URURU5 gr!)�call_soon_threadsafe�_process_exited)r.�pid�
returncoder�s    rr��._UnixSelectorEventLoop._child_watcher_callback�s���!�!�&�"8�"8�*�Er)�ssl�sock�server_hostname�ssl_handshake_timeout�ssl_shutdown_timeoutc	��# �Ub[U[5(deU(aUc[S5eO*Ub[S5eUb[S5eUb[S5eUb�Ub[S5e[R"U5n[
R
"[
R[
RS5nURS5 URXB5IShv�N OjUc[S5eUR[
R:wdUR[
R:wa[S	U<35eURS5 URXAX5UUS
9IShv�Nup�X�4$N�! UR5 e=fN!7f)Nz/you have to pass server_hostname when using sslz+server_hostname is only meaningful with ssl�1ssl_handshake_timeout is only meaningful with ssl�0ssl_shutdown_timeout is only meaningful with ssl�3path and sock can not be specified at the same timerFzno path and sock were specified�.A UNIX Domain Stream Socket was expected, got )r�r�)rorUr$r"�fspath�socket�AF_UNIX�SOCK_STREAM�setblocking�sock_connectr5�family�type�_create_connection_transport)
r.�protocol_factory�pathr�r�r�r�r��	transportrws
          r�create_unix_connection�-_UnixSelectorEventLoop.create_unix_connection�s�����&�*�_�c�*J�*J�J�J���&� �E�G�G�'��*� �!N�O�O�$�0� �G�I�I�#�/� �F�H�H����� �I�K�K��9�9�T�?�D��=�=�����1C�1C�Q�G�D�
�� � ��'��'�'��3�3�3��|� �!B�C�C����v�~�~�-��I�I��!3�!3�3� �D�T�H�M�O�O����U�#�$(�$E�$E��C�"7�!5�%F�%7�7��	��"�"�%4��
��
�
����7�s=�B6F�9%E/�E-�E/�#BF�#F�$	F�-E/�/F�F�dT)r��backlogr�r�r��
start_serving�cleanup_socketc	���# �[U[5(a[S5eUbU(d[S5eUbU(d[S5eUb�Ub[S5e[R
"U5n[R"[R[R5nUSS;aP[R"[R"U5R5(a[R"U5 UR#U5 OYUc[S
5eUR*[R:wdUR,[R:wa[SU<35eU	(aGUR/5nUSS;a.[R"U5R0UR2U'UR5S5 [6R8"X/UXTUU5n
U(a.U
R;5 [<R>"S5IShv�N U
$![a GN*[a"n
[R "SX*5 Sn
A
GNPSn
A
ff=f![aVnUR%5 UR&[&R(:Xa"SU<S	3n[[&R(U5SeeSnAf UR%5 e=f![a GNf=fN�7f)
Nz*ssl argument must be an SSLContext or Noner�r�r�r)r�z2Unable to check or remove stale UNIX socket %r: %rzAddress z is already in usez-path was not specified, and no sock specifiedr�F) ro�boolrLr$r"r�r�r�r��stat�S_ISSOCK�st_mode�remove�FileNotFoundErrorrSr�error�bindr5rY�
EADDRINUSEr�r��getsockname�st_inor-r�r�Server�_start_servingr�sleep)r.r�r�r�r�r�r�r�r�r��errr]�msg�servers              r�create_unix_server�)_UnixSelectorEventLoop.create_unix_servers�����c�4� � ��H�I�I� �,�S��C�E�
E� �+�C��B�D�
D����� �I�K�K��9�9�T�?�D��=�=�����1C�1C�D�D��A�w�k�)�6��}�}�R�W�W�T�]�%:�%:�;�;��	�	�$��

��	�	�$���|� �C�E�E����v�~�~�-��I�I��!3�!3�3� �D�T�H�M�O�O���#�#�%�D��A�w�k�)��68�g�g�d�m�6J�6J�D�-�-�d�3�	
������#�#�D�&�2B�$'�2G�$8�:����!�!�#��+�+�a�.� � ��
��e)����6��L�L�"*�+/�6�6��6���
��
�
���9�9�� 0� 0�0�%�T�H�,>�?�C�!�%�"2�"2�C�8�d�B���
��
�
����")�����
!�s��B.K�1AH�I�A:K�
-K�:AK�K�K�
I�'K�*	I�3I�
K�I�K�
K	�"AJ3�3K	�	K�
K�K�K�Kc
��# �[R UR5n[R"U5RnU(aUOUnU(dgUR5n	URU	SXX4US5 U	IShv�N$![a [R"S5ef=f![[R4an[R"S5eSnAff=f![a [R"S5ef=fN�7f)Nzos.sendfile() is not availableznot a regular filer)
r"�sendfile�AttributeErrorr	�SendfileNotAvailableErrorrR�io�UnsupportedOperation�fstat�st_sizerSr��_sock_sendfile_native_impl)
r.r��file�offset�countrRr��fsize�	blocksize�futs
          r�_sock_sendfile_native�,_UnixSelectorEventLoop._sock_sendfile_nativems����	2��K�K�	M��[�[�]�F�	M��H�H�V�$�,�,�E�#�E��	���� � �"���'�'��T�4�(.�y�!�	E��y���%�	2��6�6�0�2�
2�	2��
�� 7� 7�8�	M��6�6�7K�L�L��	M���	M��6�6�7K�L�L�	M���sV�D�B	�B-� C%�>D�D	�D�	!B*�*D�-C"�C�C"�"D�%!D�Dc	
��UR5n	UbURU5 UR5(aURXEU5 gU(a.Xh-
nUS::a$URXEU5 UR	U5 g[U[RS-S-5n[R"X�XW5n
U
S:Xa$URXEU5 UR	U5 gXZ-
nX�-
nUcURX5 URX�RUX�UXVXx5
 g![[4a7 UcURX5 URX�RUX�UXVXx5
 g[a�nUbRUR [ R":Xa4[%U5[&La"['S[ R"5nX�lUnUS:Xa>[*R,"S5n
URXEU5 UR/U
5 SnAgURXEU5 UR/U5 SnAgSnAf[0[24a e[4a-nURXEU5 UR/U5 SnAgSnAff=f)Nr�rzsocket is not connectedzos.sendfile call failed)rR�
remove_writer�	cancelled�_sock_sendfile_update_filepos�
set_result�minr6�maxsizer"r��_sock_add_cancellation_callback�
add_writerr��BlockingIOError�InterruptedErrorrSrY�ENOTCONNr��ConnectionError�	__cause__r	r��
set_exceptionr�r�r�)r.r��
registered_fdr�rRr�r�r��
total_sent�fd�sentr]�new_excr�s              rr��1_UnixSelectorEventLoop._sock_sendfile_native_impl�sA��
�[�[�]���$�

���}�-��=�=�?�?��.�.�v�z�J����*�I��A�~��2�2�6�:�N����z�*���	�3�;�;��>�A�#5�6�	�1	F��;�;�r�6�=�D�J�q�y��2�2�6�:�N����z�*�����"�
� �(��8�8��C�����$C�$C�S� "�&� &�y�F��[ �!1�2�	B��$��4�4�S�?��O�O�B� ?� ?���f�"�9�
B��	'��)��I�I����/���I�_�4�
*�-�u�~�~�?��$'�!����Q��
!�:�:�-�/���2�2�6�:�N��!�!�#�&�&��2�2�6�:�N��!�!�#�&�&���-�.�	���	#��.�.�v�z�J����c�"�"��	#�s2�#D!�!AI;�'	I;�0BH1�	#H1�1I;�#I6�6I;c�\�US:�a&[R"X[R5 gg�Nr)r"�lseek�SEEK_SET)r.rRr�r�s    rr��4_UnixSelectorEventLoop._sock_sendfile_update_filepos�s ����>��H�H�V�R�[�[�1�rc�8^^�UU4SjnURU5 g)Nc�>�UR5(a)TR5nUS:waTRU5 ggg)NrF)r�rRr�)r�r�r.r�s  ��r�cb�B_UnixSelectorEventLoop._sock_add_cancellation_callback.<locals>.cb�s8����}�}����[�[�]����8��&�&�r�*��r)�add_done_callback)r.r�r�r�s` ` rr��6_UnixSelectorEventLoop._sock_add_cancellation_callback�s���	+�
	���b�!rc�>�XR;aUR5nOSn[TU]
U5 UbYURUnURU	[R
"U5RU:Xa[R"U5 ggg![a g[a!n[R"SX$5 SnAgSnAff=f)Nz/Unable to clean up listening UNIX socket %r: %r)r-r�r*�
_stop_servingr"r�r��unlinkr�rSrr�)r.r�r��prev_inor�r0s     �rr�$_UnixSelectorEventLoop._stop_serving�s�����,�,�,��#�#�%�D��D�
���d�#����0�0��6�H��)�)�$�/�
2��7�7�4�=�'�'�8�3��I�I�d�O�4�	��%�
���
2����&�'+�2�2��
2�s�:B�
C�	C�%C�C)r,r-r!�NN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r+r5rCr`rAr9rMrzr~r�r�r�r�r�r�r�r�r�__static_attributes__�
__classcell__�r0s@rr'r':s�����
'�
.�(�+�Z2��@
=�@D�(,�K�AE�)-�L�04��BF�*.�0#��4� �"&�!%�0#�f*.�P��s��"&�!%��t�P�d�.GF�R2�"�2�2rr'c�^�\rSrSrSrSU4SjjrSrSrSrSr	Sr
S	rS
rSr
SrS
r\R"4SjrSSjrSrSrSrU=r$)rti�ic�V>�[TU]U5 X RS'XlX lUR5UlX0lSUlSUl	[R"UR5Rn[R"U5(dV[R"U5(d;[R "U5(d SUlSUlSUl[#S5e[R$"URS5 URR'URR(U5 URR'UR*URUR,5 Ub,URR'[.R0US5 gg)NrvFz)Pipe transport is for pipes/sockets only.)r*r+�_extra�_loop�_piperR�_fileno�	_protocol�_closing�_pausedr"r�r�r��S_ISFIFOr��S_ISCHRr$�set_blocking�	call_soon�connection_made�_add_reader�_read_readyr
�_set_result_unless_cancelled)r.�looprvrwrxry�moder0s       �rr+�_UnixReadPipeTransport.__init__�s/���
�����"���F���
��
��{�{�}���!����
�����x�x����%�-�-���
�
�d�#�#��
�
�d�#�#����T�"�"��D�J��D�L�!�D�N��H�I�I�
������e�,��
�
���T�^�^�;�;�T�B��
�
���T�-�-�!�\�\�4�+;�+;�	=����J�J� � ��!E�!E�!'��
/�rc�f�UR5(dgURRX5 gr!)�
is_readingrr)r.r�r[s   rr�"_UnixReadPipeTransport._add_readers$����� � ���
�
���r�,rc�T�UR(+=(a UR(+$r!)rr�r.s rr&�!_UnixReadPipeTransport.is_readings���<�<��5��
�
�$5�5rc��URR/nURcURS5 O"UR(aURS5 URSUR
35 [
URSS5nURb]UbZ[R"X R
[R5nU(aURS5 OBURS5 O0URbURS5 OURS5 SRS	RU55$)
N�closed�closing�fd=�	_selector�polling�idle�open�<{}>� )r0r	r�appendrr�getattrrr�_test_selector_event�	selectors�
EVENT_READ�format�join)r.rXr/r0s    r�__repr__�_UnixReadPipeTransport.__repr__s������'�'�(���:�:���K�K��!�
�]�]��K�K�	�"����c�$�,�,��(�)��4�:�:�{�D�9���:�:�!�h�&:�%�:�:��,�,�	�(<�(<�>�G�����I�&����F�#�
�Z�Z�
#��K�K����K�K��!��}�}�S�X�X�d�^�,�,rc��[R"URUR5nU(aURRU5 gURR5(a[R"SU5 SUl
URRUR5 URRURR5 URRURS5 g![[ 4a g["anUR%US5 SnAgSnAff=f)N�%r was closed by peerTz"Fatal read error on pipe transport)r"�readr�max_sizer�
data_receivedr�	get_debugrrXr�_remove_readerr�eof_received�_call_connection_lostr�r�rS�_fatal_error)r.rBr]s   rr �"_UnixReadPipeTransport._read_ready.s���	G��7�7�4�<�<����7�D�����,�,�T�2��:�:�'�'�)�)��K�K� 7��>� $��
��
�
�)�)�$�,�,�7��
�
�$�$�T�^�^�%@�%@�A��
�
�$�$�T�%?�%?��F�� �!1�2�	���	I����c�#G�H�H��	I�s�+D�D?�	D?�#D:�:D?c��UR5(dgSUlURRUR5 URR5(a[R"SU5 gg)NTz%r pauses reading)r&rrrDrrCr�debugr)s r�
pause_reading�$_UnixReadPipeTransport.pause_reading@sV����� � ������
�
�!�!�$�,�,�/��:�:���!�!��L�L�,�d�3�"rc�&�UR(dUR(dgSUlURRURUR
5 URR
5(a[R"SU5 gg)NFz%r resumes reading)	rrrrrr rCrrJr)s r�resume_reading�%_UnixReadPipeTransport.resume_readingHs^���=�=���������
�
���t�|�|�T�-=�-=�>��:�:���!�!��L�L�-�t�4�"rc��Xlgr!�r�r.rws  r�set_protocol�#_UnixReadPipeTransport.set_protocolP���!�rc��UR$r!rQr)s r�get_protocol�#_UnixReadPipeTransport.get_protocolS����~�~�rc��UR$r!�rr)s r�
is_closing�!_UnixReadPipeTransport.is_closingV����}�}�rc�J�UR(dURS5 ggr!)r�_closer)s rr5�_UnixReadPipeTransport.closeYs���}�}��K�K���rc�t�URb+U"SU<3[US9 URR5 gg�Nzunclosed transport r3�rr<r5�r.�_warns  r�__del__�_UnixReadPipeTransport.__del__]�5���:�:�!��'��x�0�/�$�O��J�J����"rc�L�[U[5(aTUR[R:Xa6URR5(a[R"SXSS9 O*URRUUUURS.5 URU5 g�Nz%r: %sT��exc_info)�message�	exceptionr�rw)rorSrY�EIOrrCrrJ�call_exception_handlerrr`�r.r]rns   rrG�#_UnixReadPipeTransport._fatal_errorbsw���s�G�$�$����e�i�i�)?��z�z�#�#�%�%����X�t�t�D���J�J�-�-�"� �!� �N�N�	/�
�	
���C�rc��SUlURRUR5 URR	UR
U5 g�NT)rrrDrrrF�r.r]s  rr`�_UnixReadPipeTransport._closeps9����
��
�
�!�!�$�,�,�/��
�
���T�7�7��=rc��URRU5 URR5 SUlSUlSUlg!URR5 SUlSUlSUlf=fr!�r�connection_lostrr5rrvs  rrF�,_UnixReadPipeTransport._call_connection_lostu�g��	��N�N�*�*�3�/��J�J�����D�J�!�D�N��D�J��
�J�J�����D�J�!�D�N��D�J���A
�
1A>)rrrrrrr�zFatal error on pipe transport)r	r
rrrAr+rr&r<r rKrNrSrWr\r5r:r;rgrGr`rFrrrs@rrtrt�sb����H�/�<-�
6�-�*G�$4�5�"����%�M�M��
�>�
�rrtc�^�\rSrSrSU4SjjrSrSrSrSrSr	Sr
S	rS
rSr
SrS
r\R"4SjrSrSSjrSSjrSrSrU=r$)r}ic��>�[T
U]XQ5 X RS'X lUR	5UlX0l[5UlSUl	SUl
[R"UR
5Rn[R"U5n[R "U5n[R""U5n	U(d.U(d'U	(d SUlSUlSUl[%S5e[R&"UR
S5 UR(R+URR,U5 U	(d+U(ai[.R0R3S5(dEUR(R+UR(R4UR
UR65 Ub,UR(R+[8R:US5 gg)NrvrFz?Pipe transport is only for pipes, sockets and character devices�aix)r*r+rrrRrr�	bytearray�_buffer�
_conn_lostrr"r�r�r�rrr�r$rrrrr6�platform�
startswithrr r
r!)r.r"rvrwrxryr#�is_char�is_fifo�	is_socketr0s          �rr+� _UnixWritePipeTransport.__init__�sd���
����%�"���F���
��{�{�}���!�� �{��������
��x�x����%�-�-���,�,�t�$���-�-��%���M�M�$�'�	��7�i��D�J��D�L�!�D�N��D�E�
E�	������e�,��
�
���T�^�^�;�;�T�B�
�����)@�)@��)G�)G��J�J� � ����!7�!7�!%���t�/?�/?�
A����J�J� � ��!E�!E�!'��
/�rc���URR/nURcURS5 O"UR(aURS5 URSUR
35 [
URSS5nURb�Ub~[R"X R
[R5nU(aURS5 OURS5 UR5nURSU35 O0URbURS5 OURS5 S	RS
RU55$)Nr,r-r.r/r0r1zbufsize=r2r3r4)r0r	rr5rrr6rrr7r8�EVENT_WRITE�get_write_buffer_sizer:r;)r.rXr/r0r�s     rr<� _UnixWritePipeTransport.__repr__�s	�����'�'�(���:�:���K�K��!�
�]�]��K�K�	�"����c�$�,�,��(�)��4�:�:�{�D�9���:�:�!�h�&:�%�:�:��,�,�	�(=�(=�?�G�����I�&����F�#��0�0�2�G��K�K�(�7�)�,�-�
�Z�Z�
#��K�K����K�K��!��}�}�S�X�X�d�^�,�,rc�,�[UR5$r!)�lenr�r)s rr��-_UnixWritePipeTransport.get_write_buffer_size�s���4�<�<� � rc���URR5(a[R"SU5 UR(aUR[
55 gUR5 g)Nr?)rrCrrXr�r`�BrokenPipeErrorr)s rr �#_UnixWritePipeTransport._read_ready�sC���:�:���!�!��K�K�/��6��<�<��K�K��)�*��K�K�Mrc��[U[[[45(d[	U55e[U[5(a[U5nU(dgUR
(dUR(aJUR
[R:�a[R"S5 U=R
S-
slgUR(dv[R"URU5nU[+U5:XagUS:�a[U5USnUR,R/URUR05 U=RU-
slUR35 g![[ 4a SnN�["[$4a e[&a1nU=R
S-
slUR)US5 SnAgSnAff=f)Nz=pipe closed by peer or os.write(pipe, data) raised exception.rr�#Fatal write error on pipe transport)ro�bytesr��
memoryview�reprr�rr�!LOG_THRESHOLD_FOR_CONNLOST_WRITESr�warningr�r"�writerr�r�r�r�r�rGr�r�_add_writer�_write_ready�_maybe_pause_protocol)r.rB�nr]s    rr��_UnixWritePipeTransport.write�s]���$��	�:� >�?�?�K��d��K�?��d�I�&�&��d�#�D����?�?�d�m�m����)�"M�"M�M���� H�I��O�O�q� �O���|�|�	
��H�H�T�\�\�4�0���C��I�~���Q��!�$�'���+���J�J�"�"�4�<�<��1B�1B�C��������"�"�$��$�%5�6�
���� 1�2�
�� �
����1�$���!�!�#�'L�M���
�s�!E2�2G�G�'G�Gc�T�UR(dS5e[R"URUR5nU[	UR5:Xa�URR5 URRUR5 UR5 UR(a6URRUR5 URS5 gUS:�aURSU2	gg![[4a g[[4a e[ apnURR5 U=R"S-
slURRUR5 UR%US5 SnAgSnAff=f)NzData should not be emptyrrr�)r�r"r�rr�r=r�_remove_writer�_maybe_resume_protocolrrDrFr�r�r�r�r�r�rG)r.r�r]s   rr��$_UnixWritePipeTransport._write_ready�s@���|�|�7�7�7�|�	%�������t�|�|�4�A��C����%�%����"�"�$��
�
�)�)�$�,�,�7��+�+�-��=�=��J�J�-�-�d�l�l�;��.�.�t�4���Q���L�L��!��$���) �!1�2�	���-�.�	���	J��L�L��� ��O�O�q� �O�
�J�J�%�%�d�l�l�3����c�#H�I�I��
	J�s�+D�F'�F'�7A&F"�"F'c��grurr)s r�
can_write_eof�%_UnixWritePipeTransport.can_write_eof
���rc��UR(agUR(deSUlUR(dLURR	UR
5 URR
URS5 ggru)rrr�rrDrrrFr)s r�	write_eof�!_UnixWritePipeTransport.write_eof
s[���=�=���z�z��z���
��|�|��J�J�%�%�d�l�l�3��J�J� � ��!;�!;�T�B�rc��Xlgr!rQrRs  rrS�$_UnixWritePipeTransport.set_protocolrUrc��UR$r!rQr)s rrW�$_UnixWritePipeTransport.get_protocolrYrc��UR$r!r[r)s rr\�"_UnixWritePipeTransport.is_closingr^rc�d�URb#UR(dUR5 gggr!)rrr�r)s rr5�_UnixWritePipeTransport.closes$���:�:�!�$�-�-��N�N��+8�!rc�t�URb+U"SU<3[US9 URR5 ggrcrdres  rrg�_UnixWritePipeTransport.__del__$rirc�&�URS5 gr!)r`r)s r�abort�_UnixWritePipeTransport.abort)s�����D�rc��[U[5(a6URR5(a[R
"SXSS9 O*URR
UUUURS.5 URU5 grk)	rorSrrCrrJrqrr`rrs   rrG�$_UnixWritePipeTransport._fatal_error,sh���c�7�#�#��z�z�#�#�%�%����X�t�t�D���J�J�-�-�"� �!� �N�N�	/�
�	
���C�rc�H�SUlUR(a%URRUR5 URR5 URR
UR5 URRURU5 gru)	rr�rr�rr=rDrrFrvs  rr`�_UnixWritePipeTransport._close:sf����
��<�<��J�J�%�%�d�l�l�3��������
�
�!�!�$�,�,�/��
�
���T�7�7��=rc��URRU5 URR5 SUlSUlSUlg!URR5 SUlSUlSUlf=fr!ryrvs  rrF�-_UnixWritePipeTransport._call_connection_lostBr|r})r�rr�rrrrrr~r!)r	r
rrr+r<r�r r�r�r�r�rSrWr\r5r:r;rgr�rGr`rFrrrs@rr}r}si���#/�J-�0!��!%�F%�8�C�"����
%�M�M��
��>��rr}c��\rSrSrSrSrg)r�iLc
��SnU[R:Xa;[RR	S5(a[
R"5up8[R"U4X#XESUS.UD6UlUb:UR5 [UR5SUS9URlSnUb!UR5 UR5 gg!Ub!UR5 UR5 ff=f)Nr�F)r�r�r�r��universal_newlinesr��wb)�	buffering)
�
subprocess�PIPEr6r�r�r��
socketpair�Popen�_procr5r2�detachr�)	r.r\r�r�r�r�r�r��stdin_ws	         r�_start�_UnixSubprocessTransport._startNs������J�O�O�#����(?�(?��(F�(F�
$�.�.�0�N�E�	 �#�)�)��E�!�v�#(�'�E�=C�E�D�J��"����
�#'����(8�$�'�#R��
�
� ����"����
��
�
��#��w�"����
��
�
��#�s
�AC�&C<)r�N)r	r
rrr�rrrrr�r�Ls�� rr�c�L�\rSrSrSrS
SjrSrSrSrSr	S	r
S
rSrSr
g)ridaAbstract 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.
Nc�Z�UR[:wa[R"SSSS9 gg)Nr�P{name!r} is deprecated as of Python 3.12 and will be removed in Python {remove}.����r�)r
r	r:�_deprecated)�clss r�__init_subclass__�&AbstractChildWatcher.__init_subclass__{s,���>�>�X�%�� � �!7�;�%,�
.�&rc��[5e)z�Register 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.
��NotImplementedError�r.r�r[r\s    rr��&AbstractChildWatcher.add_child_handler�s
��"�#�#rc��[5e)z�Removes the handler for process 'pid'.

The function returns True if the handler was successfully removed,
False if there was nothing to remove.r��r.r�s  r�remove_child_handler�)AbstractChildWatcher.remove_child_handler�s
��"�#�#rc��[5e)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.
r��r.r"s  r�attach_loop� AbstractChildWatcher.attach_loop�s
��"�#�#rc��[5e)z\Close the watcher.

This must be called to make sure that any underlying resource is freed.
r�r)s rr5�AbstractChildWatcher.close�s
��
"�#�#rc��[5e)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.

r�r)s rr��AbstractChildWatcher.is_active�s
��"�#�#rc��[5e)z\Enter the watcher's context and allow starting new processes

This function must return selfr�r)s r�	__enter__�AbstractChildWatcher.__enter__�s
��"�#�#rc��[5e)zExit the watcher's contextr��r.�a�b�cs    r�__exit__�AbstractChildWatcher.__exit__�s��!�#�#rr)�returnN)r	r
rrr
r�r�r�r�r5r�r�r�rrrrrrds/���,.�	$�$�$�$�$�$�$rrc�H�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
g)
ri�aChild watcher implementation using Linux's pid file descriptors.

This child watcher polls process file descriptors (pidfds) to await child
process termination. In some respects, PidfdChildWatcher is a "Goldilocks"
child watcher implementation. It doesn't require signals or threads, doesn't
interfere with any processes launched outside the event loop, and scales
linearly with the number of subprocesses launched by the event loop. The
main disadvantage is that pidfds are specific to Linux, and only work on
recent (5.3+) kernels.
c��U$r!rr)s rr��PidfdChildWatcher.__enter__�����rc��gr!r)r.�exc_type�	exc_value�
exc_tracebacks    rr��PidfdChildWatcher.__exit__����rc��grurr)s rr��PidfdChildWatcher.is_active�r�rc��gr!rr)s rr5�PidfdChildWatcher.close�r�rc��gr!rr�s  rr��PidfdChildWatcher.attach_loop�r�rc��[R"5n[R"U5nUR	XPR
XX#5 gr!)r�get_running_loopr"�
pidfd_openr�_do_wait)r.r�r[r\r"�pidfds      rr��#PidfdChildWatcher.add_child_handler�s4���&�&�(���
�
�c�"������
�
�s�8�Jrc�*�[R"5nURU5 [R"US5upg[U5n[R"U5 U"X/UQ76 g![a Sn[R"SU5 NEf=f)Nr�zJchild process pid %d exit status already read:  will report returncode 255)
rrrDr"�waitpidr#�ChildProcessErrorrr�r5)	r.r�r	r[r\r"�_r%r�s	         rr�PidfdChildWatcher._do_wait�s����&�&�(�����E�"�	8��
�
�3��*�I�A�0��7�J�
�������(�4�(��!�	��J��N�N�.��
�		�s�A,�,#B�Bc��grurr�s  rr��&PidfdChildWatcher.remove_child_handler����rrN)r	r
rrr
r�r�r�r5r�r�rr�rrrrrr�s0��	��
��
�
�K�
)�&rrc�>�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�BaseChildWatcheri�c� �SUl0Ulgr!)r�
_callbacksr)s rr+�BaseChildWatcher.__init__�s����
���rc�&�URS5 gr!)r�r)s rr5�BaseChildWatcher.close�s������rc�`�URSL=(a URR5$r!)r�
is_runningr)s rr��BaseChildWatcher.is_active�s#���z�z��%�A�$�*�*�*?�*?�*A�Arc��[5er!r�)r.�expected_pids  r�_do_waitpid�BaseChildWatcher._do_waitpid���!�#�#rc��[5er!r�r)s r�_do_waitpid_all� BaseChildWatcher._do_waitpid_allr"rc��Ub![U[R5(deURb/Uc,UR(a[
R"S[5 URb)URR[R5 XlUb;UR[RUR5 UR5 gg)NzCA loop is being detached from a child watcher with pending handlers)ror�AbstractEventLooprrr:r;�RuntimeWarningr9rO�SIGCHLDr`�	_sig_chldr$r�s  rr��BaseChildWatcher.attach_loops����|�z�$��0H�0H�I�I�I�I��:�:�!�d�l�t����M�M�=��
 �
�:�:�!��J�J�,�,�V�^�^�<��
����#�#�F�N�N�D�N�N�C�
� � �"�rc��UR5 g![[4a e[a(nURRSUS.5 SnAgSnAff=f)N�$Unknown exception in SIGCHLD handler)rnro)r$r�r�r�rrqrvs  rr*�BaseChildWatcher._sig_chldsX��	�� � �"���-�.�	���	�
�J�J�-�-�A� �/�
�
��		�s��A�A�A)rrN)r	r
rrr+r5r�r r$r�r*rrrrrr�s&����B�$�$�#�(rrc�\^�\rSrSrSrU4SjrU4SjrSrSrSr	Sr
S	rS
rSr
U=r$)ri)aL'Safe' child watcher implementation.

This implementation avoids disrupting other code spawning processes by
polling explicitly each process in the SIGCHLD handler instead of calling
os.waitpid(-1).

This is a safe solution but it has a significant overhead when handling a
big number of children (O(n) each time SIGCHLD is raised)
c�N>�[TU]5 [R"SSSS9 g)Nrr�r�r�)r*r+r:r��r.r0s �rr+�SafeChildWatcher.__init__4s'���
�������/�;�%,�	.rc�V>�URR5 [TU]
5 gr!)rr=r*r5r1s �rr5�SafeChildWatcher.close;s���������
��
�rc��U$r!rr)s rr��SafeChildWatcher.__enter__?r�rc��gr!rr�s    rr��SafeChildWatcher.__exit__Br�rc�F�X#4URU'URU5 gr!)rr r�s    rr��"SafeChildWatcher.add_child_handlerEs#�� (�/������	
����rc�@�URU	g![a gf=f�NTF�rrhr�s  rr��%SafeChildWatcher.remove_child_handlerK�(��	�����$����	��	���
�
�c�^�[UR5HnURU5 M gr!�r8rr r�s  rr$� SafeChildWatcher._do_waitpid_allRs#������(�C����S�!�)rc�&�US:�de[R"U[R5up#US:Xag[U5nURR5(a[R"SX5 URRU5upVU"X$/UQ76 g![a UnSn[R"SU5 NOf=f![a: URR5(a[R"SUSS9 ggf=f)Nr�$process %s exited with returncode %sr�8Unknown child process pid %d, will report returncode 255�'Child watcher got an unexpected pid: %rTrl)
r"r
�WNOHANGr#rrCrrJrr�r�poprh)r.rr�r%r�r[r\s       rr �SafeChildWatcher._do_waitpidWs����a����	7��*�*�\�2�:�:�>�K�C��a�x��/��7�J��z�z�#�#�%�%����C�)�7�		-�!�_�_�0�0��5�N�H�
�S�,�t�,��7!�	��C��J��N�N�J��
�	��(�	3��z�z�#�#�%�%����H�"�T�3�&�	3�s#�'B!�:C�!%C	�C	�?D�Dr)r	r
rrr
r+r5r�r�r�r�r$r rrrs@rrr)s5����.���
���"�
 -� -rrc�V^�\rSrSrSrU4SjrU4SjrSrSrSr	Sr
S	rS
rU=r
$)riza?'Fast' child watcher implementation.

This implementation reaps every terminated processes by calling
os.waitpid(-1) directly, possibly breaking other code spawning processes
and waiting for their termination.

There is no noticeable overhead when handling a big number of children
(O(1) each time a child terminates).
c�>�[TU]5 [R"5Ul0UlSUl[R"SSSS9 g)Nrrr�r�r�)	r*r+�	threading�Lock�_lock�_zombies�_forksr:r�r1s �rr+�FastChildWatcher.__init__�sC���
�����^�^�%��
���
�������/�;�%,�	.rc�>�URR5 URR5 [TU]5 gr!)rr=rPr*r5r1s �rr5�FastChildWatcher.close�s,����������
�
����
��
�rc�~�UR U=RS-
slUsSSS5 $!,(df   g=f)Nr)rOrQr)s rr��FastChildWatcher.__enter__�s$��
�Z�Z��K�K�1��K���Z�Z�s�.�
<c�^�UR U=RS-slUR(dUR(d
SSS5 g[UR5nURR	5 SSS5 [
R"SW5 g!,(df   N&=f)Nrz5Caught subprocesses termination from unknown pids: %s)rOrQrPrUr=rr�)r.r�r�r��collateral_victimss     rr��FastChildWatcher.__exit__�sp��
�Z�Z��K�K�1��K��{�{�$�-�-��	�Z�"%�T�]�]�!3���M�M���!��	���C��	 ��Z�s�9B�/B�
B,c��UR(dS5eUR URRU5nSSS5 U"UW/UQ76 g![a X#4UR
U'SSS5 gf=f!,(df   NA=f)NzMust use the context manager)rQrOrPrIrhr)r.r�r[r\r�s     rr��"FastChildWatcher.add_child_handler�s}���{�{�:�:�:�{�
�Z�Z�
�!�]�]�.�.�s�3�
��	��j�(�4�(��
�
�'/�~�����$��
�Z�
���Z�s(�A>�A�A;�0A>�:A;�;A>�>
Bc�@�URU	g![a gf=fr<r=r�s  rr��%FastChildWatcher.remove_child_handler�r?r@c��[R"S[R5upUS:Xag[U5nUR
 URRU5upEURR5(a[R"SX5 SSS5 Wc[R"SX5 O	U"X/WQ76 M�![a gf=f![af UR(aPX0RU'URR5(a[R"SX5 SSS5 GMESnN�f=f!,(df   N�=f)NrFrrEz,unknown process %s exited with returncode %sz8Caught subprocess termination from unknown pid: %d -> %d)r"r
rHr#rrOrrIrrCrrJrhrQrPr�)r.r�r%r�r[r\s      rr$� FastChildWatcher._do_waitpid_all�s0���

<� �j�j��R�Z�Z�8���
�!�8��3�F�;�
����6�%)�_�_�%8�%8��%=�N�H��z�z�+�+�-�-����%K�%(�6�!�&������ #�1���0�4�0�K��%�
��
�� �
$��{�{�-7�
�
�c�*��:�:�/�/�1�1�"�L�L�*>�),�:�!��� $�H�
$����sN�'C�E�
C�'6E�
C�C�AE�:E�E�E�
E�E�
E)rQrOrP)r	r
rrr
r+r5r�r�r�r�r$rrrs@rrrzs0����.��
� �)��(1�(1rrc�Z�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrg)ri�abA 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).
c�L�0UlSUl[R"SSSS9 g)Nrr�r�r�)r�_saved_sighandlerr:r�r)s rr+�MultiLoopChildWatcher.__init__�s*�����!%������4�;�%,�	.rc��URSL$r!)rbr)s rr��MultiLoopChildWatcher.is_actives���%�%�T�1�1rc�T�URR5 URcg[R"[R
5nXR:wa[R"S5 O/[R"[R
UR5 SUlg)Nz+SIGCHLD handler was changed by outside code)	rr=rbrO�	getsignalr)r*rr�)r.rls  rr5�MultiLoopChildWatcher.closesl���������!�!�)���"�"�6�>�>�2���n�n�$��N�N�H�I��M�M�&�.�.�$�*@�*@�A�!%��rc��U$r!rr)s rr��MultiLoopChildWatcher.__enter__r�rc��gr!r�r.r��exc_val�exc_tbs    rr��MultiLoopChildWatcher.__exit__r�rc�r�[R"5nXBU4URU'URU5 gr!)rrrr )r.r�r[r\r"s     rr��'MultiLoopChildWatcher.add_child_handlers3���&�&�(�� $��5������	
����rc�@�URU	g![a gf=fr<r=r�s  rr��*MultiLoopChildWatcher.remove_child_handlerr?r@c�B�URbg[R"[RUR5UlURc+[R
"S5 [RUl[R"[RS5 g)NzaPrevious SIGCHLD handler was set by non-Python code, restore to default handler on watcher close.F)rbrOr)r*rr�rkrWr�s  rr��!MultiLoopChildWatcher.attach_loop%so��
�!�!�-��!'���v�~�~�t�~�~�!N����!�!�)��N�N�J�
K�%+�^�^�D�"�	���F�N�N�E�2rc�^�[UR5HnURU5 M gr!rBr�s  rr$�%MultiLoopChildWatcher._do_waitpid_all6s#������(�C����S�!�)rc�X�US:�de[R"U[R5up#US:Xag[U5nSnURRU5upgnUR5(a[
R"SXb5 gU(a,UR5(a[
R"SX5 UR"XrU/UQ76 g![a  UnSn[
R"SU5 SnN�f=f![a [
R"SUSS	9 gf=f)
NrTrrFF�%Loop %r that handles pid %r is closedrErGrl)r"r
rHr#rrr�rrI�	is_closedrCrJr�rh)	r.rr�r%r��	debug_logr"r[r\s	         rr �!MultiLoopChildWatcher._do_waitpid:s���a����	��*�*�\�2�:�:�>�K�C��a�x��/��7�J��I�	L�#'�?�?�#6�#6�s�#;� �D�D��~�~������F��R�����!1�!1��L�L�!G�!-�;��)�)�(��K�d�K��=!�	��C��J��N�N�J��
��I�	��$�	/�
�N�N�D���
/�	/�s#�'C�D�'D�D� D)�(D)c��UR5 g![[4a e[a [R
"SSS9 gf=f)Nr-Trl)r$r�r�r�rr�)r.rrs   rr*�MultiLoopChildWatcher._sig_chld_sE��	R�� � �"���-�.�	���	R��N�N�A�D�Q�	R�s��/A�A)rrbN)r	r
rrr
r+r�r5r�r�r�r�r�r$r r*rrrrrr�sA��	�$.�2�
&��
���3�""�#L�JRrrc�n�\rSrSrSrSrSrSrSrSr	\
R4SjrS	r
S
rSrSrS
rg)riha%Threaded child watcher implementation.

The watcher uses a thread per process
for waiting for the process finish.

It doesn't require subscription on POSIX signal
but a thread creation is not free.

The watcher has O(1) complexity, its performance doesn't depend
on amount of spawn processes.
c�H�[R"S5Ul0Ulgr�)�	itertoolsr��_pid_counter�_threadsr)s rr+�ThreadedChildWatcher.__init__us��%�O�O�A�.�����
rc��grurr)s rr��ThreadedChildWatcher.is_activeyr�rc��gr!rr)s rr5�ThreadedChildWatcher.close|r�rc��U$r!rr)s rr��ThreadedChildWatcher.__enter__r�rc��gr!rrls    rr��ThreadedChildWatcher.__exit__�r�rc���[URR55Vs/sHnUR5(dMUPM nnU(aU"URS3[
US9 ggs snf)Nz0 has registered but not finished child processesr3)r8r��values�is_aliver0r<)r.rf�thread�threadss    rrg�ThreadedChildWatcher.__del__�se��(,�T�]�]�-A�-A�-C�(D�)�(D�f��o�o�'��(D��)���T�^�^�$�$T�U�!��
���)s�A-�A-c���[R"5n[R"URS[UR53XAX#4SS9nXPRU'UR5 g)Nzasyncio-waitpid-T)�target�namer\�daemon)	rrrM�Threadr �nextr�r��start)r.r�r[r\r"r�s      rr��&ThreadedChildWatcher.add_child_handler�s`���&�&�(���!�!��)9�)9�)9�$�t�?P�?P�:Q�9R�'S�(,�8�'B�)-�/��$�
�
�c�����rc��grurr�s  rr��)ThreadedChildWatcher.remove_child_handler�rrc��gr!rr�s  rr�� ThreadedChildWatcher.attach_loop�r�rc���US:�de[R"US5upV[U5nUR5(a[R
"SX'5 UR5(a[R"SX5 OUR"X5U/UQ76 URRU5 g![a UnSn[R"SU5 N�f=f)NrrErrFry)r"r
r#rCrrJrr�rzr�r�rI)r.r"rr[r\r�r%r�s        rr � ThreadedChildWatcher._do_waitpid�s����a����	7��*�*�\�1�5�K�C�0��7�J��~�~������C�)�7��>�>����N�N�B�D�N��%�%�h�Z�G�$�G��
�
���,�'��'!�	��C��J��N�N�J��
�	�s�B7�7%C�C)r�r�N)r	r
rrr
r+r�r5r�r�r:r;rgr�r�r�r rrrrrrhsB��
���
��
�%�M�M����
�(rrc���[[S5(dg[R"5n[R"[R"US55 g![
a gf=f)NrFrT)�hasattrr"�getpidr5rrS)r�s r�
can_use_pidfdr��sR���2�|�$�$����i�i�k��
������s�A�&�'�������s�AA�
A&�%A&c�N^�\rSrSrSr\rU4SjrSrU4Sjr	Sr
SrSrU=r
$)	�_UnixDefaultEventLoopPolicyi�z:UNIX event loop policy with a watcher for child processes.c�0>�[TU]5 SUlgr!)r*r+�_watcherr1s �rr+�$_UnixDefaultEventLoopPolicy.__init__�s���
������
rc���[R URc.[5(a[	5UlO[5UlSSS5 g!,(df   g=fr!)rrOr�r�rrr)s r�
_init_watcher�)_UnixDefaultEventLoopPolicy._init_watcher�s8��
�\�\��}�}�$� �?�?�$5�$7�D�M�$8�$:�D�M��\�\�s�<A�
A$c��>�[TU]U5 URbH[R"5[R
"5LaURR
U5 ggg)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_loopr�rM�current_thread�main_threadr�)r.r"r0s  �rr��*_UnixDefaultEventLoopPolicy.set_event_loop�sS���	���t�$��M�M�%��(�(�*�i�.C�.C�.E�E��M�M�%�%�d�+�F�
&rc��URcUR5 [R"SSSS9 UR$)znGet the watcher for child processes.

If not yet set, a ThreadedChildWatcher object is automatically created.
r�r�r�r�)r�r�r:r�r)s rr��-_UnixDefaultEventLoopPolicy.get_child_watcher�s@��
�=�=� ���� ����0�:�BI�	K��}�}�rc��Ub[U[5(deURbURR5 Xl[R
"SSSS9 g)z$Set the watcher for child processes.N�set_child_watcherr�r�r�)rorr�r5r:r�)r.r�s  rr��-_UnixDefaultEventLoopPolicy.set_child_watcher�sU����*�W�6J�"K�"K�K�K��=�=�$��M�M���!��
����0�:�BI�	Kr)r�)r	r
rrr
r'�
_loop_factoryr+r�r�r�r�rrrs@rr�r��s+���D�*�M��;�,��K�Krr�)5r
rYr�r�r"r8rOr�r�r�r6rMr:�rrrrrr	r
rrr
�logr�__all__r��ImportErrorrr#�BaseSelectorEventLoopr'�
ReadTransportrt�_FlowControlMixin�WriteTransportr}�BaseSubprocessTransportr�rrrrrrrr��BaseDefaultEventLoopPolicyr�rrrrrr�<module>r�sj��8��	��	��
�
���
�����������������<�<�7��
�C�
D�D�	�
�r2�_�B�B�r2�j
M�Z�5�5�M�`J�j�:�:�(�7�7�J�Z ��F�F� �0S$�S$�l7�,�7�t2�+�2�jN-�'�N-�bj1�'�j1�Z~R�0�~R�BO(�/�O(�b	�6K�&�"C�"C�6K�r+��4���	r

?>