o
    ;'h¯  ã                   @  sü   d dl mZ d dlZd dlmZ d dlmZ d dlmZ ej	dk r'd 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G dd„ deƒZd"d d!„ZdS )#é    )ÚannotationsN)Ú	Generator)Údedent)ÚAny)é   é   )ÚBaseExceptionGroupc                   @  ó   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   úMC:\Users\shubh\Videos\agent\nova\Lib\site-packages\anyio/_core/_exceptions.pyr
      ó    r
   c                   @  r	   )ÚBrokenWorkerProcessz}
    Raised by :meth:`~anyio.to_process.run_sync` if the worker process terminates abruptly or
    otherwise misbehaves.
    Nr   r   r   r   r   r      r   r   c                      s0   e Zd ZdZd
‡ fdd„Zd‡ fdd	„Z‡  ZS )ÚBrokenWorkerIntepreterzz
    Raised by :meth:`~anyio.to_interpreter.run_sync` if an unexpected exception is
    raised in the subinterpreter.
    Úexcinfor   c                   sP   |j }|s|jr|jr|jj› d|j› �}n|jjp|j}tƒ  |¡ || _d S )Nz: )Ú	formattedÚtypeÚmsgr   ÚsuperÚ__init__r   )Úselfr   r   ©Ú	__class__r   r   r       s   
zBrokenWorkerIntepreter.__init__ÚreturnÚstrc                   sJ   z| j j}W n ty   tƒ  ¡  Y S w tdtƒ  ¡ › d|› d� ¡ ƒS )Nz
                z@

                Uncaught in the interpreter:

                )r   Z
errdisplayÚ	Exceptionr   Ú__str__r   Ústrip)r   r   r   r   r   r!   ,   s   ÿÿûùzBrokenWorkerIntepreter.__str__)r   r   )r   r   )r   r   r   r   r   r!   Ú__classcell__r   r   r   r   r      s    r   c                      ó"   e Zd ZdZd‡ fdd„Z‡  ZS )ÚBusyResourceErrorzg
    Raised when two tasks are trying to read from or write to the same resource
    concurrently.
    Úactionr   c                   ó   t ƒ  d|› d�¡ d S )NzAnother task is already z this resource©r   r   )r   r&   r   r   r   r   C   s   zBusyResourceError.__init__)r&   r   ©r   r   r   r   r   r#   r   r   r   r   r%   =   s    r%   c                   @  r	   )ÚClosedResourceErrorz:Raised when trying to use a resource that has been closed.Nr   r   r   r   r   r*   G   r   r*   c                      s"   e Zd ZdZ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.
    Ú	max_bytesÚintr   ÚNonec                   r'   )Nz,The delimiter was not found among the first z bytesr(   )r   r,   r   r   r   r   R   s   
ÿzDelimiterNotFound.__init__)r,   r-   r   r.   r)   r   r   r   r   r+   K   s    r+   c                   @  r	   )ÚEndOfStreamz[
    Raised when trying to read from a stream that has been closed from the other end.
    Nr   r   r   r   r   r/   X   r   r/   c                      r$   )Ú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   f   s   ÿzIncompleteRead.__init__)r   r.   r)   r   r   r   r   r0   ^   s    r0   c                   @  r	   )Ú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   r1   l   r   r1   c                   @  r	   )Ú
WouldBlockz8Raised by ``X_nowait`` functions if ``X()`` would block.Nr   r   r   r   r   r2   s   r   r2   Ú	exceptionÚBaseExceptionr   ú$Generator[BaseException, None, None]c                 c  s4   � t | tƒr| jD ]	}t|ƒE d H  q	d S | V  d S )N)Ú
isinstancer   Ú
exceptionsÚiterate_exceptions)r3   Úexcr   r   r   r8   w   s   €

ÿ
r8   )r3   r4   r   r5   )Ú
__future__r   ÚsysÚcollections.abcr   Útextwrapr   Útypingr   Úversion_infoZexceptiongroupr   r    r
   r   r   r%   r*   r+   r/   r0   ÚLookupErrorr1   r2   r8   r   r   r   r   Ú<module>   s$    
#
