
    ih+                     R    d dl mZmZmZ d dlmZ d dlmZ ddlm	Z	  G d de      Z
y)	    )absolute_importprint_functiondivision)contextmanager)Hub   )ExpectedExceptionc                   :    e Zd ZdZdZefZdZed        Z	d Z
d Zy)QuietHubNFc              #   b   K   | j                   }d| _         	 d || _         y# || _         w xY ww)a!  
        Code in the body of this context manager will ignore
        ``EXPECTED_TEST_ERROR`` objects reported to ``handle_error``;
        they will not get a chance to go to the hub's parent.

        This completely changes the semantics of normal error handling
        by avoiding some switches (to the main greenlet, and eventually
        once a callback is processed, back to the hub). This should be used
        in narrow ways for test compatibility for tests that assume
        ``ExpectedException`` objects behave this way.
        TN)IGNORE_EXPECTED_TEST_ERROR)selfolds     P/var/www/html/dev/engine/venv/lib/python3.12/site-packages/gevent/testing/hub.pyignoring_expected_test_errorz%QuietHub.ignoring_expected_test_error"   s3      --*.'	2.1D+cD+s   /# /	,/c                     | j                  |||      \  }}}| j                  rt        || j                        ry t	        j
                  | ||||      S N)_normalize_exceptionr   
issubclassEXPECTED_TEST_ERRORr   handle_error)r   contexttypevaluetbs        r   r   zQuietHub.handle_error6   sR    33D%DeR
 **z$@X@X/YgtUB??    c                     | j                  |||      \  }}}t        || j                        ry t        j                  | ||||      S r   )r   r   r   r   print_exception)r   r   tvr   s        r   r   zQuietHub.print_exceptionA   sH    ,,Q261ba112""4!Q;;r   )__name__
__module____qualname__	_resolver_threadpoolr	   r   r   r   r   r   r    r   r   r   r      s8    IK,.!&2 2&	@<r   r   N)
__future__r   r   r   
contextlibr   
gevent.hubr   	exceptionr	   r   r&   r   r   <module>r+      s#   ( A @ %  (+<s +<r   