U
    Rh	                     @  s   d dl mZ d dlZd dlmZ ejdk r6d dlmZ G dd deZ	G dd	 d	eZ
G d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdddddZdS )    )annotationsN)	Generator)      )BaseExceptionGroupc                   @  s   e Zd ZdZdS )BrokenResourceErrorz
    Raised when trying to use a resource that has been rendered unusable due to external
    causes (e.g. a send stream whose peer has disconnected).
    N__name__
__module____qualname____doc__ r   r   =./venv/lib/python3.8/site-packages/anyio/_core/_exceptions.pyr   
   s   r   c                   @  s   e Zd ZdZdS )BrokenWorkerProcesszv
    Raised by :func:`run_sync_in_process` if the worker process terminates abruptly or
    otherwise misbehaves.
    Nr   r   r   r   r   r      s   r   c                      s&   e Zd ZdZdd fddZ  ZS )BusyResourceErrorzg
    Raised when two tasks are trying to read from or write to the same resource
    concurrently.
    str)actionc                   s   t  d| d d S )NzAnother task is already z this resourcesuper__init__)selfr   	__class__r   r   r      s    zBusyResourceError.__init__r	   r
   r   r   r   __classcell__r   r   r   r   r      s   r   c                   @  s   e Zd ZdZdS )ClosedResourceErrorz:Raised when trying to use a resource that has been closed.Nr   r   r   r   r   r   "   s   r   c                      s(   e Zd ZdZddd fddZ  ZS )DelimiterNotFoundz
    Raised during
    :meth:`~anyio.streams.buffered.BufferedByteReceiveStream.receive_until` if the
    maximum number of bytes has been read without the delimiter being found.
    intNone)	max_bytesreturnc                   s   t  d| d d S )Nz,The delimiter was not found among the first z bytesr   )r   r   r   r   r   r   -   s    
zDelimiterNotFound.__init__r   r   r   r   r   r   &   s   r   c                   @  s   e Zd ZdZdS )EndOfStreamz[
    Raised when trying to read from a stream that has been closed from the other end.
    Nr   r   r   r   r   r!   3   s   r!   c                      s&   e Zd ZdZdd fddZ  ZS )IncompleteReada  
    Raised during
    :meth:`~anyio.streams.buffered.BufferedByteReceiveStream.receive_exactly` or
    :meth:`~anyio.streams.buffered.BufferedByteReceiveStream.receive_until` if the
    connection is closed before the requested amount of bytes has been read.
    r   )r    c                   s   t  d d S )NzBThe stream was closed before the read operation could be completedr   )r   r   r   r   r   A   s    zIncompleteRead.__init__r   r   r   r   r   r"   9   s   r"   c                   @  s   e Zd ZdZdS )TypedAttributeLookupErrorz
    Raised by :meth:`~anyio.TypedAttributeProvider.extra` when the given typed attribute
    is not found and no default value has been given.
    Nr   r   r   r   r   r#   G   s   r#   c                   @  s   e Zd ZdZdS )
WouldBlockz8Raised by ``X_nowait`` functions if ``X()`` would block.Nr   r   r   r   r   r$   N   s   r$   BaseExceptionz$Generator[BaseException, None, None])	exceptionr    c                 c  s0   t | tr&| jD ]}t|E d H  qn| V  d S )N)
isinstancer   
exceptionsiterate_exceptions)r&   excr   r   r   r)   R   s    

r)   )Z
__future__r   sysZcollections.abcr   version_infoZexceptiongroupr   	Exceptionr   r   r   r   r   r!   r"   LookupErrorr#   r$   r)   r   r   r   r   <module>   s   

