o
    tPf,                     @   sL   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 deZ
dS )	    )absolute_importprint_functiondivision)contextmanager)Hub   )ExpectedExceptionc                   @   s:   e Zd ZdZdZefZdZedd Z	dd Z
dd ZdS )	QuietHubNFc                 c   s*    | j }d| _ z	dV  W || _ dS || _ 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old r   S/var/www/html/humari/django-venv/lib/python3.10/site-packages/gevent/testing/hub.pyignoring_expected_test_error"   s   z%QuietHub.ignoring_expected_test_errorc                 C   s<   |  |||\}}}| jrt|| jrd S t| ||||S N)_normalize_exceptionr
   
issubclassEXPECTED_TEST_ERRORr   handle_error)r   contexttypevaluetbr   r   r   r   6   s   zQuietHub.handle_errorc                 C   s6   |  |||\}}}t|| jrd S t| ||||S r   )r   r   r   r   print_exception)r   r   tvr   r   r   r   r   B   s   zQuietHub.print_exception)__name__
__module____qualname__	_resolver_threadpoolr   r   r
   r   r   r   r   r   r   r   r   r	      s    
r	   N)
__future__r   r   r   
contextlibr   
gevent.hubr   	exceptionr   r	   r   r   r   r   <module>   s
   