
    f j7                       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	e          Z G d
 de          Z G d de          Z G d de          Z G d de          Z G d de          Zd'dZ G d de          Z G d de          Z G d de          Z G d d e          Z G d! d"e          Z G d# d$e          Z G d% d&e          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__     kC:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\anyio/_core/_exceptions.pyr   r                 r   r   c                      e Zd ZdZdS )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   r   c                  0     e Zd ZdZd fdZd	 fdZ xZS )
BrokenWorkerInterpreterzz
    Raised by :meth:`~anyio.to_interpreter.run_sync` if an unexpected exception is
    raised in the subinterpreter.
    excinfor   c                    |j         }|s8|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__s      r   r   z BrokenWorkerInterpreter.__init__    sv     	;| ; ; .??'+??l+:w{r   returnstrc                
   	 | j         j        }t          dt                                                       d| d                                          S # t          $ r# t                                                      cY S w xY w)Nz
                z@

                Uncaught in the interpreter:

                )r   
errdisplayr   r   __str__strip	Exception)r    r   r!   s     r   r&   zBrokenWorkerInterpreter.__str__,   s    	/I "" 
    EGG    	% 	% 	%77??$$$$$	%s   A *BB)r   r   )r"   r#   )r   r   r   r   r   r&   __classcell__r!   s   @r   r   r      se         

 
 
 
 
 
         r   r   c                  $     e Zd ZdZd fdZ xZS )BusyResourceErrorzg
    Raised when two tasks are trying to read from or write to the same resource
    concurrently.
    actionr#   c                R    t                                          d| d           d S )NzAnother task is already z this resourcer   r   )r    r-   r!   s     r   r   zBusyResourceError.__init__C   s-    JFJJJKKKKKr   )r-   r#   r   r   r   r   r   r)   r*   s   @r   r,   r,   =   sQ         
L L L L L L L L L Lr   r,   c                      e Zd ZdZdS )ClosedResourceErrorz:Raised when trying to use a resource that has been closed.Nr   r   r   r   r2   r2   G   s        DDDDr   r2   c                      e Zd ZdZdS )ConnectionFailedz
    Raised when a connection attempt fails.

    .. note:: This class inherits from :exc:`OSError` for backwards compatibility.
    Nr   r   r   r   r4   r4   K   s           r   r4   	exceptionBaseExceptionr"   $Generator[BaseException, None, None]c              #  ~   K   t          | t                    r!| j        D ]}t          |          E d {V  d S | V  d S )N)
isinstancer	   
exceptionsiterate_exceptions)r5   excs     r   r;   r;   S   si       )/00 ' 	/ 	/C)#..........	/ 	/ r   c                  $     e Zd ZdZd fdZ x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    t                                          d| d           d S )Nz,The delimiter was not found among the first z bytesr/   )r    r?   r!   s     r   r   zDelimiterNotFound.__init__d   s7    L9LLL	
 	
 	
 	
 	
r   )r?   r@   r"   rA   r0   r*   s   @r   r>   r>   ]   sG         
 
 
 
 
 
 
 
 
 
r   r>   c                      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   rD   rD   j   s           r   rD   c                  $     e Zd ZdZd fdZ x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"   rA   c                J    t                                          d           d S )NzBThe stream was closed before the read operation could be completedr/   r    r!   s    r   r   zIncompleteRead.__init__x   s,    P	
 	
 	
 	
 	
r   r"   rA   r0   r*   s   @r   rF   rF   p   sG         
 
 
 
 
 
 
 
 
 
r   rF   c                      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   rK   rK   ~   r   r   rK   c                      e Zd ZdZdS )
WouldBlockz8Raised by ``X_nowait`` functions if ``X()`` would block.Nr   r   r   r   rM   rM      s        BBBBr   rM   c                      e Zd ZdZdS )NoEventLoopErrora1  
    Raised by several functions that require an event loop to be running in the current
    thread when there is no running event loop.

    This is also raised by :func:`.from_thread.run` and :func:`.from_thread.run_sync`
    if not calling from an AnyIO worker thread, and no ``token`` was passed.
    Nr   r   r   r   rO   rO      s           r   rO   c                  $     e Zd ZdZd fdZ xZS )RunFinishedErrorz
    Raised by :func:`.from_thread.run` and :func:`.from_thread.run_sync` if the event
    loop associated with the explicitly passed token has already finished.
    r"   rA   c                J    t                                          d           d S )NzCThe event loop associated with the given token has already finishedr/   rH   s    r   r   zRunFinishedError.__init__   s,    Q	
 	
 	
 	
 	
r   rI   r0   r*   s   @r   rQ   rQ      sG         

 
 
 
 
 
 
 
 
 
r   rQ   )r5   r6   r"   r7   )
__future__r   syscollections.abcr   textwrapr   typingr   version_infoexceptiongroupr	   r(   r   r   r   r,   r2   OSErrorr4   r;   r>   rD   rF   LookupErrorrK   rM   RuntimeErrorrO   rQ   r   r   r   <module>r]      s   " " " " " " 



 % % % % % %            g 2111111    )       )            i      FL L L L L	 L L LE E E E E) E E E    w      

 

 

 

 

	 

 

 

    )   
 
 
 
 
Y 
 
 
       C C C C C C C C    |   	
 	
 	
 	
 	
| 	
 	
 	
 	
 	
r   