<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
U
    if                     @   s   d Z ddlZejdkredddlZddlZddlZddlZddlZddl	Z	ddl
Z
dZdZejZejZe Zdded	d
dZG dd dZG dd dejZdS )z)Various Windows specific bits and pieces.    NZwin32z
win32 only)pipePopenPIPE
PipeHandlei    F)TT)duplex
overlappedbufsizec              
   C   s$  t jdt ttd}| r>tj}tj	tj
B }|| }}ntj}tj
}d| }}|tjO }|d rp|tjO }|d rtj}nd}d }	}
z\t||tjd||tjtj}	t||dtjtj|tj}
tj|	dd}|d |	|
fW S    |	dk	rt|	 |
dk	rt|
  Y nX dS )zELike os.pipe() but with overlapped support and using handles not fds.z\\.\pipe\python-pipe-{:d}-{:d}-)prefixr      NTr   )tempfileZmktempformatosgetpidnext_mmap_counter_winapiZPIPE_ACCESS_DUPLEXZGENERIC_READZGENERIC_WRITEZPIPE_ACCESS_INBOUNDZFILE_FLAG_FIRST_PIPE_INSTANCEZFILE_FLAG_OVERLAPPEDZCreateNamedPipeZ	PIPE_WAITZNMPWAIT_WAIT_FOREVERZNULLZ
CreateFileZOPEN_EXISTINGZConnectNamedPipeZGetOverlappedResultCloseHandle)r   r   r   ZaddressZopenmodeaccessZobsizeZibsizeZflags_and_attribsZh1Zh2Zov r   :/opt/alt/python38/lib64/python3.8/asyncio/windows_utils.pyr       sb     


           





r   c                   @   sb   e Zd ZdZdd Zdd Zedd Zdd	 Ze	j
d
ddZejfddZdd Zdd ZdS )r   zWrapper for an overlapped pipe handle which is vaguely file-object like.

    The IOCP event loop can use these instead of socket objects.
    c                 C   s
   || _ d S N_handleselfhandler   r   r   __init__V   s    zPipeHandle.__init__c                 C   s2   | j d k	rd| j }nd}d| jj d| dS )Nzhandle=closed< >)r   	__class____name__r   r   r   r   __repr__Y   s    
zPipeHandle.__repr__c                 C   s   | j S r   r   r   r   r   r   r   `   s    zPipeHandle.handlec                 C   s   | j d krtd| j S )NzI/O operation on closed pipe)r   
ValueErrorr%   r   r   r   filenod   s    
zPipeHandle.fileno)r   c                C   s   | j d k	r|| j  d | _ d S r   r   )r   r   r   r   r   closei   s    

zPipeHandle.closec                 C   s*   | j d k	r&|d| t| d |   d S )Nz	unclosed )source)r   ResourceWarningr(   )r   Z_warnr   r   r   __del__n   s    
zPipeHandle.__del__c                 C   s   | S r   r   r%   r   r   r   	__enter__s   s    zPipeHandle.__enter__c                 C   s   |    d S r   )r(   )r   tvtbr   r   r   __exit__v   s    zPipeHandle.__exit__N)r#   
__module____qualname____doc__r   r$   propertyr   r'   r   r   r(   warningswarnr+   r,   r0   r   r   r   r   r   Q   s   
r   c                       s"   e Zd ZdZd fdd	Z  ZS )r   zReplacement for subprocess.Popen using overlapped pipe handles.

    The stdin, stdout, stderr are None or instances of PipeHandle.
    Nc              	      sx  d  } }}d  }	 }
}|t kr@tddd\}}	t|tj}n|}|t krhtdd\}
}t|d}n|}|t krtdd\}}t|d}n|tkr|}n|}zz t j	|f|||d| W n0   |	|
|fD ]}|d k	rt
| qւ Y n>X |	d k	r
t|	| _|
d k	rt|
| _|d k	r2t|| _W 5 |t krJt| |t kr^t| |t krrt| X d S )N)FTT)r   r   )TFr   r   )stdinstdoutstderr)r   r   msvcrtZopen_osfhandler   O_RDONLYSTDOUTr(   superr   r   r   r   r7   r8   r9   )r   argsr7   r8   r9   kwdsZ	stdin_rfdZ
stdout_wfdZ
stderr_wfdZstdin_whZ	stdout_rhZ	stderr_rhZstdin_rhZ	stdout_whZ	stderr_whhr"   r   r   r      sN    










zPopen.__init__)NNN)r#   r1   r2   r3   r   __classcell__r   r   rA   r   r   }   s   r   )r3   sysplatformImportErrorr   	itertoolsr:   r   
subprocessr   r5   __all__ZBUFSIZEr   r<   countr   r   r   r   r   r   r   r   <module>   s$   
1,