U
    £öe“	  ã                   @   sÐ   d dl Z d dlmZ G dd„ deƒZG dd„ deƒZG dd„ de jeƒZG d	d
„ d
e jeƒZG dd„ de jeƒZG dd„ de j	eƒZ	G dd„ deƒZ
G dd„ de
ƒZG dd„ deƒZeeee ddœdd„ZdS )é    N)ÚTypec                   @   s   e Zd ZdZdS )ÚCryptoErrorz4
    Base exception for all nacl related errors
    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r	   r	   ú.lib/python3.8/site-packages/nacl/exceptions.pyr      s   r   c                   @   s   e Zd ZdZdS )ÚBadSignatureErrorzD
    Raised when the signature was forged or otherwise corrupt.
    Nr   r	   r	   r	   r
   r      s   r   c                   @   s   e Zd ZdS )ÚRuntimeErrorN©r   r   r   r	   r	   r	   r
   r   $   s   r   c                   @   s   e Zd ZdS )ÚAssertionErrorNr   r	   r	   r	   r
   r   (   s   r   c                   @   s   e Zd ZdS )Ú	TypeErrorNr   r	   r	   r	   r
   r   ,   s   r   c                   @   s   e Zd ZdS )Ú
ValueErrorNr   r	   r	   r	   r
   r   0   s   r   c                   @   s   e Zd ZdS )ÚInvalidkeyErrorNr   r	   r	   r	   r
   r   4   s   r   c                   @   s   e Zd ZdS )ÚCryptPrefixErrorNr   r	   r	   r	   r
   r   8   s   r   c                   @   s   e Zd ZdZdS )Ú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   )ÚcondÚargsÚkwdsÚreturnc                 O   sF   d}|  dt¡}|r.t| t| ¡ d ƒ¡ƒ‚| dkr:dS ||Ž ‚dS )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   Z
_CHK_UNEXPr   r	   r	   r
   ÚensureF   s    
r   )ÚbuiltinsÚtypingr   Ú	Exceptionr   r   r   r   r   r   r   r   r   ÚboolÚobjectr   r	   r	   r	   r
   Ú<module>   s   
