
     fY                        d dl mZ d dlZd dlmZ d dlmZmZmZ d dl	Z	d dl
mZmZ erd dlmZ  G d de          Z ed	e
          Z	 d dl
mZ dZn# e$ r dZY nw xY wedd            ZddZdS )    )annotationsN)contextmanager)TYPE_CHECKINGProtocolTypeVar)SOCK_STREAMsocket)	Generatorc                      e Zd ZddZdS )ClosablereturnNonec                    d S N )selfs    c/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/trio/_highlevel_open_unix_stream.pyclosezClosable.close   s          N)r   r   )__name__
__module____qualname__r   r   r   r   r   r      s              r   r   CloseT)bound)AF_UNIXTFobjr   Generator[CloseT, None, None]c              #  H   K   	 | V  d S #  |                                    xY wr   )r   )r   s    r   close_on_errorr      s1      							s   
 !filename3str | bytes | os.PathLike[str] | os.PathLike[bytes]trio.SocketStreamc                6  K   t           st          d          t          t          t                    }t          |          5  |                    t          j        |                      d{V  ddd           n# 1 swxY w Y   t          j
        |          S )a  Opens a connection to the specified
    `Unix domain socket <https://en.wikipedia.org/wiki/Unix_domain_socket>`__.

    You must have read/write permission on the specified file to connect.

    Args:
      filename (str or bytes): The filename to open the connection to.

    Returns:
      SocketStream: a :class:`~trio.abc.Stream` connected to the given file.

    Raises:
      OSError: If the socket file could not be connected to.
      RuntimeError: If AF_UNIX sockets are not supported.
    z/Unix sockets are not supported on this platformN)has_unixRuntimeErrorr	   r   r   r   connectosfspathtrioSocketStream)r    socks     r   open_unix_socketr,   &   s      $  NLMMM ';''D			 0 0ll29X../////////0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 T"""s   .A<<B B )r   r   r   r   )r    r!   r   r"   )
__future__r   r'   
contextlibr   typingr   r   r   r)   trio.socketr   r	   collections.abcr
   r   r   r   r$   ImportErrorr   r,   r   r   r   <module>r3      sK   " " " " " " 				 % % % % % % 3 3 3 3 3 3 3 3 3 3  + + + + + + + + *))))))! ! ! ! !x ! ! ! 
	*	*	*######HH   HHH    # # # # # #s   A AA