AlkantarClanX12
Current Path : /opt/alt/python37/lib64/python3.7/asyncio/__pycache__/ |
Current File : //opt/alt/python37/lib64/python3.7/asyncio/__pycache__/windows_utils.cpython-37.opt-2.pyc |
B YI~d� � @ s� d dl Z e jdkred��d dlZd dlZd dlZd dlZd dlZd dlZd dl Z dZ dZejZej Z e�� Zdded�d d �ZG dd� d�ZG d d� dej�ZdS )� N�win32z win32 only)�pipe�Popen�PIPE� PipeHandlei F)TT)�duplex� overlapped�bufsizec C s" t jd�t�� tt��d�}| r>tj}tj tj B }|| }}ntj}tj }d| }}|tjO }|d rp|tj O }|d r�tj }nd}d } } yZt�||tjd||tjtj�} t�||dtjtj|tj�} tj| dd�}|�d� | | fS | d k �rt�| � | d k �rt�| � � Y nX d S )Nz\\.\pipe\python-pipe-{:d}-{:d}-)�prefixr � T)r )�tempfileZmktemp�format�os�getpid�next� _mmap_counter�_winapiZPIPE_ACCESS_DUPLEXZGENERIC_READZ GENERIC_WRITEZPIPE_ACCESS_INBOUNDZFILE_FLAG_FIRST_PIPE_INSTANCEZFILE_FLAG_OVERLAPPEDZCreateNamedPipeZ PIPE_WAITZNMPWAIT_WAIT_FOREVERZNULLZ CreateFileZ OPEN_EXISTINGZConnectNamedPipeZGetOverlappedResult�CloseHandle)r r r ZaddressZopenmode�accessZobsizeZibsizeZflags_and_attribsZh1Zh2Zov� r �:/opt/alt/python37/lib64/python3.7/asyncio/windows_utils.pyr sB r c @ sX e Zd Zdd� Zdd� Zedd� �Zdd� Zej d �d d�Z dd � Zdd� Zdd� Z dS )r c C s || _ d S )N)�_handle)�self�handler r r �__init__V s zPipeHandle.__init__c C s2 | j d k rd| j ��}nd}d| jj� d|� d�S )Nzhandle=�closed�<� �>)r � __class__�__name__)r r r r r �__repr__Y s zPipeHandle.__repr__c C s | j S )N)r )r r r r r ` s zPipeHandle.handlec C s | j d krtd��| j S )NzI/O operation on closed pipe)r � ValueError)r r r r �filenod s zPipeHandle.fileno)r c C s | j d k r|| j � d | _ d S )N)r )r r r r r �closei s zPipeHandle.closec C s, | j d k r(tjd| ��t| d� | �� d S )Nz unclosed )�source)r �warnings�warn�ResourceWarningr$ )r r r r �__del__n s zPipeHandle.__del__c C s | S )Nr )r r r r � __enter__t s zPipeHandle.__enter__c C s | � � d S )N)r$ )r �t�v�tbr r r �__exit__w s zPipeHandle.__exit__N)r � __module__�__qualname__r r! �propertyr r# r r r$ r) r* r. r r r r r Q s r c s e Zd Zd� fdd� Z� ZS )r Nc s| d } }}d } } }|t kr@tddd�\}} t�|tj�}n|}|t krhtdd�\} } t�| d�}n|}|t kr�tdd�\}}t�|d�}n|tkr�|}n|}z�y t� j|f|||d�|�� W n4 x$| | |fD ]}|d k r�t � |� q�W � Y n>X | d k �rt| �| _| d k �r"t| �| _ |d k �r6t|�| _W d |t k�rNt�|� |t k�rbt�|� |t k�rvt�|� X d S )N)FTT)r r )TF)r r )�stdin�stdout�stderr)r r �msvcrtZopen_osfhandler �O_RDONLY�STDOUT�superr r r r r2 r3 r4 r$ )r �argsr2 r3 r4 �kwdsZ stdin_rfdZ stdout_wfdZ stderr_wfdZstdin_whZ stdout_rhZ stderr_rhZstdin_rhZ stdout_whZ stderr_wh�h)r r r r � sH zPopen.__init__)NNN)r r/ r0 r � __classcell__r r )r r r ~ s r )�sys�platform�ImportErrorr � itertoolsr5 r � subprocessr r&