B
    ÐH/\-  ã               @   sr   d Z ddlmZ ddlmZ ddlmZ dg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S )z'
Exceptions.

.. versionadded:: 1.3b1

é    )Úabsolute_import)Údivision)Úprint_functionÚLoopExitc               @   s    e Zd ZdZdd„ Zdd„ ZdS )r   a†  
    Exception thrown when the hub finishes running (`gevent.hub.Hub.run`
    would return).

    In a normal application, this is never thrown or caught
    explicitly. The internal implementation of functions like
    :meth:`gevent.hub.Hub.join` and :func:`gevent.joinall` may catch it, but user code
    generally should not.

    .. caution::
       Errors in application programming can also lead to this exception being
       raised. Some examples include (but are not limited too):

       - greenlets deadlocking on a lock;
       - using a socket or other gevent object with native thread
         affinity from a different thread

    c             C   sF   t | jƒdkr<dd l}d| jd | jd | | jd ¡f S t | ¡S )Né   r   z%s
	Hub: %s
	Handles:
%sé   é   )ÚlenÚargsÚpprintZpformatÚ	ExceptionÚ__repr__)Úselfr   © r   ú0lib/python3.7/site-packages/gevent/exceptions.pyr   '   s    zLoopExit.__repr__c             C   s   t | ƒS )N)Úrepr)r   r   r   r   Ú__str__1   s    zLoopExit.__str__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   
c               @   s   e Zd ZdZdS )ÚBlockingSwitchOutErrorz‘
    Raised when a gevent synchronous function is called from a
    low-level event loop callback.

    This is usually a programming error.
    N)r   r   r   r   r   r   r   r   r   4   s   r   c               @   s   e Zd ZdZdS )ÚInvalidSwitchErrorzŸ
    Raised when the event loop returns control to a greenlet in an
    unexpected way.

    This is usually a bug in gevent, greenlet, or the event loop.
    N)r   r   r   r   r   r   r   r   r   =   s   r   c               @   s   e Zd ZdZdS )ÚConcurrentObjectUseErrora-  
    Raised when an object is used (waited on) by two greenlets
    independently, meaning the object was entered into a blocking
    state by one greenlet and then another while still blocking in the
    first one.

    This is usually a programming error.

    .. seealso:: `gevent.socket.wait`
    N)r   r   r   r   r   r   r   r   r   E   s   
r   N)r   Z
__future__r   r   r   Ú__all__r   r   ÚAssertionErrorr   r   r   r   r   r   r   Ú<module>   s   !	