AlkantarClanX12

Your IP : 18.116.23.59


Current Path : /opt/alt/python37/lib64/python3.7/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/asyncio/__pycache__/windows_utils.cpython-37.pyc

B

� f��@s�dZddlZejdkred��ddlZddlZddlZddlZddlZddl	Z	ddl
Z
dZdZej
Z
ejZe��Zdded	�d
d�ZGdd
�d
�ZGdd�dej�ZdS)z)Various Windows specific bits and pieces.�NZwin32z
win32 only)�pipe�Popen�PIPE�
PipeHandlei F)TT)�duplex�
overlapped�bufsizec
Cs"tjd�t��tt��d�}|r>tj}tj	tj
B}||}}ntj}tj
}d|}}|tjO}|drp|tj
O}|dr�tj
}nd}d}	}
yZt�||tjd||tjtj�}	t�||dtjtj|tj�}
tj|	dd�}|�d�|	|
fS|	dk	�rt�|	�|
dk	�rt�|
��YnXdS)zELike os.pipe() but with overlapped support and using handles not fds.z\\.\pipe\python-pipe-{:d}-{:d}-)�prefixr�NT)r)�tempfileZmktemp�format�os�getpid�next�
_mmap_counter�_winapiZPIPE_ACCESS_DUPLEXZGENERIC_READZ
GENERIC_WRITEZPIPE_ACCESS_INBOUNDZFILE_FLAG_FIRST_PIPE_INSTANCEZFILE_FLAG_OVERLAPPEDZCreateNamedPipeZ	PIPE_WAITZNMPWAIT_WAIT_FOREVERZNULLZ
CreateFileZ
OPEN_EXISTINGZConnectNamedPipeZGetOverlappedResult�CloseHandle)rrrZaddressZopenmode�accessZobsizeZibsizeZflags_and_attribsZh1Zh2Zov�r�:/opt/alt/python37/lib64/python3.7/asyncio/windows_utils.pyr sB








rc@s\eZdZdZdd�Zdd�Zedd��Zdd	�Ze	j
d
�dd�Zd
d�Zdd�Z
dd�ZdS)rz�Wrapper for an overlapped pipe handle which is vaguely file-object like.

    The IOCP event loop can use these instead of socket objects.
    cCs
||_dS)N)�_handle)�self�handlerrr�__init__VszPipeHandle.__init__cCs2|jdk	rd|j��}nd}d|jj�d|�d�S)Nzhandle=�closed�<� �>)r�	__class__�__name__)rrrrr�__repr__Ys
zPipeHandle.__repr__cCs|jS)N)r)rrrrr`szPipeHandle.handlecCs|jdkrtd��|jS)NzI/O operation on closed pipe)r�
ValueError)rrrr�filenods
zPipeHandle.fileno)rcCs|jdk	r||j�d|_dS)N)r)rrrrr�closeis

zPipeHandle.closecCs,|jdk	r(tjd|��t|d�|��dS)Nz	unclosed )�source)r�warnings�warn�ResourceWarningr#)rrrr�__del__ns
zPipeHandle.__del__cCs|S)Nr)rrrr�	__enter__tszPipeHandle.__enter__cCs|��dS)N)r#)r�t�v�tbrrr�__exit__wszPipeHandle.__exit__N)r�
__module__�__qualname__�__doc__rr �propertyrr"rrr#r(r)r-rrrrrQsrcs"eZdZdZd�fdd�	Z�ZS)rz�Replacement for subprocess.Popen using overlapped pipe handles.

    The stdin, stdout, stderr are None or instances of PipeHandle.
    Nc	s�|�d�rt�|�dd�dks"t�d}}}d}	}
}|tkrbtddd�\}}	t�|tj�}n|}|tkr�tdd�\}
}
t�|
d�}n|}|tkr�tdd�\}}t�|d�}n|tkr�|}n|}z�y t	�j
|f|||d	�|��Wn4x$|	|
|fD]}|dk	r�t�|�q�W�Yn>X|	dk	�r0t
|	�|_|
dk	�rDt
|
�|_|dk	�rXt
|�|_Wd|tk�rpt�|�|tk�r�t�|�|tk�r�t�|�XdS)
NZuniversal_newlinesrr)FTT)rr)TF)r)�stdin�stdout�stderr)�get�AssertionErrorrr�msvcrtZopen_osfhandler
�O_RDONLY�STDOUT�superrrrrr2r3r4r#)r�argsr2r3r4�kwdsZ	stdin_rfdZ
stdout_wfdZ
stderr_wfdZstdin_whZ	stdout_rhZ	stderr_rhZstdin_rhZ	stdout_whZ	stderr_wh�h)rrrr�sL









zPopen.__init__)NNN)rr.r/r0r�
__classcell__rr)rrr~sr)r0�sys�platform�ImportErrorr�	itertoolsr7r
�
subprocessrr%�__all__ZBUFSIZErr9�countrrrrrrrr�<module>s$
1-