
    #Ce	                     T   d dl Z d dlmZ  G d de      Z G d de      Z G d de j                  e      Z G d	 d
e j                  e      Z G d de j                  e      Z G d de j                  e      Z	 G d de      Z
 G d de
      Z G d de      Zdededee   ddfdZy)    N)Typec                       e Zd ZdZy)CryptoErrorz4
    Base exception for all nacl related errors
    N__name__
__module____qualname____doc__     /lib/python3.12/site-packages/nacl/exceptions.pyr   r          r   r   c                       e Zd ZdZy)BadSignatureErrorzD
    Raised when the signature was forged or otherwise corrupt.
    Nr   r   r   r   r   r      r   r   r   c                       e Zd Zy)RuntimeErrorNr   r   r	   r   r   r   r   r   $       r   r   c                       e Zd Zy)AssertionErrorNr   r   r   r   r   r   (   r   r   r   c                       e Zd Zy)	TypeErrorNr   r   r   r   r   r   ,   r   r   r   c                       e Zd Zy)
ValueErrorNr   r   r   r   r   r   0   r   r   r   c                       e Zd Zy)InvalidkeyErrorNr   r   r   r   r   r   4   r   r   r   c                       e Zd Zy)CryptPrefixErrorNr   r   r   r   r   r   8   r   r   r   c                       e Zd ZdZy)UnavailableErrorz
    is a subclass of :class:`~nacl.exceptions.RuntimeError`, raised when
    trying to call functions not available in a minimal build of
    libsodium.
    Nr   r   r   r   r    r    <   s     	r   r    condargskwdsreturnc                     d}|j                  dt              }|r4t        |j                  t	        |j                         d                     | du ry || )a  
    Return if a condition is true, otherwise raise a caller-configurable
    :py:class:`Exception`
    :param bool cond: the condition to be checked
    :param sequence args: the arguments to be passed to the exception's
                          constructor
    The only accepted named parameter is `raising` used to configure the
    exception to be raised if `cond` is not `True`
    z8check_condition() got an unexpected keyword argument {0}raisingr   TN)popr   r   formatreprpopitem)r!   r"   r#   
_CHK_UNEXPr&   s        r   ensurer,   F   sW     LJhhy.1G
))$t||~a/@*ABCCt|
4.r   )builtinstypingr   	Exceptionr   r   r   r   r   r   r   r   r    boolobjectr,   r   r   r   <module>r2      s   (  )  	8((+ 		X,,k 		""K 		$$k 		k 		 		| 	 f d9o $ r   