ó
úR_c           @` s   d  Z  d d l m Z d d l m Z d d l m Z d g Z d e f d     YZ d e f d     YZ	 d	 e f d
     YZ
 d e f d     YZ d S(   s'   
Exceptions.

.. versionadded:: 1.3b1

i    (   t   absolute_import(   t   division(   t   print_functiont   LoopExitc           B` s    e  Z d  Z d   Z d   Z RS(   s  
    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` s]   t  |  j  d k rP d d  l } d |  j d |  j d | j |  j d  f St j |   S(   Ni   i    s   %s
	Hub: %s
	Handles:
%si   i   (   t   lent   argst   pprintt   pformatt	   Exceptiont   __repr__(   t   selfR   (    (    sJ   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/exceptions.pyR	   '   s    c         C` s
   t  |   S(   N(   t   repr(   R
   (    (    sJ   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/exceptions.pyt   __str__1   s    (   t   __name__t
   __module__t   __doc__R	   R   (    (    (    sJ   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/exceptions.pyR      s   	
t   BlockingSwitchOutErrorc           B` s   e  Z d  Z RS(   s   
    Raised when a gevent synchronous function is called from a
    low-level event loop callback.

    This is usually a programming error.
    (   R   R   R   (    (    (    sJ   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/exceptions.pyR   4   s   t   InvalidSwitchErrorc           B` s   e  Z d  Z RS(   s   
    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.
    (   R   R   R   (    (    (    sJ   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/exceptions.pyR   =   s   t   ConcurrentObjectUseErrorc           B` s   e  Z d  Z RS(   s-  
    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`
    (   R   R   R   (    (    (    sJ   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/exceptions.pyR   E   s   
N(   R   t
   __future__R    R   R   t   __all__R   R   t   AssertionErrorR   R   R   (    (    (    sJ   /var/www/syncserver/local/lib/python2.7/site-packages/gevent/exceptions.pyt   <module>   s   	!	