
    ǄgU                     h    d Z ddlmZmZmZ ddlmZ ed        Zed        Zed        Z	ed        Z
y)	z 
Exception handling intrinsics.
    )typeserrorscgutils)	intrinsicc                 :    d }t         j                  } |       |fS )z4An intrinsic to check if an exception is raised
    c                 <    | j                   }|j                  |      S N)nrteh_checkcontextbuilder	signatureargsr
   s        \/home/mcse/projects/flask_80/flask-venv/lib/python3.12/site-packages/numba/core/unsafe/eh.pycodegenz exception_check.<locals>.codegen   s    kk||G$$    )r   boolean	typingctxr   restypes      r   exception_checkr   	   s    % mmG9gr   c                 :    d }t         j                  } |       |fS )z5An intrinsic to mark the start of a *try* block.
    c                 \    | j                   }|j                  |       | j                         S r	   )r
   eh_tryget_dummy_valuer   s        r   r   zmark_try_block.<locals>.codegen   s&    kk

7&&((r   r   noner   s      r   mark_try_blockr          )
 jjG9gr   c                 :    d }t         j                  } |       |fS )z3An intrinsic to mark the end of a *try* block.
    c                 \    | j                   }|j                  |       | j                         S r	   )r
   
eh_end_tryr   r   s        r   r   zend_try_block.<locals>.codegen&   s&    kkw&&((r   r   r   s      r   end_try_blockr$   "   r    r   c                     |j                   t        ur*d}t        j                  |j	                  t                    d }t
        j                  } |||      |fS )zwBasically do ``isinstance(exc_value, exc_class)`` for exception objects.
    Used in ``except Exception:`` syntax.
    z#Exception matching is limited to {}c                 "    t         j                  S r	   )r   true_bit)r   r   r   r   s       r   r   z exception_match.<locals>.codegen9   s    r   )	exc_class	Exceptionr   UnsupportedErrorformatr   r   )r   	exc_valuer(   msgr   r   s         r   exception_matchr.   /   sS     )+3%%cjj&;<<  mmG9i('11r   N)__doc__
numba.corer   r   r   numba.core.extendingr   r   r   r$   r.    r   r   <module>r3      se    . - *   	 	 	 	 2 2r   